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 /mm/filemap.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 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 1578c224285e..ad7242043bdb 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -1695,8 +1695,7 @@ generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter) | |||
1695 | loff_t *ppos = &iocb->ki_pos; | 1695 | loff_t *ppos = &iocb->ki_pos; |
1696 | loff_t pos = *ppos; | 1696 | loff_t pos = *ppos; |
1697 | 1697 | ||
1698 | /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */ | 1698 | if (io_is_direct(file)) { |
1699 | if (file->f_flags & O_DIRECT) { | ||
1700 | struct address_space *mapping = file->f_mapping; | 1699 | struct address_space *mapping = file->f_mapping; |
1701 | struct inode *inode = mapping->host; | 1700 | struct inode *inode = mapping->host; |
1702 | size_t count = iov_iter_count(iter); | 1701 | size_t count = iov_iter_count(iter); |
@@ -2584,8 +2583,7 @@ ssize_t __generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from) | |||
2584 | if (err) | 2583 | if (err) |
2585 | goto out; | 2584 | goto out; |
2586 | 2585 | ||
2587 | /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */ | 2586 | if (io_is_direct(file)) { |
2588 | if (unlikely(file->f_flags & O_DIRECT)) { | ||
2589 | loff_t endbyte; | 2587 | loff_t endbyte; |
2590 | 2588 | ||
2591 | written = generic_file_direct_write(iocb, from, pos); | 2589 | written = generic_file_direct_write(iocb, from, pos); |