diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-11-23 08:38:21 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-11-23 08:38:21 -0500 |
commit | 34a2d313c51f47cae50ccb89f4196462665f2c48 (patch) | |
tree | c641c7bd24b9e343139a3e1c4d81e51822114cd9 /fs/hfsplus/super.c | |
parent | e34947056076ca5467ee8256d2d9cbc594a79b37 (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/super.c')
-rw-r--r-- | fs/hfsplus/super.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ | |||
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/pagemap.h> | 12 | #include <linux/pagemap.h> |
13 | #include <linux/blkdev.h> | ||
13 | #include <linux/fs.h> | 14 | #include <linux/fs.h> |
14 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
15 | #include <linux/vfs.h> | 16 | #include <linux/vfs.h> |
@@ -212,6 +213,10 @@ int hfsplus_sync_fs(struct super_block *sb, int wait) | |||
212 | out: | 213 | out: |
213 | mutex_unlock(&sbi->alloc_mutex); | 214 | mutex_unlock(&sbi->alloc_mutex); |
214 | mutex_unlock(&sbi->vh_mutex); | 215 | mutex_unlock(&sbi->vh_mutex); |
216 | |||
217 | if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags)) | ||
218 | blkdev_issue_flush(sb->s_bdev, GFP_KERNEL, NULL); | ||
219 | |||
215 | return error; | 220 | return error; |
216 | } | 221 | } |
217 | 222 | ||