summaryrefslogtreecommitdiffstats
path: root/include/linux/pagemap.h
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2024-09-11 17:34:39 +0100
committerJens Axboe <axboe@kernel.dk>2024-09-11 10:44:10 -0600
commita12c883a0a6a005cfb3ad01feaf783e2248bfc3e (patch)
tree62b7dd057cac67dbf484717fd3908b72fff9df99 /include/linux/pagemap.h
parenta6ccb48e13662bcb98282e051512b9686b02d353 (diff)
downloadlinux-a12c883a0a6a005cfb3ad01feaf783e2248bfc3e.tar.gz
linux-a12c883a0a6a005cfb3ad01feaf783e2248bfc3e.tar.bz2
linux-a12c883a0a6a005cfb3ad01feaf783e2248bfc3e.zip
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>
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r--include/linux/pagemap.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index d9c7edb6422b..e39c3a7ce33c 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -32,6 +32,8 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
pgoff_t start, pgoff_t end);
int kiocb_invalidate_pages(struct kiocb *iocb, size_t count);
void kiocb_invalidate_post_direct_write(struct kiocb *iocb, size_t count);
+int filemap_invalidate_pages(struct address_space *mapping,
+ loff_t pos, loff_t end, bool nowait);
int write_inode_now(struct inode *, int sync);
int filemap_fdatawrite(struct address_space *);