Commit 7b6d8a52 authored by Shawn Webb's avatar Shawn Webb
Browse files

Add various getters and setters


Signed-off-by: Shawn Webb's avatarShawn Webb <shawn.webb@hardenedbsd.org>
parent 4d428e23
......@@ -80,6 +80,14 @@ void lattzfs_ctx_free(lattzfs_ctx_t **);
bool lattzfs_zpool_get_status(lattzfs_ctx_t *, lattzfs_zpool_status_t *,
lattzfs_zpool_errata_t *);
uint64_t lattzfs_get_version(lattzfs_ctx_t *);
uint64_t lattzfs_get_flags(lattzfs_ctx_t *);
uint64_t lattzfs_set_flags(lattzfs_ctx_t *, uint64_t);
uint64_t lattzfs_set_flag(lattzfs_ctx_t *, uint64_t);
void *lattzfs_get_zfs_handle(lattzfs_ctx_t *);
void *lattzfs_get_pool_handle(lattzfs_ctx_t *);
char *lattzfs_get_pool_name(lattzfs_ctx_t *);
#ifdef __cplusplus
}
#endif
......
......@@ -126,6 +126,89 @@ lattzfs_zpool_get_status(lattzfs_ctx_t *ctx, lattzfs_zpool_status_t *status,
return (true);
}
uint64_t
lattzfs_get_version(lattzfs_ctx_t *ctx)
{
if (ctx == NULL) {
return (0);
}
return (ctx->lc_version);
}
uint64_t
lattzfs_get_flags(lattzfs_ctx_t *ctx)
{
if (ctx == NULL) {
return (0);
}
return (ctx->lc_flags);
}
uint64_t
lattzfs_set_flags(lattzfs_ctx_t *ctx, uint64_t flags)
{
uint64_t orig;
if (ctx == NULL) {
return (0);
}
orig = ctx->lc_flags;
ctx->lc_flags = flags;
return (orig);
}
uint64_t
lattzfs_set_flag(lattzfs_ctx_t *ctx, uint64_t flag)
{
uint64_t orig;
if (ctx == NULL) {
return (0);
}
orig = ctx->lc_flags;
ctx->lc_flags |= flag;
return (orig);
}
void *
lattzfs_get_zfs_handle(lattzfs_ctx_t *ctx)
{
if (ctx == NULL) {
return (NULL);
}
return (ctx->lc_zfs_handle);
}
void *
lattzfs_get_pool_handle(lattzfs_ctx_t *ctx)
{
if (ctx == NULL) {
return (NULL);
}
return (ctx->lc_pool_handle);
}
char *
lattzfs_get_pool_name(lattzfs_ctx_t *ctx)
{
if (ctx == NULL) {
return (NULL);
}
return (ctx->lc_pool_name);
}
static bool
_lattzfs_pool_open(lattzfs_ctx_t *ctx)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment