[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <eaf4ae72ec573319bc65b5a3747852c4bfb1223a.1681188927.git.ritesh.list@gmail.com>
Date: Tue, 11 Apr 2023 10:51:52 +0530
From: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
To: linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org
Cc: Jan Kara <jack@...e.cz>, Christoph Hellwig <hch@...radead.org>,
"Darrick J . Wong" <djwong@...nel.org>,
Ojaswin Mujoo <ojaswin@...ux.ibm.com>,
"Ritesh Harjani (IBM)" <ritesh.list@...il.com>
Subject: [RFCv2 4/8] ext2: Use __generic_file_fsync_nolock implementation
Next patch converts ext2 to use iomap interface for DIO.
iomap layer can call generic_write_sync() -> ext2_fsync() from
iomap_dio_complete while still holding the inode_lock().
Now writeback from other paths doesn't need inode_lock().
It seems there is also no need of an inode_lock for
sync_mapping_buffers(). It uses it's own mapping->private_lock
for it's buffer list handling.
Hence this patch is in preparation to move ext2 to iomap.
This uses __generic_file_fsync_nolock() variant in ext2_fsync().
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
---
fs/ext2/file.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 6b4bebe982ca..1d0bc3fc88bb 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -153,7 +153,9 @@ int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
int ret;
struct super_block *sb = file->f_mapping->host->i_sb;
- ret = generic_file_fsync(file, start, end, datasync);
+ ret = __generic_file_fsync_nolock(file, start, end, datasync);
+ if (!ret)
+ ret = blkdev_issue_flush(sb->s_bdev);
if (ret == -EIO)
/* We don't really know where the IO error happened... */
ext2_error(sb, __func__,
--
2.39.2
Powered by blists - more mailing lists