fsync optimisation fsync optimisation: save an extra unnecessary pass over the data if we are in an ordered or journaled data mode. --- linux-2.4.19-ext3/fs/ext3/fsync.c.=K0002=.orig Wed Nov 21 05:34:13 2001 +++ linux-2.4.19-ext3/fs/ext3/fsync.c Fri Oct 11 15:52:01 2002 @@ -62,7 +62,12 @@ * we'll end up waiting on them in commit. */ ret = fsync_inode_buffers(inode); - ret |= fsync_inode_data_buffers(inode); + + /* In writeback mode, we need to force out data buffers too. In + * the other modes, ext3_force_commit takes care of forcing out + * just the right data blocks. */ + if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA) + ret |= fsync_inode_data_buffers(inode); ext3_force_commit(inode->i_sb);