diff options
author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2015-02-16 18:58:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-16 20:56:03 -0500 |
commit | d475c6346a38aef3058eba96867bfa726a3cc940 (patch) | |
tree | 4d69d0f50a4a8e649a751dca8f710485848c0249 /include/linux/fs.h | |
parent | fbbbad4bc2101e452b24e6e65d3d5e11314a0b5f (diff) |
dax,ext2: replace XIP read and write with DAX I/O
Use the generic AIO infrastructure instead of custom read and write
methods. In addition to giving us support for AIO, this adds the missing
locking between read() and truncate().
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Boaz Harrosh <boaz@plexistor.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
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/fs.h')
-rw-r--r-- | include/linux/fs.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index fb373bb5cf03..241c3c030fb5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2587,12 +2587,11 @@ extern loff_t fixed_size_llseek(struct file *file, loff_t offset, | |||
2587 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2587 | extern int generic_file_open(struct inode * inode, struct file * filp); |
2588 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2588 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
2589 | 2589 | ||
2590 | ssize_t dax_do_io(int rw, struct kiocb *, struct inode *, struct iov_iter *, | ||
2591 | loff_t, get_block_t, dio_iodone_t, int flags); | ||
2592 | |||
2590 | #ifdef CONFIG_FS_XIP | 2593 | #ifdef CONFIG_FS_XIP |
2591 | extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, | ||
2592 | loff_t *ppos); | ||
2593 | extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); | 2594 | extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); |
2594 | extern ssize_t xip_file_write(struct file *filp, const char __user *buf, | ||
2595 | size_t len, loff_t *ppos); | ||
2596 | extern int xip_truncate_page(struct address_space *mapping, loff_t from); | 2595 | extern int xip_truncate_page(struct address_space *mapping, loff_t from); |
2597 | #else | 2596 | #else |
2598 | static inline int xip_truncate_page(struct address_space *mapping, loff_t from) | 2597 | static inline int xip_truncate_page(struct address_space *mapping, loff_t from) |
@@ -2756,6 +2755,11 @@ extern int generic_show_options(struct seq_file *m, struct dentry *root); | |||
2756 | extern void save_mount_options(struct super_block *sb, char *options); | 2755 | extern void save_mount_options(struct super_block *sb, char *options); |
2757 | extern void replace_mount_options(struct super_block *sb, char *options); | 2756 | extern void replace_mount_options(struct super_block *sb, char *options); |
2758 | 2757 | ||
2758 | static inline bool io_is_direct(struct file *filp) | ||
2759 | { | ||
2760 | return (filp->f_flags & O_DIRECT) || IS_DAX(file_inode(filp)); | ||
2761 | } | ||
2762 | |||
2759 | static inline ino_t parent_ino(struct dentry *dentry) | 2763 | static inline ino_t parent_ino(struct dentry *dentry) |
2760 | { | 2764 | { |
2761 | ino_t res; | 2765 | ino_t res; |