Btrfs-progs: list snapshots by generation
authorLiu Bo <liubo2009@cn.fujitsu.com>
Fri, 3 Aug 2012 09:48:56 +0000 (17:48 +0800)
committerroot <root@localhost.localdomain>
Thu, 4 Oct 2012 20:26:32 +0000 (16:26 -0400)
commitf02827c1c03e5c6d7bd02fe49d8f365680fe1aee
treecf1da5c094c6dcf965440d61d8f034cfbb6e0727
parent95eeaf1c29774ad72b087e8b9d9938f5a17434b5
Btrfs-progs: list snapshots by generation

The idea is that we usually use snapshot to backup/restore our data, and the
common way can be a cron script which makes lots of snapshots, so we can end
up with spending some time to find the latest snapshot to restore.

This adds a feature for 'btrfs subvolume list' to let it list snapshots by their
_created_ generation.

What we need to do is just to list them in descending order and get the latest
snapshot.  What's more, we can find the oldest snapshot as well by listing
snapshots in ascending order.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
btrfs-list.c
cmds-subvolume.c