Skip to content

Commit

Permalink
mm: use kmap_local_page in memzero_page
Browse files Browse the repository at this point in the history
The commit message introducing the global memzero_page explicitly
mentions switching to kmap_local_page in the commit log but doesn't
actually do that.

Link: https://lkml.kernel.org/r/20210713055231.137602-3-hch@lst.de
Fixes: 2896199 ("iov_iter: lift memzero_page() to highmem.h")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Hellwig authored and Linus Torvalds committed Jul 24, 2021
1 parent 8dad53a commit d9a42b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ static inline void memcpy_to_page(struct page *page, size_t offset,

static inline void memzero_page(struct page *page, size_t offset, size_t len)
{
char *addr = kmap_atomic(page);
char *addr = kmap_local_page(page);
memset(addr + offset, 0, len);
flush_dcache_page(page);
kunmap_atomic(addr);
kunmap_local(addr);
}

#endif /* _LINUX_HIGHMEM_H */

0 comments on commit d9a42b5

Please sign in to comment.