aboutsummaryrefslogtreecommitdiff
path: root/lib/libbe/be_info.c
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-07-26 03:13:07 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-07-26 03:13:07 +0000
commit843e39ce7bf6449f5cbb9144774d589574fda3b1 (patch)
tree3e3e6bd80b262056b291cb07a52b8e9f16a52669 /lib/libbe/be_info.c
parent734e362fa1a843128dc1f437ef16427084cdf46f (diff)
downloadsrc-843e39ce7bf6449f5cbb9144774d589574fda3b1.tar.gz
src-843e39ce7bf6449f5cbb9144774d589574fda3b1.zip
libbe(3): Add be_mounted_at to check a mount point
At a bare minimum, this function will return 0 if a BE is mounted at the given path or non-zero otherwise. If the optional 'details' nvlist is supplied, it is filled with an nvpair containing just the information about the BE mounted at the path. This nvpair is structured just as it is for be_get_bootenv_props, except limited to just the single mount point.
Notes
Notes: svn path=/projects/bectl/; revision=336729
Diffstat (limited to 'lib/libbe/be_info.c')
-rw-r--r--lib/libbe/be_info.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/libbe/be_info.c b/lib/libbe/be_info.c
index 7cb014086db0..959958304bf4 100644
--- a/lib/libbe/be_info.c
+++ b/lib/libbe/be_info.c
@@ -29,14 +29,6 @@
#include "be.h"
#include "be_impl.h"
-typedef struct prop_data {
- nvlist_t *list;
- libbe_handle_t *lbh;
-} prop_data_t;
-
-static int prop_list_builder_cb(zfs_handle_t *, void *);
-static int prop_list_builder(prop_data_t *);
-
/*
* Returns the name of the active boot environment
*/
@@ -111,7 +103,7 @@ be_get_bootenv_props(libbe_handle_t *lbh, nvlist_t *dsnvl)
* the bootenv root, populate an nvlist_t of its relevant properties.
* TODO: should any other properties be included?
*/
-static int
+int
prop_list_builder_cb(zfs_handle_t *zfs_hdl, void *data_p)
{
char buf[512], *mountpoint;
@@ -189,7 +181,7 @@ prop_list_builder_cb(zfs_handle_t *zfs_hdl, void *data_p)
* XXX TODO: ensure that this is always consistent (run after adds, deletes,
* renames,etc
*/
-static int
+int
prop_list_builder(prop_data_t *data)
{
zfs_handle_t *root_hdl;