fscrypt: work on block_devices instead of request_queues
[platform/kernel/linux-starfive.git] / include / linux / fscrypt.h
index db5bb56..1f12ebb 100644 (file)
@@ -161,24 +161,21 @@ struct fscrypt_operations {
                                      int *ino_bits_ret, int *lblk_bits_ret);
 
        /*
-        * Return the number of block devices to which the filesystem may write
-        * encrypted file contents.
+        * Return an array of pointers to the block devices to which the
+        * filesystem may write encrypted file contents, NULL if the filesystem
+        * only has a single such block device, or an ERR_PTR() on error.
+        *
+        * On successful non-NULL return, *num_devs is set to the number of
+        * devices in the returned array.  The caller must free the returned
+        * array using kfree().
         *
         * If the filesystem can use multiple block devices (other than block
         * devices that aren't used for encrypted file contents, such as
         * external journal devices), and wants to support inline encryption,
         * then it must implement this function.  Otherwise it's not needed.
         */
-       int (*get_num_devices)(struct super_block *sb);
-
-       /*
-        * If ->get_num_devices() returns a value greater than 1, then this
-        * function is called to get the array of request_queues that the
-        * filesystem is using -- one per block device.  (There may be duplicate
-        * entries in this array, as block devices can share a request_queue.)
-        */
-       void (*get_devices)(struct super_block *sb,
-                           struct request_queue **devs);
+       struct block_device **(*get_devices)(struct super_block *sb,
+                                            unsigned int *num_devs);
 };
 
 static inline struct fscrypt_info *fscrypt_get_info(const struct inode *inode)