public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/1] fs/ext4/fsync.c: generic_file_fsync call based on barrier flag
@ 2014-06-06 19:51 akpm
  2014-06-23 10:41 ` Lukáš Czerner
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2014-06-06 19:51 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, akpm, fabf, hch, jack, viro

From: Fabian Frederick <fabf@skynet.be>
Subject: fs/ext4/fsync.c: generic_file_fsync call based on barrier flag

generic_file_fsync has been updated to issue a flush for older
filesystems.

This patch tests for barrier flag in ext4 mount flags and calls the right
function.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Suggested-by: Jan Kara <jack@suse.cz>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ext4/fsync.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff -puN fs/ext4/fsync.c~fs-ext4-fsyncc-generic_file_fsync-call-based-on-barrier-flag fs/ext4/fsync.c
--- a/fs/ext4/fsync.c~fs-ext4-fsyncc-generic_file_fsync-call-based-on-barrier-flag
+++ a/fs/ext4/fsync.c
@@ -107,7 +107,10 @@ int ext4_sync_file(struct file *file, lo
 	}
 
 	if (!journal) {
-		ret = generic_file_fsync(file, start, end, datasync);
+		if (test_opt(inode->i_sb, BARRIER))
+			ret = generic_file_fsync(file, start, end, datasync);
+		else
+			ret = __generic_file_fsync(file, start, end, datasync);
 		if (!ret && !hlist_empty(&inode->i_dentry))
 			ret = ext4_sync_parent(inode);
 		goto out;
_

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

end of thread, other threads:[~2014-06-23 10:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06 19:51 [patch 1/1] fs/ext4/fsync.c: generic_file_fsync call based on barrier flag akpm
2014-06-23 10:41 ` Lukáš Czerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox