Btrfs-progs: add type root to label property

So that we can get the label of a mounted filesystem.

Before this change:

        $ btrfs prop get /mnt/btrfs label
        ERROR: object is not compatible with property

        $ btrfs prop get /dev/sdb3 label
        ERROR: dev /dev/sdb3 is mounted, use mount point
        ERROR: failed to set/get property for object.

After this change:

        $ btrfs prop get /mnt/btrfs label
        label=foobar

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
Filipe David Borba Manana 2013-11-12 13:41:45 +00:00 committed by Chris Mason
parent d5bd0a1f84
commit aea9789800
1 changed files with 2 additions and 1 deletions

View File

@ -105,6 +105,7 @@ static int prop_label(enum prop_object_type type,
const struct prop_handler prop_handlers[] = {
{"ro", "Set/get read-only flag of subvolume.", 0, prop_object_subvol,
prop_read_only},
{"label", "Set/get label of device.", 0, prop_object_dev, prop_label},
{"label", "Set/get label of device.", 0,
prop_object_dev | prop_object_root, prop_label},
{0, 0, 0, 0, 0}
};