diff options
author | Lukas Czerner <lczerner@redhat.com> | 2012-12-11 15:24:58 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2013-02-01 16:55:03 +0100 |
commit | e599d6c5daede0a06e637e6293af1c9b3523c24c (patch) | |
tree | 2a3a350b505a39194d48be6021df772e390e80e1 /cmds-subvolume.c | |
parent | efbb344a59cc136f895d795058032e3f9c88a751 (diff) |
Btrfs-progs: move path modification to filters
Commit 8e8e019e910f20947fea7eff5da40753639d8870 introduces -a option
which will list all subvolumes with distinguishing between relative and
absolute by prepending absolute patch with "<FS_TREE>".
This commit moves the path modification to a filter code rather than
doing so in path construction in resolve_root(). This gives us more
flexibility in formatting path output.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r-- | cmds-subvolume.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c index e3cdb1e0..1f29ed31 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -278,7 +278,9 @@ static const char * const cmd_subvol_list_usage[] = { "List subvolumes (and snapshots)", "", "-p print parent ID", - "-a print all the subvolumes in the filesystem.", + "-a print all the subvolumes in the filesystem and", + " distinguish absolute and relative path with respect", + " to the given <path>", "-u print the uuid of subvolumes (and snapshots)", "-t print the result as a table", "-s list snapshots only in the filesystem", @@ -401,7 +403,12 @@ static int cmd_subvol_list(int argc, char **argv) } top_id = btrfs_list_get_path_rootid(fd); - if (!is_list_all) + + if (is_list_all) + btrfs_list_setup_filter(&filter_set, + BTRFS_LIST_FILTER_FULL_PATH, + top_id); + else btrfs_list_setup_filter(&filter_set, BTRFS_LIST_FILTER_TOPID_EQUAL, top_id); |