Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shawn Webb
liblattzfs
Commits
7b6d8a52
Commit
7b6d8a52
authored
Aug 15, 2021
by
Shawn Webb
Browse files
Add various getters and setters
Signed-off-by:
Shawn Webb
<
shawn.webb@hardenedbsd.org
>
parent
4d428e23
Changes
2
Show whitespace changes
Inline
Side-by-side
include/liblattzfs.h
View file @
7b6d8a52
...
...
@@ -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
...
...
src/liblattzfs.c
View file @
7b6d8a52
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment