--------------------- PatchSet 826 Date: 2002/04/10 18:00:50 Author: sct Log: fsync optimisation: save an extra unnecessary pass over the data if we are in an ordered or journaled data mode. Members: fs/ext3/fsync.c:1.7.2.1->1.7.2.2 [ext3-1_0-branch] --- linux-ext3-2.4merge/fs/ext3/fsync.c.=K0000=.orig Sat Aug 17 20:09:40 2002 +++ linux-ext3-2.4merge/fs/ext3/fsync.c Mon Aug 19 18:48:50 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);