diff mbox series

[vfs.all,24/26] iomap: convert to use bdev_file

Message ID 20240406090930.2252838-25-yukuai1@huaweicloud.com (mailing list archive)
State New
Headers show
Series fs & block: remove bdev->bd_inode | expand

Commit Message

Yu Kuai April 6, 2024, 9:09 a.m. UTC
From: Yu Kuai <yukuai3@huawei.com>

With previous commit both filesystems and raw block device provide
bdev_file while initializing iomap, it's safe to convert to use
bdev_file. Prepare to remove bd_inode from block_device after convert
buffer_head to use bdev_file as well.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 include/linux/iomap.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 8ae384f0eeb1..1386f3a618fe 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -97,7 +97,7 @@  struct iomap {
 	u64			length;	/* length of mapping, bytes */
 	u16			type;	/* type of mapping */
 	u16			flags;	/* flags for mapping */
-	struct block_device	*bdev;	/* block device for I/O */
+	struct file		*bdev_file; /* block device for I/O */
 	struct dax_device	*dax_dev; /* dax_dev for dax operations */
 	void			*inline_data;
 	void			*private; /* filesystem private */
@@ -107,13 +107,13 @@  struct iomap {
 
 static inline struct block_device *iomap_bdev(const struct iomap *iomap)
 {
-	return iomap->bdev;
+	return iomap->bdev_file ? file_bdev(iomap->bdev_file) : NULL;
 }
 
 static inline void iomap_set_bdev_file(struct iomap *iomap,
 				       struct file *bdev_file)
 {
-	iomap->bdev = bdev_file ? file_bdev(bdev_file) : NULL;
+	iomap->bdev_file = bdev_file;
 }
 
 static inline sector_t iomap_sector(const struct iomap *iomap, loff_t pos)