• Andrew Morton's avatar
    [PATCH] speed up ext2 fsync() and fdatasync() · 7176142a
    Andrew Morton authored
    ext2_sync_file() forgets to clear the inode's dirty bits, so we write the
    inode on every fsync(), even if it hasn't changed.
    
    Fix that up via the new sync_file() API which correctly manages the inode
    state bits and the superblock inode lists.
    
    When performing file overwrite on IDE with and without writeback caching
    enabled this patch approximately doubles fsync() speed, bringing it into line
    with O_SYNC writes.
    
    Also, fix up the return value handling in ext2_sync_file().
    
    Credit due to Jeffrey Siegal <jbs@quiotix.com> who noticed the performance
    discrepancy and wrote a test app.
    7176142a
inode.c 37.1 KB