Skip to content

Commit 1d44575

Browse files
axboeakpm00
authored andcommitted
mm: call filemap_fdatawrite_range_kick() after IOCB_DONTCACHE issue
When a buffered write submitted with IOCB_DONTCACHE has been successfully submitted, call filemap_fdatawrite_range_kick() to kick off the IO. File systems call generic_write_sync() for any successful buffered write submission, hence add the logic here rather than needing to modify the file system. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]> Cc: Brian Foster <[email protected]> Cc: Chris Mason <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent dddc559 commit 1d44575

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/linux/fs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,6 +2912,11 @@ static inline ssize_t generic_write_sync(struct kiocb *iocb, ssize_t count)
29122912
(iocb->ki_flags & IOCB_SYNC) ? 0 : 1);
29132913
if (ret)
29142914
return ret;
2915+
} else if (iocb->ki_flags & IOCB_DONTCACHE) {
2916+
struct address_space *mapping = iocb->ki_filp->f_mapping;
2917+
2918+
filemap_fdatawrite_range_kick(mapping, iocb->ki_pos,
2919+
iocb->ki_pos + count);
29152920
}
29162921

29172922
return count;

0 commit comments

Comments
 (0)