Skip to content

Commit

Permalink
new helper: put_and_unmap_page()
Browse files Browse the repository at this point in the history
kunmap_local() + put_page(), as done by e.g. ext2 directory handling.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Mar 7, 2023
1 parent fe15c26 commit 849ad04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 849ad04

Please sign in to comment.