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>
Wed, 20 Nov 2024 14:30:16 +0000 (07:30 -0700)
commit50ff27b25414104d322141711b233a3b16de2157
treef4b7117a01c051d90f345b945159973d4e3dd234
parentd450c889a096a2737432b77e28b71faf245affd9
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