aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew.r.wilcox@intel.com>2015-02-16 18:58:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-16 20:56:03 -0500
commitd475c6346a38aef3058eba96867bfa726a3cc940 (patch)
tree4d69d0f50a4a8e649a751dca8f710485848c0249 /include/linux/fs.h
parentfbbbad4bc2101e452b24e6e65d3d5e11314a0b5f (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.h12
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,
2587extern int generic_file_open(struct inode * inode, struct file * filp); 2587extern int generic_file_open(struct inode * inode, struct file * filp);
2588extern int nonseekable_open(struct inode * inode, struct file * filp); 2588extern int nonseekable_open(struct inode * inode, struct file * filp);
2589 2589
2590ssize_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
2591extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len,
2592 loff_t *ppos);
2593extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); 2594extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma);
2594extern ssize_t xip_file_write(struct file *filp, const char __user *buf,
2595 size_t len, loff_t *ppos);
2596extern int xip_truncate_page(struct address_space *mapping, loff_t from); 2595extern int xip_truncate_page(struct address_space *mapping, loff_t from);
2597#else 2596#else
2598static inline int xip_truncate_page(struct address_space *mapping, loff_t from) 2597static 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);
2756extern void save_mount_options(struct super_block *sb, char *options); 2755extern void save_mount_options(struct super_block *sb, char *options);
2757extern void replace_mount_options(struct super_block *sb, char *options); 2756extern void replace_mount_options(struct super_block *sb, char *options);
2758 2757
2758static inline bool io_is_direct(struct file *filp)
2759{
2760 return (filp->f_flags & O_DIRECT) || IS_DAX(file_inode(filp));
2761}
2762
2759static inline ino_t parent_ino(struct dentry *dentry) 2763static inline ino_t parent_ino(struct dentry *dentry)
2760{ 2764{
2761 ino_t res; 2765 ino_t res;