]> git.hungrycats.org Git - linux/commitdiff
Revert "btrfs: introduce new read_policy device"
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 5 Dec 2021 08:36:01 +0000 (03:36 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 5 Dec 2021 08:36:01 +0000 (03:36 -0500)
This reverts commit 85875e6b0eb7d3230dde7325d4d45798fdeaeebe.

fs/btrfs/sysfs.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h

index f5fc003a985c7664f8a52f9b523615ba42d09e5d..fc89812cb8d6f8efce5d5ff3da21680a1a53111d 100644 (file)
@@ -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)
index ca3fe69e1d39d092d81669ebc521f7746067551c..32c9a96cd6966f840ef5b70bac5762ba13a3a9a6 100644 (file)
@@ -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 &&
index 63eaac20740c59b688a39b20a7e203921fc1cfa7..c3968a93ccc3c3e88b69e540efe5284ebf3a5f9a 100644 (file)
@@ -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,
 };