diff mbox series

[03/18] mm: use kmap_local_page in memzero_page

Message ID 20210615132456.753241-4-hch@lst.de (mailing list archive)
State Not Applicable
Headers show
Series [01/18] mm: add a kunmap_local_dirty helper | expand

Commit Message

Christoph Hellwig June 15, 2021, 1:24 p.m. UTC
No need for kmap_atomic here.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
---
 include/linux/highmem.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index d0497c0daf80..d3df0e2db44f 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -338,9 +338,9 @@  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);
-	kunmap_atomic(addr);
+	kunmap_local_dirty(page, addr);
 }
 
 #endif /* _LINUX_HIGHMEM_H */