diff mbox series

[RFC,32/34] block: expose bdev_file_inode()

Message ID 20240103-vfs-bdev-file-v1-32-6c8ee55fb6ef@kernel.org (mailing list archive)
State New, archived
Headers show
Series Open block devices as files & a bd_inode proposal | expand

Commit Message

Christian Brauner Jan. 3, 2024, 12:55 p.m. UTC
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(-)
diff mbox series

Patch

diff --git a/block/fops.c b/block/fops.c
index ed7be8b5810e..e831196dafac 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -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;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5599a33e78a6..4bde3e87817d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -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);