diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2023-03-07 07:50:53 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2023-03-07 07:50:53 +0100 |
commit | 849ad04cf562ac63b0371a825eed473d84de9c6d (patch) | |
tree | c23ae421694f5d2645fb0af61045c41f0a01793e /include | |
parent | Linux 6.3-rc1 (diff) | |
download | linux-849ad04cf562ac63b0371a825eed473d84de9c6d.tar.xz linux-849ad04cf562ac63b0371a825eed473d84de9c6d.zip |
new helper: put_and_unmap_page()
kunmap_local() + put_page(), as done by e.g. ext2 directory handling.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/highmem.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index b06254e76d99..8fc10089e19e 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -481,4 +481,10 @@ static inline void folio_zero_range(struct folio *folio, zero_user_segments(&folio->page, start, start + length, 0, 0); } +static inline void put_and_unmap_page(struct page *page, void *addr) +{ + kunmap_local(addr); + put_page(page); +} + #endif /* _LINUX_HIGHMEM_H */ |