diff options
author | Jan Kara <jack@suse.cz> | 2009-08-17 13:52:36 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-09-14 11:08:15 -0400 |
commit | 148f948ba877f4d3cdef036b1ff6d9f68986706a (patch) | |
tree | c07963f08bf8c2119ec00df64e4293e2e60acaa1 /include/linux/fs.h | |
parent | eef99380679e20e7edc096aa4d8a98b875404d79 (diff) |
vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode
Introduce new function for generic inode syncing (vfs_fsync_range) and use
it from fsync() path. Introduce also new helper for syncing after a sync
write (generic_write_sync) using the generic function.
Use these new helpers for syncing from generic VFS functions. This makes
O_SYNC writes to block devices acquire i_mutex for syncing. If we really
care about this, we can make block_fsync() drop the i_mutex and reacquire
it before it returns.
CC: Evgeniy Polyakov <zbr@ioremap.net>
CC: ocfs2-devel@oss.oracle.com
CC: Joel Becker <joel.becker@oracle.com>
CC: Felix Blyakher <felixb@sgi.com>
CC: xfs@oss.sgi.com
CC: Anton Altaparmakov <aia21@cantab.net>
CC: linux-ntfs-dev@lists.sourceforge.net
CC: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
CC: linux-ext4@vger.kernel.org
CC: tytso@mit.edu
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 6c1be3a4edea..e2c7f5167662 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2098,7 +2098,10 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
2098 | extern int filemap_fdatawrite_range(struct address_space *mapping, | 2098 | extern int filemap_fdatawrite_range(struct address_space *mapping, |
2099 | loff_t start, loff_t end); | 2099 | loff_t start, loff_t end); |
2100 | 2100 | ||
2101 | extern int vfs_fsync_range(struct file *file, struct dentry *dentry, | ||
2102 | loff_t start, loff_t end, int datasync); | ||
2101 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); | 2103 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); |
2104 | extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); | ||
2102 | extern void sync_supers(void); | 2105 | extern void sync_supers(void); |
2103 | extern void emergency_sync(void); | 2106 | extern void emergency_sync(void); |
2104 | extern void emergency_remount(void); | 2107 | extern void emergency_remount(void); |