summaryrefslogtreecommitdiff
path: root/props.c
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@gmail.com>2013-11-12 13:41:45 +0000
committerChris Mason <clm@fb.com>2014-01-31 08:22:32 -0800
commitaea978980040462160196597d2b0ca0527af1600 (patch)
tree0bc54c6e14758a575fdaaf70e83d31f18827bd6d /props.c
parentd5bd0a1f8461132af3a7d1d681d836a2e4807cf4 (diff)
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>
Diffstat (limited to 'props.c')
-rw-r--r--props.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/props.c b/props.c
index 763fd57e..12fdc524 100644
--- a/props.c
+++ b/props.c
@@ -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}
};