Add convenience 'zfs_get' functions

Add get functions to match existing ones.

Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: John Ramsden <johnramsden@riseup.net>
Closes #6308
This commit is contained in:
John 2017-10-19 11:18:42 -07:00 committed by Brian Behlendorf
parent bbf1ad67cd
commit 6044cf59cd
2 changed files with 17 additions and 0 deletions

View File

@ -502,6 +502,7 @@ extern uint64_t zfs_prop_get_int(zfs_handle_t *, zfs_prop_t);
extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t); extern int zfs_prop_inherit(zfs_handle_t *, const char *, boolean_t);
extern const char *zfs_prop_values(zfs_prop_t); extern const char *zfs_prop_values(zfs_prop_t);
extern int zfs_prop_is_string(zfs_prop_t prop); extern int zfs_prop_is_string(zfs_prop_t prop);
extern nvlist_t *zfs_get_all_props(zfs_handle_t *);
extern nvlist_t *zfs_get_user_props(zfs_handle_t *); extern nvlist_t *zfs_get_user_props(zfs_handle_t *);
extern nvlist_t *zfs_get_recvd_props(zfs_handle_t *); extern nvlist_t *zfs_get_recvd_props(zfs_handle_t *);
extern nvlist_t *zfs_get_clones_nvl(zfs_handle_t *); extern nvlist_t *zfs_get_clones_nvl(zfs_handle_t *);

View File

@ -64,6 +64,7 @@
#include "zfs_namecheck.h" #include "zfs_namecheck.h"
#include "zfs_prop.h" #include "zfs_prop.h"
#include "libzfs_impl.h" #include "libzfs_impl.h"
#include "libzfs.h"
#include "zfs_deleg.h" #include "zfs_deleg.h"
static int userquota_propname_decode(const char *propname, boolean_t zoned, static int userquota_propname_decode(const char *propname, boolean_t zoned,
@ -4353,6 +4354,21 @@ error:
return (ret); return (ret);
} }
nvlist_t *
zfs_get_all_props(zfs_handle_t *zhp)
{
return (zhp->zfs_props);
}
nvlist_t *
zfs_get_recvd_props(zfs_handle_t *zhp)
{
if (zhp->zfs_recvd_props == NULL)
if (get_recvd_props_ioctl(zhp) != 0)
return (NULL);
return (zhp->zfs_recvd_props);
}
nvlist_t * nvlist_t *
zfs_get_user_props(zfs_handle_t *zhp) zfs_get_user_props(zfs_handle_t *zhp)
{ {