btrfs-progs: subvol show: fix the path use full_path as provided by the root info
authorAnand Jain <anand.jain@oracle.com>
Wed, 12 Jul 2017 07:20:27 +0000 (15:20 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 20 Jul 2017 15:43:43 +0000 (17:43 +0200)
commitb7df24aa5cddc4802b9938f56372b73869775cd9
tree0e1c7f8343d62950cbadddd5a62817f3f4edc1bc
parente800b9b5da433ab6c8dbbb4c9f41ba8998c51a32
btrfs-progs: subvol show: fix the path use full_path as provided by the root info

This is a kind of preparatory patch for the patch which will add
--rootid and --uuid options for the btrfs subvol show command.

As of now btrfs subvol show is using the external user provided subvol
path to show in the output. Which is kind of confusing.

btrfs su show /btrfs
/btrfs <--
Name:  <FS_TREE>

It will be even more confusing when proposed --uuid or --rootid
options are used.

btrfs su show --rootid 258 /btrfs
/btrfs <--
Name:  snap <--
UUID:  9630a45f-e647-4242-bd19-97590b4e20b2
Parent UUID:  30129358-c69d-3e4a-a662-29509cc69c95
Received UUID:  -
Creation time:  2017-07-12 12:43:28 +0800
Subvolume ID:  258
Generation:  9
Gen at creation:  9
Parent ID:  257
Top level ID:  257
Flags:  -
Snapshot(s):

Now with this patch, it will only show what is provided by the root_info.

btrfs su show --rootid 258 /btrfs
sv1/snap <--
Name:  snap
UUID:  9630a45f-e647-4242-bd19-97590b4e20b2
Parent UUID:  30129358-c69d-3e4a-a662-29509cc69c95
Received UUID:  -
Creation time:  2017-07-12 12:43:28 +0800
Subvolume ID:  258
Generation:  9
Gen at creation:  9
Parent ID:  257
Top level ID:  257
Flags:  -
Snapshot(s):

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-subvolume.c