aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@tuxera.com>2010-11-23 08:38:21 -0500
committerChristoph Hellwig <hch@lst.de>2010-11-23 08:38:21 -0500
commit34a2d313c51f47cae50ccb89f4196462665f2c48 (patch)
treec641c7bd24b9e343139a3e1c4d81e51822114cd9 /fs/hfsplus/inode.c
parente34947056076ca5467ee8256d2d9cbc594a79b37 (diff)
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 <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus/inode.c')
-rw-r--r--fs/hfsplus/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index bf6535b73261..bda7464c205d 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -8,6 +8,7 @@
8 * Inode handling routines 8 * Inode handling routines
9 */ 9 */
10 10
11#include <linux/blkdev.h>
11#include <linux/mm.h> 12#include <linux/mm.h>
12#include <linux/fs.h> 13#include <linux/fs.h>
13#include <linux/pagemap.h> 14#include <linux/pagemap.h>
@@ -334,6 +335,9 @@ int hfsplus_file_fsync(struct file *file, int datasync)
334 error = error2; 335 error = error2;
335 } 336 }
336 337
338 if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags))
339 blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
340
337 return error; 341 return error;
338} 342}
339 343