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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Yu Kuai <yukuai3@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 include/linux/iomap.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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)
-- 
2.39.2





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux