fscrypt: work on block_devices instead of request_queues
[platform/kernel/linux-starfive.git] / fs / f2fs / super.c
index 2451623..26817b5 100644 (file)
@@ -3039,23 +3039,24 @@ static void f2fs_get_ino_and_lblk_bits(struct super_block *sb,
        *lblk_bits_ret = 8 * sizeof(block_t);
 }
 
-static int f2fs_get_num_devices(struct super_block *sb)
+static struct block_device **f2fs_get_devices(struct super_block *sb,
+                                             unsigned int *num_devs)
 {
        struct f2fs_sb_info *sbi = F2FS_SB(sb);
+       struct block_device **devs;
+       int i;
 
-       if (f2fs_is_multi_device(sbi))
-               return sbi->s_ndevs;
-       return 1;
-}
+       if (!f2fs_is_multi_device(sbi))
+               return NULL;
 
-static void f2fs_get_devices(struct super_block *sb,
-                            struct request_queue **devs)
-{
-       struct f2fs_sb_info *sbi = F2FS_SB(sb);
-       int i;
+       devs = kmalloc_array(sbi->s_ndevs, sizeof(*devs), GFP_KERNEL);
+       if (!devs)
+               return ERR_PTR(-ENOMEM);
 
        for (i = 0; i < sbi->s_ndevs; i++)
-               devs[i] = bdev_get_queue(FDEV(i).bdev);
+               devs[i] = FDEV(i).bdev;
+       *num_devs = sbi->s_ndevs;
+       return devs;
 }
 
 static const struct fscrypt_operations f2fs_cryptops = {
@@ -3066,7 +3067,6 @@ static const struct fscrypt_operations f2fs_cryptops = {
        .empty_dir              = f2fs_empty_dir,
        .has_stable_inodes      = f2fs_has_stable_inodes,
        .get_ino_and_lblk_bits  = f2fs_get_ino_and_lblk_bits,
-       .get_num_devices        = f2fs_get_num_devices,
        .get_devices            = f2fs_get_devices,
 };
 #endif