• Jan Kara's avatar
    writeback: Refactor writeback_single_inode() · 4f8ad655
    Jan Kara authored
    The code in writeback_single_inode() is relatively complex. The list requeing
    logic makes sense only for flusher thread but not really for sync_inode() or
    write_inode_now() callers. Also when we want to get rid of inode references
    held by flusher thread, we will need a special I_SYNC handling there.
    
    So separate part of writeback_single_inode() which does the real writeback work
    into __writeback_single_inode() and make writeback_single_inode() do only stuff
    necessary for callers writing only one inode, moving the special list handling
    into writeback_sb_inodes(). As a sideeffect this fixes a possible race where we
    could skip some inode during sync(2) because other writer refiled it from b_io
    to b_dirty list. Also I_SYNC handling is moved into the callers of
    __writeback_single_inode() to make locking easier.
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
    4f8ad655
fs-writeback.c 38.2 KB