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>
This commit is contained in:
Al Viro 2023-03-07 01:50:53 -05:00
parent fe15c26ee2
commit 849ad04cf5

View File

@ -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 */