]> git.proxmox.com Git - mirror_zfs.git/commit
Do not iterate through filesystems unnecessarily
authorTom Caputi <tcaputi@datto.com>
Mon, 1 Apr 2019 18:58:59 +0000 (14:58 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 1 Apr 2019 18:58:59 +0000 (11:58 -0700)
commitdf583073eb49e602d07ff4ec7d769732b9b9f077
treeda83ad73e760ef2b6828ae828512bacc21ee11e6
parente03b25a56443c79a53327806fa4cc5a2b6acd70c
Do not iterate through filesystems unnecessarily

Currently, when attempting to list snapshots ZFS may do a lot of
extra work checking child datasets. This is because the code does
not realize that it will not be able to reach any snapshots
contained within snapshots that are at the depth limit since the
snapshots of those datasets are counted as an additional layer
deeper. This patch corrects this issue.

In addition, this patch adds the ability to do perform the commands:

$ zfs list -t snapshot <dataset>
$ zfs get -t snapshot <prop> <dataset>

as a convenient way to list out properties of all snapshots of a
given dataset without having to use the depth limit.

Reviewed-by: Alek Pinchuk <apinchuk@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8539
cmd/zfs/zfs_iter.c
cmd/zfs/zfs_main.c
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/cli_root/zfs_get/zfs_get_009_pos.ksh