]> git.baikalelectronics.ru Git - kernel.git/commit
mm: use filemap_range_needs_writeback() for O_DIRECT reads
authorJens Axboe <axboe@kernel.dk>
Fri, 30 Apr 2021 05:55:21 +0000 (22:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 30 Apr 2021 18:20:36 +0000 (11:20 -0700)
commit5c6bf21e004e1cad75dc047a0b83ed97621a2449
treefb4dbde0a5b777a46baf2041bbd07d30c37b9246
parent4f50aceac13339a68e6b8294fe33f20c78e0f2f3
mm: use filemap_range_needs_writeback() for O_DIRECT reads

For the generic page cache read helper, use the better variant of checking
for the need to call filemap_write_and_wait_range() when doing O_DIRECT
reads.  This avoids falling back to the slow path for IOCB_NOWAIT, if
there are no pages to wait for (or write out).

Link: https://lkml.kernel.org/r/20210224164455.1096727-3-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c