btrfs-progs: subvol: change set-default to also accept path
authorMisono, Tomohiro <misono.tomohiro@jp.fujitsu.com>
Fri, 6 Oct 2017 01:05:08 +0000 (10:05 +0900)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Nov 2017 14:59:00 +0000 (15:59 +0100)
commit4a5b95abb620175ca6eb356ff8a7d698891fa8ab
tree064a6f191eee6e7f43142aa8f19ba3d16e9511ad
parentc56d61883c6f093ac905c49f76a99be5e8e09332
btrfs-progs: subvol: change set-default to also accept path

This patch changes "subvol set-default" to also accept the subvolume path
for convenience.

If there are two args, they are assumed as subvol id and path to the fs
(the same as current behavior), and if there is only one arg, it is assumed
as the path to the subvolume.

subvol id is resolved by test_issubvolume() + lookup_path_rootid().
The empty subvol (ino == 2) will get error on test_issubvolume() which
checks whether inode num is 256 or not.

Issue: #35
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
[ update documentation, use the new multi-line command scheme ]
Signed-off-by: David Sterba <dsterba@suse.com>
Documentation/btrfs-subvolume.asciidoc
cmds-subvolume.c