diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-06-04 19:06:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:53:55 -0400 |
commit | ac13a829f6adb674015ab399594c089990104af7 (patch) | |
tree | 29f0b78758080bac01307e705371283a406b41c4 /include/linux/blkdev.h | |
parent | fd2916bd77109b69891573fd1e1205ecc619893e (diff) |
fs/libfs.c: add generic data flush to fsync
Description by Jan Kara:
"A lot of older filesystems don't properly flush volatile disk caches
on fsync(2) which can lead to loss of fsynced data after power failure.
This patch makes generic_file_fsync() issue proper cache flush to fix the
problem. Sysadmin can use /sys/devices/.../cache_type to tell the system
it should not send the cache flush."
[akpm@linux-foundation.org: nuke ifdef]
[akpm@linux-foundation.org: fix warning]
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8aba35f46f87..45cf6e537c83 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1607,6 +1607,9 @@ struct block_device_operations { | |||
1607 | extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int, | 1607 | extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int, |
1608 | unsigned long); | 1608 | unsigned long); |
1609 | #else /* CONFIG_BLOCK */ | 1609 | #else /* CONFIG_BLOCK */ |
1610 | |||
1611 | struct block_device; | ||
1612 | |||
1610 | /* | 1613 | /* |
1611 | * stubs for when the block layer is configured out | 1614 | * stubs for when the block layer is configured out |
1612 | */ | 1615 | */ |
@@ -1642,6 +1645,12 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk) | |||
1642 | return false; | 1645 | return false; |
1643 | } | 1646 | } |
1644 | 1647 | ||
1648 | static inline int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, | ||
1649 | sector_t *error_sector) | ||
1650 | { | ||
1651 | return 0; | ||
1652 | } | ||
1653 | |||
1645 | #endif /* CONFIG_BLOCK */ | 1654 | #endif /* CONFIG_BLOCK */ |
1646 | 1655 | ||
1647 | #endif | 1656 | #endif |