aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zfs
diff options
context:
space:
mode:
authorAlan Somers <[email protected]>2021-04-29 15:19:44 -0600
committerGitHub <[email protected]>2021-04-29 14:19:44 -0700
commite4288a8397bb1f9df763c08bf93260062da8173a (patch)
tree1e59be7709d3e3e5be14d17d5a92f447af971758 /cmd/zfs
parentbc9c7265ae01b970a0353cc390d4e2fb08dc7194 (diff)
zfs get: don't lookup mount options when using "-s local"
Looking up mount options can be very expensive on servers with many mounted file systems. When doing "zfs get" with any "-s" option that does not include "temporary", the mount list will never be used. This commit optimizes for that case. This is a breaking commit for libzfs! Callers of zfs_get_prop are now required to initialize src. To preserve existing behavior, they should initialize it to ZPROP_SRC_NONE. Sponsored by: Axcient Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alan Somers <[email protected]> Closes #11955
Diffstat (limited to 'cmd/zfs')
-rw-r--r--cmd/zfs/zfs_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 24ff074c4..9859a866f 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -1882,7 +1882,6 @@ get_callback(zfs_handle_t *zhp, void *data)
{
char buf[ZFS_MAXPROPLEN];
char rbuf[ZFS_MAXPROPLEN];
- zprop_source_t sourcetype;
char source[ZFS_MAX_DATASET_NAME_LEN];
zprop_get_cbdata_t *cbp = data;
nvlist_t *user_props = zfs_get_user_props(zhp);
@@ -1893,6 +1892,7 @@ get_callback(zfs_handle_t *zhp, void *data)
boolean_t received = is_recvd_column(cbp);
for (; pl != NULL; pl = pl->pl_next) {
+ zprop_source_t sourcetype = cbp->cb_sources;
char *recvdval = NULL;
/*
* Skip the special fake placeholder. This will also skip over
@@ -4660,7 +4660,7 @@ zfs_do_send(int argc, char **argv)
*/
if (fromname && (cp = strchr(fromname, '@')) != NULL) {
char origin[ZFS_MAX_DATASET_NAME_LEN];
- zprop_source_t src;
+ zprop_source_t src = ZPROP_SRC_NONE;
(void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN,
origin, sizeof (origin), &src, NULL, 0, B_FALSE);