Skip to content

Commit

Permalink
Sort snapshots by name when listing snapshot names.
Browse files Browse the repository at this point in the history
This provides a dramatical speedup on FreeBSD and Linux:
http://svnweb.freebsd.org/base?view=revision&revision=230438
openzfs/zfs@0cee2406

Close #75
  • Loading branch information
mmatuska authored and aqw committed Apr 12, 2016
1 parent 6bb1c68 commit f06e9f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion completion/zfsnap-completion.bash
Expand Up @@ -42,7 +42,7 @@ __zfsnap_list_datasets() {
# prints zfs snapshots
__zfsnap_list_snapshots() {
local dataset=${1%@*}
$__ZFSNAP_ZFS list -H -t snapshot -o name -d 1 -r $dataset
$__ZFSNAP_ZFS list -H -t snapshot -o name -s name -d 1 -r $dataset
}

# prints valid flags of a given command
Expand Down
2 changes: 1 addition & 1 deletion share/zfsnap/commands/destroy.sh
Expand Up @@ -75,7 +75,7 @@ while [ -n "$1" ]; do

# operate on pool/fs supplied
if [ -n "$1" ]; then
ZFS_SNAPSHOTS=`$ZFS_CMD list -H -o name -t snapshot -r $1` >&2 || Fatal "'$1' does not exist!"
ZFS_SNAPSHOTS=`$ZFS_CMD list -H -o name -s name -t snapshot -r $1` >&2 || Fatal "'$1' does not exist!"
! SkipPool "$1" && shift && continue

for SNAPSHOT in $ZFS_SNAPSHOTS; do
Expand Down
2 changes: 1 addition & 1 deletion share/zfsnap/commands/recurseback.sh
Expand Up @@ -66,7 +66,7 @@ while [ -n "$1" ]; do
# rollback
if [ -n "$1" ]; then
IsSnapshot "$1" || Fatal "You must provide a snapshot to rollback to."
$ZFS_CMD list -H -t snapshot -o name "$1" > /dev/null || Fatal "'$1' does not exist!"
$ZFS_CMD list -H -t snapshot -o name -s name "$1" > /dev/null || Fatal "'$1' does not exist!"
TrimToFileSystem "$1" && FS_NAME=$RETVAL
SNAPSHOT_NAME=${1##${FS_NAME}@}

Expand Down

0 comments on commit f06e9f1

Please sign in to comment.