diff options
author | Jan Kara <jack@suse.cz> | 2016-05-11 05:58:52 -0400 |
---|---|---|
committer | Vishal Verma <vishal.l.verma@intel.com> | 2016-05-17 02:44:09 -0400 |
commit | c3d98e39d5b37320b15f227686575d58f676e6ef (patch) | |
tree | 2e221bb403db75da6a40c70919f82ad492315e53 | |
parent | 069c77bc9eaee70fa9ecbd942372b1693b8cdeb0 (diff) |
dax: Remove pointless writeback from dax_do_io()
dax_do_io() is calling filemap_write_and_wait() if DIO_LOCKING flags is
set. Presumably this was copied over from direct IO code. However DAX
inodes have no pagecache pages to write so the call is pointless. Remove
it.
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
-rw-r--r-- | fs/dax.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -268,15 +268,8 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode, | |||
268 | memset(&bh, 0, sizeof(bh)); | 268 | memset(&bh, 0, sizeof(bh)); |
269 | bh.b_bdev = inode->i_sb->s_bdev; | 269 | bh.b_bdev = inode->i_sb->s_bdev; |
270 | 270 | ||
271 | if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ) { | 271 | if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ) |
272 | struct address_space *mapping = inode->i_mapping; | ||
273 | inode_lock(inode); | 272 | inode_lock(inode); |
274 | retval = filemap_write_and_wait_range(mapping, pos, end - 1); | ||
275 | if (retval) { | ||
276 | inode_unlock(inode); | ||
277 | goto out; | ||
278 | } | ||
279 | } | ||
280 | 273 | ||
281 | /* Protects against truncate */ | 274 | /* Protects against truncate */ |
282 | if (!(flags & DIO_SKIP_DIO_COUNT)) | 275 | if (!(flags & DIO_SKIP_DIO_COUNT)) |
@@ -297,7 +290,6 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode, | |||
297 | 290 | ||
298 | if (!(flags & DIO_SKIP_DIO_COUNT)) | 291 | if (!(flags & DIO_SKIP_DIO_COUNT)) |
299 | inode_dio_end(inode); | 292 | inode_dio_end(inode); |
300 | out: | ||
301 | return retval; | 293 | return retval; |
302 | } | 294 | } |
303 | EXPORT_SYMBOL_GPL(dax_do_io); | 295 | EXPORT_SYMBOL_GPL(dax_do_io); |