]> git.hungrycats.org Git - linux/commitdiff
Revert "btrfs: read mirror policy random"
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 19 Nov 2021 04:44:29 +0000 (23:44 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 19 Nov 2021 04:44:29 +0000 (23:44 -0500)
This reverts commit 566cc411d81340654221b8401d60081e1223106f.

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

index ba7a4e2324e79f5e1bf232bb3cd48e40272e725e..e9a02d4e3c0c6649a40c5a20ee7ad1ff33140106 100644 (file)
@@ -1072,7 +1072,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", "load", "roundrobin", "random" };
+       "device", "load", "roundrobin" };
 
 static ssize_t btrfs_read_policy_show(struct kobject *kobj,
                                      struct kobj_attribute *a, char *buf)
index 92a6a7e4f7d344bf967e529ad8b2fb40bd50003d..4f5f152e59b15a32dae81d16e09fb4bb7413a338 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/uuid.h>
 #include <linux/list_sort.h>
 #include <linux/part_stat.h>
-#include <linux/prandom.h>
 #include "misc.h"
 #include "ctree.h"
 #include "extent_map.h"
@@ -6256,9 +6255,6 @@ static int find_live_mirror(struct btrfs_fs_info *fs_info,
        case BTRFS_READ_POLICY_DEVICE:
                preferred_mirror = btrfs_find_read_preferred(map, first, num_stripes);
                break;
-       case BTRFS_READ_POLICY_RANDOM:
-               preferred_mirror = (first + prandom_u32_max(num_stripes)) % num_stripes;
-               break;
        }
 
        if (dev_replace_is_ongoing &&
index f1c5a9be28b39c611286298f85d22f0c33df6eca..2288320eabbe64d3d5d6e23a448f74cfba62e7f2 100644 (file)
@@ -239,8 +239,6 @@ enum btrfs_read_policy {
        BTRFS_READ_POLICY_LOAD,
        /* Round robin with priority based on class and queue length */
        BTRFS_READ_POLICY_ROUNDROBIN,
-       /* Select mirror randomly */
-       BTRFS_READ_POLICY_RANDOM,
        BTRFS_NR_READ_POLICY,
 };