filemap: introduce filemap_invalidate_pages
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 11 Sep 2024 16:34:39 +0000 (17:34 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 11 Sep 2024 16:44:10 +0000 (10:44 -0600)
commita12c883a0a6a005cfb3ad01feaf783e2248bfc3e
tree62b7dd057cac67dbf484717fd3908b72fff9df99
parenta6ccb48e13662bcb98282e051512b9686b02d353
filemap: introduce filemap_invalidate_pages

kiocb_invalidate_pages() is useful for the write path, however not
everything is backed by kiocb and we want to reuse the function for bio
based discard implementation. Extract and and reuse a new helper called
filemap_invalidate_pages(), which takes a argument indicating whether it
should be non-blocking and might return -EAGAIN.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/f81374b52c92d0dce0f01a279d1eed42b54056aa.1726072086.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/pagemap.h
mm/filemap.c