Commit Graph

4 Commits (dae7456c7f3990d264d546e03375e4def3e646a6)

Author SHA1 Message Date
Kusanagi Kouichi b53b11a8b4 btrfs-progs: Make property work with -t option
# btrfs prop list -t f .
btrfs property list: too many arguments
...
# btrfs prop get -t f . label
btrfs property get: too many arguments
...
# btrfs prop set -t f . label abc
btrfs property set: too many arguments
...

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: David Sterba <dsterba@suse.cz>
2014-04-11 19:40:18 +02:00
Gui Hecheng 7fc99ec285 btrfs-progs: remove a dead break before usage()
The usage() in help.c calls exit(1), so the break behind is nonsense
and should be removed.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
2014-03-21 06:23:16 -07:00
Filipe David Borba Manana d5bd0a1f84 Btrfs-progs: fix detection of root objects in cmds-property.c
Several fixes:

1) The function check_is_root() returns 0 if the object is root;

2) Don't treat any error from get fsid ioctl as meaning the target
   is root. Only -ENOTTY means it's a root (parent directory is
   not a btrfs fs) and a -ENOTDIR means our target object is not a
   directory, therefore it can be the root;

3) Fix the comparison of the target and target's parent fs ids. If
   they are different, it means the target is a mount point in a
   btrfs fs, therefore it's a root, otherwise it isn't.

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>
2014-01-31 08:22:32 -08:00
Alexander Block 85be2aaf91 Btrfs-progs: introduce btrfs property subgroup
"btrfs filesystem property" is a generic interface to set/get
properties on filesystem objects (inodes/subvolumes/filesystems
/devs).

This patch adds the generic framework for properties and also
implements two properties. The first is the read-only property
for subvolumes and the second is the label property for devices.

Signed-off-by: Alexander Block <ablock84@googlemail.com>
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>
2014-01-31 08:22:31 -08:00