aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-07-16 20:44:56 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-20 20:47:59 -0400
commit02c24a82187d5a628c68edfe71ae60dc135cd178 (patch)
treec8dbaba4d82e2b20ed4335910a564a1f7d90fcf6 /include/linux/fs.h
parent22735068d53c7115e384bc88dea95b17e76a6839 (diff)
fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
Btrfs needs to be able to control how filemap_write_and_wait_range() is called in fsync to make it less of a painful operation, so push down taking i_mutex and the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some file systems can drop taking the i_mutex altogether it seems, like ext3 and ocfs2. For correctness sake I just pushed everything down in all cases to make sure that we keep the current behavior the same for everybody, and then each individual fs maintainer can make up their mind about what to do from there. Thanks, Acked-by: Jan Kara <jack@suse.cz> Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4a61f98823a6..9cd2075c4a39 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1572,7 +1572,7 @@ struct file_operations {
1572 int (*open) (struct inode *, struct file *); 1572 int (*open) (struct inode *, struct file *);
1573 int (*flush) (struct file *, fl_owner_t id); 1573 int (*flush) (struct file *, fl_owner_t id);
1574 int (*release) (struct inode *, struct file *); 1574 int (*release) (struct inode *, struct file *);
1575 int (*fsync) (struct file *, int datasync); 1575 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
1576 int (*aio_fsync) (struct kiocb *, int datasync); 1576 int (*aio_fsync) (struct kiocb *, int datasync);
1577 int (*fasync) (int, struct file *, int); 1577 int (*fasync) (int, struct file *, int);
1578 int (*lock) (struct file *, int, struct file_lock *); 1578 int (*lock) (struct file *, int, struct file_lock *);
@@ -2360,7 +2360,8 @@ extern int generic_segment_checks(const struct iovec *iov,
2360/* fs/block_dev.c */ 2360/* fs/block_dev.c */
2361extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2361extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2362 unsigned long nr_segs, loff_t pos); 2362 unsigned long nr_segs, loff_t pos);
2363extern int blkdev_fsync(struct file *filp, int datasync); 2363extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
2364 int datasync);
2364 2365
2365/* fs/splice.c */ 2366/* fs/splice.c */
2366extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2367extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@ -2490,7 +2491,7 @@ extern int simple_link(struct dentry *, struct inode *, struct dentry *);
2490extern int simple_unlink(struct inode *, struct dentry *); 2491extern int simple_unlink(struct inode *, struct dentry *);
2491extern int simple_rmdir(struct inode *, struct dentry *); 2492extern int simple_rmdir(struct inode *, struct dentry *);
2492extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 2493extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
2493extern int noop_fsync(struct file *, int); 2494extern int noop_fsync(struct file *, loff_t, loff_t, int);
2494extern int simple_empty(struct dentry *); 2495extern int simple_empty(struct dentry *);
2495extern int simple_readpage(struct file *file, struct page *page); 2496extern int simple_readpage(struct file *file, struct page *page);
2496extern int simple_write_begin(struct file *file, struct address_space *mapping, 2497extern int simple_write_begin(struct file *file, struct address_space *mapping,
@@ -2515,7 +2516,7 @@ extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
2515extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, 2516extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
2516 const void __user *from, size_t count); 2517 const void __user *from, size_t count);
2517 2518
2518extern int generic_file_fsync(struct file *, int); 2519extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
2519 2520
2520extern int generic_check_addressable(unsigned, u64); 2521extern int generic_check_addressable(unsigned, u64);
2521 2522