From 34a2d313c51f47cae50ccb89f4196462665f2c48 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 23 Nov 2010 14:38:21 +0100 Subject: hfsplus: flush disk caches in sync and fsync Flush the disk cache in fsync and sync to make sure data actually is on disk on completion of these system calls. There is a nobarrier mount option to disable this behaviour. It's slightly misnamed now that barrier actually are gone, but it matches the name used by all major filesystems. Signed-off-by: Christoph Hellwig --- fs/hfsplus/super.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/hfsplus/super.c') diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 036650123c4c..154478c71f25 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -212,6 +213,10 @@ int hfsplus_sync_fs(struct super_block *sb, int wait) out: mutex_unlock(&sbi->alloc_mutex); mutex_unlock(&sbi->vh_mutex); + + if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags)) + blkdev_issue_flush(sb->s_bdev, GFP_KERNEL, NULL); + return error; } -- cgit v1.2.3