btrfs: sysfs: add per-fs attribute for read policy
authorAnand Jain <anand.jain@oracle.com>
Wed, 28 Oct 2020 13:14:47 +0000 (21:14 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:53:45 +0000 (15:53 +0100)
commit3d8cc17a0561dc4c037ede4886d7975009075d6d
tree4000a04a66987e62d8f4961a046c7b522639cee9
parent33fd2f714cde793b337b4ca6aaf3a8c68675d74f
btrfs: sysfs: add per-fs attribute for read policy

Add

 /sys/fs/btrfs/UUID/read_policy

attribute so that the read policy for the raid1, raid1c34 and raid10 can
be tuned.

When this attribute is read, it will show all available policies, with
active policy in [ ]. The read_policy attribute can be written using one
of the items listed in there.

For example:
  $ cat /sys/fs/btrfs/UUID/read_policy
  [pid]
  $ echo pid > /sys/fs/btrfs/UUID/read_policy

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c