aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorUmer Saleem <[email protected]>2023-10-03 04:58:54 +0500
committerBrian Behlendorf <[email protected]>2023-10-03 15:41:46 -0700
commit8015e2ea66b4f6233877fef29a8a35594f33558d (patch)
tree2a9b7133207f5d9138ecac9dec19ccc89a02c409 /include
parentc53bc3837cb67a36b53ee7b9ae02903dc7b86fdb (diff)
Add '-u' - nomount flag for zfs set
This commit adds '-u' flag for zfs set operation. With this flag, mountpoint, sharenfs and sharesmb properties can be updated without actually mounting or sharing the dataset. Previously, if dataset was unmounted, and mountpoint property was updated, dataset was not mounted after the update. This behavior is changed in #15240. We mount the dataset whenever mountpoint property is updated, regardless if it's mounted or not. To provide the user with option to keep the dataset unmounted and still update the mountpoint without mounting the dataset, '-u' flag can be used. If any of mountpoint, sharenfs or sharesmb properties are updated with '-u' flag, the property is set to desired value but the operation to (re/un)mount and/or (re/un)share the dataset is not performed and dataset remains as it was before. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Umer Saleem <[email protected]> Closes #15322
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index fa05b7921..6c3669273 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -523,6 +523,7 @@ _LIBZFS_H nvlist_t *zfs_valid_proplist(libzfs_handle_t *, zfs_type_t,
_LIBZFS_H const char *zfs_prop_to_name(zfs_prop_t);
_LIBZFS_H int zfs_prop_set(zfs_handle_t *, const char *, const char *);
_LIBZFS_H int zfs_prop_set_list(zfs_handle_t *, nvlist_t *);
+_LIBZFS_H int zfs_prop_set_list_flags(zfs_handle_t *, nvlist_t *, int);
_LIBZFS_H int zfs_prop_get(zfs_handle_t *, zfs_prop_t, char *, size_t,
zprop_source_t *, char *, size_t, boolean_t);
_LIBZFS_H int zfs_prop_get_recvd(zfs_handle_t *, const char *, char *, size_t,
@@ -645,6 +646,13 @@ typedef struct zprop_get_cbdata {
vdev_cbdata_t cb_vdevs;
} zprop_get_cbdata_t;
+#define ZFS_SET_NOMOUNT 1
+
+typedef struct zprop_set_cbdata {
+ int cb_flags;
+ nvlist_t *cb_proplist;
+} zprop_set_cbdata_t;
+
_LIBZFS_H void zprop_print_one_property(const char *, zprop_get_cbdata_t *,
const char *, const char *, zprop_source_t, const char *,
const char *);