@@ -19,11 +19,6 @@
#include <linux/module.h>
#include "blk.h"
-static inline struct inode *bdev_file_inode(struct file *file)
-{
- return file->f_mapping->host;
-}
-
static blk_opf_t dio_bio_write_op(struct kiocb *iocb)
{
blk_opf_t opf = REQ_OP_WRITE | REQ_SYNC | REQ_IDLE;
@@ -1513,6 +1513,11 @@ void blkdev_put_no_open(struct block_device *bdev);
struct block_device *I_BDEV(struct inode *inode);
struct block_device *F_BDEV(struct file *file);
+static inline struct inode *bdev_file_inode(struct file *file)
+{
+ return file->f_mapping->host;
+}
+
#ifdef CONFIG_BLOCK
void invalidate_bdev(struct block_device *bdev);
int sync_blockdev(struct block_device *bdev);
Now that we open block devices as files we don't need to rely on bd_inode to get to the correct inode. Use the helper. Signed-off-by: Christian Brauner <brauner@kernel.org> --- block/fops.c | 5 ----- include/linux/blkdev.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-)