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 /fs/ext2/inode.c | |
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 'fs/ext2/inode.c')
-rw-r--r-- | fs/ext2/inode.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 0cb04486577d..3ccd5fd47d66 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -859,7 +859,12 @@ ext2_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, | |||
859 | size_t count = iov_iter_count(iter); | 859 | size_t count = iov_iter_count(iter); |
860 | ssize_t ret; | 860 | ssize_t ret; |
861 | 861 | ||
862 | ret = blockdev_direct_IO(rw, iocb, inode, iter, offset, ext2_get_block); | 862 | if (IS_DAX(inode)) |
863 | ret = dax_do_io(rw, iocb, inode, iter, offset, ext2_get_block, | ||
864 | NULL, DIO_LOCKING); | ||
865 | else | ||
866 | ret = blockdev_direct_IO(rw, iocb, inode, iter, offset, | ||
867 | ext2_get_block); | ||
863 | if (ret < 0 && (rw & WRITE)) | 868 | if (ret < 0 && (rw & WRITE)) |
864 | ext2_write_failed(mapping, offset + count); | 869 | ext2_write_failed(mapping, offset + count); |
865 | return ret; | 870 | return ret; |
@@ -888,6 +893,7 @@ const struct address_space_operations ext2_aops = { | |||
888 | const struct address_space_operations ext2_aops_xip = { | 893 | const struct address_space_operations ext2_aops_xip = { |
889 | .bmap = ext2_bmap, | 894 | .bmap = ext2_bmap, |
890 | .get_xip_mem = ext2_get_xip_mem, | 895 | .get_xip_mem = ext2_get_xip_mem, |
896 | .direct_IO = ext2_direct_IO, | ||
891 | }; | 897 | }; |
892 | 898 | ||
893 | const struct address_space_operations ext2_nobh_aops = { | 899 | const struct address_space_operations ext2_nobh_aops = { |