]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: add read policy to set a preferred device
authorAnand Jain <anand.jain@oracle.com>
Wed, 1 Jan 2025 18:06:36 +0000 (02:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 13 Jan 2025 13:53:21 +0000 (14:53 +0100)
commitc86aae73bd5882e4a6b4e1b6ed448ea902551f80
tree2b60f56e491bd881fa2708af71f94dc4943e1793
parent6d7a9154955e50c0b991063c65f86ab24796754e
btrfs: add read policy to set a preferred device

Add read policy that will force all reads to go to the given device
(specified by devid) on the RAID1 profiles.

This will be used for testing, e.g. to read from stale device. Users may
find other use cases.

Can be set in sysfs, the value format is "devid:<devid>" to the file

  /sys/fs/btrfs/FSID/read_policy

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h