mm/truncate: add folio_unmap_invalidate() helper
authorJens Axboe <axboe@kernel.dk>
Fri, 8 Nov 2024 15:21:09 +0000 (08:21 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 1 Dec 2024 22:55:24 +0000 (15:55 -0700)
commit696ca24baf6eccf616effb0767dcafbb9c803dba
tree9109584d947cb2d9f73240a45d9d9d08e3db8b1b
parent39c1ce91ac2011560bb186bdddd736b58a7127fe
mm/truncate: add folio_unmap_invalidate() helper

Add a folio_unmap_invalidate() helper, which unmaps and invalidates a
given folio. The caller must already have locked the folio. Use this
new helper in invalidate_inode_pages2_range(), rather than duplicate
the code there.

In preparation for using this elsewhere as well, have it take a gfp_t
mask rather than assume GFP_KERNEL is the right choice. This bubbles
back to invalidate_complete_folio2() as well.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/pagemap.h
mm/truncate.c