• Ritesh Harjani (IBM)'s avatar
    fs/buffer.c: Add generic_buffers_fsync*() implementation · 31b2ebc0
    Ritesh Harjani (IBM) authored
    
    
    Some of the higher layers like iomap takes inode_lock() when calling
    generic_write_sync().
    Also writeback already happens from other paths without inode lock,
    so it's difficult to say that we really need sync_mapping_buffers() to
    take any inode locking here. Having said that, let's add
    generic_buffers_fsync/_noflush() implementation in buffer.c with no
    inode_lock/unlock() for now so that filesystems like ext2 and
    ext4's nojournal mode can use it.
    
    Ext4 when got converted to iomap for direct-io already copied it's own
    variant of __generic_file_fsync() without lock.
    
    This patch adds generic_buffers_fsync()
    & generic_buffers_fsync_noflush() implementations for use in filesystems
    like ext2 & ext4 respectively.
    
    Later we can review other filesystems as well to see if we can make
    generic_buffers_fsync/_noflush() which does not take any inode_lock() as
    the default path.
    Tested-by: default avatarDisha Goel <disgoel@linux.ibm.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Message-Id: <d573408ac8408627d23a3d2d166e748c172c4c9e.1682069716.git.ritesh.list@gmail.com>
    31b2ebc0
buffer.c 83.1 KB