aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zfs/zfs_iter.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/zfs/zfs_iter.c')
-rw-r--r--cmd/zfs/zfs_iter.c64
1 files changed, 8 insertions, 56 deletions
diff --git a/cmd/zfs/zfs_iter.c b/cmd/zfs/zfs_iter.c
index 7d1eae07c..69b802f77 100644
--- a/cmd/zfs/zfs_iter.c
+++ b/cmd/zfs/zfs_iter.c
@@ -144,20 +144,19 @@ zfs_callback(zfs_handle_t *zhp, void *data)
(cb->cb_types &
(ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME))) &&
zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) {
- (void) zfs_iter_filesystems(zhp, cb->cb_flags,
- zfs_callback, data);
+ (void) zfs_iter_filesystems(zhp, zfs_callback, data);
}
if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT |
ZFS_TYPE_BOOKMARK)) == 0) && include_snaps) {
- (void) zfs_iter_snapshots(zhp, cb->cb_flags,
+ (void) zfs_iter_snapshots(zhp,
+ (cb->cb_flags & ZFS_ITER_SIMPLE) != 0,
zfs_callback, data, 0, 0);
}
if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT |
ZFS_TYPE_BOOKMARK)) == 0) && include_bmarks) {
- (void) zfs_iter_bookmarks(zhp, cb->cb_flags,
- zfs_callback, data);
+ (void) zfs_iter_bookmarks(zhp, zfs_callback, data);
}
cb->cb_depth--;
@@ -213,58 +212,11 @@ zfs_free_sort_columns(zfs_sort_column_t *sc)
}
}
-/*
- * Return true if all of the properties to be sorted are populated by
- * dsl_dataset_fast_stat(). Note that sc == NULL (no sort) means we
- * don't need any extra properties, so returns true.
- */
-boolean_t
-zfs_sort_only_by_fast(const zfs_sort_column_t *sc)
-{
- while (sc != NULL) {
- switch (sc->sc_prop) {
- case ZFS_PROP_NAME:
- case ZFS_PROP_GUID:
- case ZFS_PROP_CREATETXG:
- case ZFS_PROP_NUMCLONES:
- case ZFS_PROP_INCONSISTENT:
- case ZFS_PROP_REDACTED:
- case ZFS_PROP_ORIGIN:
- break;
- default:
- return (B_FALSE);
- }
- sc = sc->sc_next;
- }
-
- return (B_TRUE);
-}
-
-boolean_t
-zfs_list_only_by_fast(const zprop_list_t *p)
+int
+zfs_sort_only_by_name(const zfs_sort_column_t *sc)
{
- if (p == NULL) {
- /* NULL means 'all' so we can't use simple mode */
- return (B_FALSE);
- }
-
- while (p != NULL) {
- switch (p->pl_prop) {
- case ZFS_PROP_NAME:
- case ZFS_PROP_GUID:
- case ZFS_PROP_CREATETXG:
- case ZFS_PROP_NUMCLONES:
- case ZFS_PROP_INCONSISTENT:
- case ZFS_PROP_REDACTED:
- case ZFS_PROP_ORIGIN:
- break;
- default:
- return (B_FALSE);
- }
- p = p->pl_next;
- }
-
- return (B_TRUE);
+ return (sc != NULL && sc->sc_next == NULL &&
+ sc->sc_prop == ZFS_PROP_NAME);
}
static int