2002-08-28 15:42:17

by Stephen C. Tweedie

[permalink] [raw]
Subject: [Patch 1/8] 2.4.20-pre4/ext3: fsync optimisation

fsync optimisation: save an extra unnecessary pass over the data if we
are in an ordered or journaled data mode.

--- linux-ext3-2.4merge/fs/ext3/fsync.c.=K0002=.orig Tue Aug 27 23:16:39 2002
+++ linux-ext3-2.4merge/fs/ext3/fsync.c Tue Aug 27 23:19:57 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);