From: Zygo Blaxell Date: Sun, 5 Dec 2021 08:36:01 +0000 (-0500) Subject: Revert "btrfs: introduce new read_policy device" X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c17ec5065aecd596e9ee684b623a37fc0886b80a;p=linux Revert "btrfs: introduce new read_policy device" This reverts commit 85875e6b0eb7d3230dde7325d4d45798fdeaeebe. --- diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index f5fc003a985c..fc89812cb8d6 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -933,8 +933,7 @@ static bool strmatch(const char *buffer, const char *string) } /* Must follow the order as in enum btrfs_read_policy */ -static const char * const btrfs_read_policy_name[] = { "pid", "latency", - "device" }; +static const char * const btrfs_read_policy_name[] = { "pid", "latency" }; static ssize_t btrfs_read_policy_show(struct kobject *kobj, struct kobj_attribute *a, char *buf) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index ca3fe69e1d39..32c9a96cd696 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5943,25 +5943,6 @@ static int btrfs_find_best_stripe(struct btrfs_fs_info *fs_info, return best_stripe; } -static int btrfs_find_read_preferred(struct map_lookup *map, int first, int num_stripe) -{ - int stripe_index; - int last = first + num_stripe; - - /* - * If there are more than one read preferred devices, then just pick the - * first found read preferred device as of now. - */ - for (stripe_index = first; stripe_index < last; stripe_index++) { - if (test_bit(BTRFS_DEV_STATE_READ_PREFERRED, - &map->stripes[stripe_index].dev->dev_state)) - return stripe_index; - } - - /* If there is no read preferred device then just use the first stripe */ - return first; -} - static int find_live_mirror(struct btrfs_fs_info *fs_info, struct map_lookup *map, int first, int dev_replace_is_ongoing) @@ -5995,9 +5976,6 @@ static int find_live_mirror(struct btrfs_fs_info *fs_info, preferred_mirror = btrfs_find_best_stripe(fs_info, map, first, num_stripes); break; - case BTRFS_READ_POLICY_DEVICE: - preferred_mirror = btrfs_find_read_preferred(map, first, num_stripes); - break; } if (dev_replace_is_ongoing && diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 63eaac20740c..c3968a93ccc3 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -229,8 +229,6 @@ enum btrfs_read_policy { BTRFS_READ_POLICY_PID, /* Find and use device with the lowest latency */ BTRFS_READ_POLICY_LATENCY, - /* Use the device marked with READ_PREFERRED state */ - BTRFS_READ_POLICY_DEVICE, BTRFS_NR_READ_POLICY, };