-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dont iterate through filesystems unnecessarily #8539
Conversation
ac7ee3c
to
b3caec4
Compare
cmd/zfs/zfs_iter.c
Outdated
*/ | ||
if ((cb->cb_depth < cb->cb_depth_limit || | ||
(cb->cb_types & ZFS_TYPE_FILESYSTEM)) && | ||
zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this if
have braces? The second part of the diff exists only to add them to the if
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed it should, @tcaputi can you please add these.
Codecov Report
@@ Coverage Diff @@
## master #8539 +/- ##
=========================================
+ Coverage 78.59% 78.7% +0.1%
=========================================
Files 380 380
Lines 116440 116450 +10
=========================================
+ Hits 91521 91652 +131
+ Misses 24919 24798 -121
Continue to review full report at Codecov.
|
b3caec4
to
2591097
Compare
@behlendorf I fixed the issues found in the test cases. Please re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for resolving the test failures. This still looks good, just the one minor style nit.
cmd/zfs/zfs_iter.c
Outdated
*/ | ||
if ((cb->cb_depth < cb->cb_depth_limit || | ||
(cb->cb_types & ZFS_TYPE_FILESYSTEM)) && | ||
zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed it should, @tcaputi can you please add these.
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 conatined 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. Signed-off-by: Tom Caputi <tcaputi@datto.com>
2591097
to
55372e5
Compare
@behlendorf fixed. |
Codecov Report
@@ Coverage Diff @@
## master #8539 +/- ##
==========================================
- Coverage 78.72% 78.66% -0.07%
==========================================
Files 381 380 -1
Lines 117499 116451 -1048
==========================================
- Hits 92497 91601 -896
+ Misses 25002 24850 -152
Continue to review full report at Codecov.
|
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
$ zfs get -t snapshot
as a convenient way to list out properties of all snapshots of a
given dataset without having to use the depth limit.
Signed-off-by: Tom Caputi tcaputi@datto.com
Types of changes
Checklist:
Signed-off-by
.