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>
Thu, 14 Nov 2024 14:14:29 +0000 (07:14 -0700)
commit7e8ad38ff276708276f0f28147ec3d44a6738097
treee08f9e71e57a11d98aa60fe3d7495218890ea668
parent172066a58c2b9cbe40d4dc0521c529613ae8ba4f
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