Skip to content

Commit 838b03b

Browse files
author
Jonathan Carter
authored
Merge pull request #82 from attie/improve_list
Improve performance of listings
2 parents e126876 + 41eddc9 commit 838b03b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/zfs-auto-snapshot.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,20 +367,20 @@ fi
367367
ZPOOL_STATUS=$(env LC_ALL=C zpool status 2>&1 ) \
368368
|| { print_log error "zpool status $?: $ZPOOL_STATUS"; exit 135; }
369369

370-
ZFS_LIST=$(env LC_ALL=C zfs list -H -t filesystem,volume -s name \
371-
-o name,com.sun:auto-snapshot,com.sun:auto-snapshot:"$opt_label") \
370+
ZFS_LIST=$(env LC_ALL=C zfs list -r -H -t filesystem,volume -s name \
371+
-o name,com.sun:auto-snapshot,com.sun:auto-snapshot:"$opt_label" "${@}") \
372372
|| { print_log error "zfs list $?: $ZFS_LIST"; exit 136; }
373373

374374
if [ -n "$opt_fast_zfs_list" ]
375375
then
376-
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -o name -s name | \
376+
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -r -H -t snapshot -o name -s name "${@}" | \
377377
grep $opt_prefix | \
378378
awk '{ print substr( $0, length($0) - 14, length($0) ) " " $0}' | \
379379
sort -r -k1,1 -k2,2 | \
380380
awk '{ print substr( $0, 17, length($0) )}') \
381381
|| { print_log error "zfs list $?: $SNAPSHOTS_OLD"; exit 137; }
382382
else
383-
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -S creation -o name) \
383+
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -r -H -t snapshot -S creation -o name "${@}" ) \
384384
|| { print_log error "zfs list $?: $SNAPSHOTS_OLD"; exit 137; }
385385
fi
386386

0 commit comments

Comments
 (0)