Skip to content

Commit c3d98e3

Browse files
jankarastellarhopper
authored andcommitted
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 <[email protected]> Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Vishal Verma <[email protected]>
1 parent 069c77b commit c3d98e3

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

fs/dax.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,8 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode,
268268
memset(&bh, 0, sizeof(bh));
269269
bh.b_bdev = inode->i_sb->s_bdev;
270270

271-
if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ) {
272-
struct address_space *mapping = inode->i_mapping;
271+
if ((flags & DIO_LOCKING) && iov_iter_rw(iter) == READ)
273272
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-
}
280273

281274
/* Protects against truncate */
282275
if (!(flags & DIO_SKIP_DIO_COUNT))
@@ -297,7 +290,6 @@ ssize_t dax_do_io(struct kiocb *iocb, struct inode *inode,
297290

298291
if (!(flags & DIO_SKIP_DIO_COUNT))
299292
inode_dio_end(inode);
300-
out:
301293
return retval;
302294
}
303295
EXPORT_SYMBOL_GPL(dax_do_io);

0 commit comments

Comments
 (0)