Btrfs: unify subvol= and subvolid= mounting
authorOmar Sandoval <osandov@osandov.com>
Mon, 18 May 2015 09:16:30 +0000 (02:16 -0700)
committerChris Mason <clm@fb.com>
Wed, 3 Jun 2015 11:03:01 +0000 (04:03 -0700)
commit05dbe6837b60465db6a61d1f0cabe745e20aadc9
tree028777a4187f8b32959e740ad2862f9f6504e0d8
parentbb289b7be62db84b9630ce00367444c810cada2c
Btrfs: unify subvol= and subvolid= mounting

Currently, mounting a subvolume with subvolid= takes a different code
path than mounting with subvol=. This isn't really a big deal except for
the fact that mounts done with subvolid= or the default subvolume don't
have a dentry that's connected to the dentry tree like in the subvol=
case. To unify the code paths, when given subvolid= or using the default
subvolume ID, translate it into a subvolume name by walking
ROOT_BACKREFs in the root tree and INODE_REFs in the filesystem trees.

Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/super.c