Skip to content

Commit d053070

Browse files
riteshharjanijankara
authored andcommitted
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>
1 parent 5b5b4ff commit d053070

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/ext2/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/quotaops.h>
2626
#include <linux/iomap.h>
2727
#include <linux/uio.h>
28+
#include <linux/buffer_head.h>
2829
#include "ext2.h"
2930
#include "xattr.h"
3031
#include "acl.h"
@@ -153,7 +154,7 @@ int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
153154
int ret;
154155
struct super_block *sb = file->f_mapping->host->i_sb;
155156

156-
ret = generic_file_fsync(file, start, end, datasync);
157+
ret = generic_buffers_fsync(file, start, end, datasync);
157158
if (ret == -EIO)
158159
/* We don't really know where the IO error happened... */
159160
ext2_error(sb, __func__,

0 commit comments

Comments
 (0)