All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext3,4:fdatasync should skip metadata writeout
@ 2007-11-16  2:47 Hisashi Hifumi
  2007-11-16  2:59 ` Andrew Morton
  2007-11-16  3:43 ` [PATCH] ext3,4:fdatasync should skip metadata writeout Jörn Engel
  0 siblings, 2 replies; 11+ messages in thread
From: Hisashi Hifumi @ 2007-11-16  2:47 UTC (permalink / raw)
  To: akpm, linux-ext4, linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]

Hi.
Currently fdatasync is identical to fsync in ext3,4.
I think fdatasync should skip journal flush in data=ordered and data=writeback mode
because this syscall is not required to synchronize the metadata.

My patch as below is similar to the approach of GFS2's fsync code(gfs2_fsync).

Thanks.

Signed-off-by :Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>

diff -Nrup linux-2.6.24-rc2.org/fs/ext3/fsync.c linux-2.6.24-rc2/fs/ext3/fsync.c
--- linux-2.6.24-rc2.org/fs/ext3/fsync.c	2007-11-07 06:57:46.000000000 +0900
+++ linux-2.6.24-rc2/fs/ext3/fsync.c	2007-11-15 17:50:24.000000000 +0900
@@ -72,6 +72,9 @@ int ext3_sync_file(struct file * file, s
 		goto out;
 	}
 
+	if (datasync)
+		goto out;	
+
 	/*
 	* The VFS has written the file data.  If the inode is unaltered
 	* then we need not start a commit.
diff -Nrup linux-2.6.24-rc2.org/fs/ext4/fsync.c linux-2.6.24-rc2/fs/ext4/fsync.c
--- linux-2.6.24-rc2.org/fs/ext4/fsync.c	2007-11-07 06:57:46.000000000 +0900
+++ linux-2.6.24-rc2/fs/ext4/fsync.c	2007-11-15 17:50:54.000000000 +0900
@@ -72,6 +72,9 @@ int ext4_sync_file(struct file * file, s
 		goto out;
 	}
 
+	if (datasync)
+		goto out;
+
 	/*
 	* The VFS has written the file data.  If the inode is unaltered
 	* then we need not start a commit.

[-- Attachment #2: patch-2624rc2-ext34-fdatasync.txt --]
[-- Type: application/octet-stream, Size: 927 bytes --]

diff -Nrup linux-2.6.24-rc2.org/fs/ext3/fsync.c linux-2.6.24-rc2/fs/ext3/fsync.c
--- linux-2.6.24-rc2.org/fs/ext3/fsync.c	2007-11-07 06:57:46.000000000 +0900
+++ linux-2.6.24-rc2/fs/ext3/fsync.c	2007-11-15 17:50:24.000000000 +0900
@@ -72,6 +72,9 @@ int ext3_sync_file(struct file * file, s
 		goto out;
 	}
 
+	if (datasync)
+		goto out;	
+
 	/*
 	 * The VFS has written the file data.  If the inode is unaltered
 	 * then we need not start a commit.
diff -Nrup linux-2.6.24-rc2.org/fs/ext4/fsync.c linux-2.6.24-rc2/fs/ext4/fsync.c
--- linux-2.6.24-rc2.org/fs/ext4/fsync.c	2007-11-07 06:57:46.000000000 +0900
+++ linux-2.6.24-rc2/fs/ext4/fsync.c	2007-11-15 17:50:54.000000000 +0900
@@ -72,6 +72,9 @@ int ext4_sync_file(struct file * file, s
 		goto out;
 	}
 
+	if (datasync)
+		goto out;
+
 	/*
 	 * The VFS has written the file data.  If the inode is unaltered
 	 * then we need not start a commit.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-02-07  6:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-16  2:47 [PATCH] ext3,4:fdatasync should skip metadata writeout Hisashi Hifumi
2007-11-16  2:59 ` Andrew Morton
2007-11-16  3:17   ` Jörn Engel
2007-11-16 18:12     ` Bryan Henderson
2007-11-16  3:47   ` Wendy Cheng
2007-11-16  3:53     ` Andrew Morton
2007-11-20  7:20   ` Hisashi Hifumi
2008-02-04 10:15   ` [RESEND] [PATCH] ext3,4:fdatasync should skip metadata writeout when overwriting Hisashi Hifumi
2008-02-06 16:22     ` Jan Kara
2008-02-07  6:45       ` Hisashi Hifumi
2007-11-16  3:43 ` [PATCH] ext3,4:fdatasync should skip metadata writeout Jörn Engel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.