diff options
author | Ritesh Harjani (IBM) <ritesh.list@gmail.com> | 2023-04-21 15:16:14 +0530 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2023-05-05 14:04:17 +0200 |
commit | 51767b5885c4b0c8a2b3a3127a7469d99a15319f (patch) | |
tree | 272061df0ff95d685ffd98827b17d23d0436b8b2 /fs/ext2 | |
parent | d5028fdd8858c5c243bb5dac284d2e04384bc6a3 (diff) | |
download | linux-next-51767b5885c4b0c8a2b3a3127a7469d99a15319f.tar.gz |
ext2: Use generic_buffers_fsync() 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_buffers_fsync() which does not take any inode_lock()
in ext2_fsync().
Tested-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <76d206a464574ff91db25bc9e43479b51ca7e307.1682069716.git.ritesh.list@gmail.com>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext2/file.c b/fs/ext2/file.c index 6b4bebe982ca..749163787139 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c @@ -25,6 +25,7 @@ #include <linux/quotaops.h> #include <linux/iomap.h> #include <linux/uio.h> +#include <linux/buffer_head.h> #include "ext2.h" #include "xattr.h" #include "acl.h" @@ -153,7 +154,7 @@ 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_buffers_fsync(file, start, end, datasync); if (ret == -EIO) /* We don't really know where the IO error happened... */ ext2_error(sb, __func__, |