summaryrefslogtreecommitdiff
path: root/include/linux/highmem.h
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2021-02-09 22:22:15 -0800
committerDavid Sterba <dsterba@suse.com>2021-02-11 19:55:16 +0100
commit61b205f579911a11f0b576f73275eca2aed0d108 (patch)
tree3bbef09f264834a8e9175d236529d3bd188f3bfb /include/linux/highmem.h
parentbb90d4bc7b6a536b2e4db45f4763e467c2008251 (diff)
downloadlwn-61b205f579911a11f0b576f73275eca2aed0d108.tar.gz
lwn-61b205f579911a11f0b576f73275eca2aed0d108.zip
mm/highmem: Convert memcpy_[to|from]_page() to kmap_local_page()
kmap_local_page() is more efficient and is well suited for these calls. Convert the kmap() to kmap_local_page() Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Christoph Hellwig <hch@infradead.org> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/linux/highmem.h')
-rw-r--r--include/linux/highmem.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 736b6a9f144d..c17a175fe5fe 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -279,19 +279,19 @@ static inline void copy_highpage(struct page *to, struct page *from)
static inline void memcpy_from_page(char *to, struct page *page,
size_t offset, size_t len)
{
- char *from = kmap_atomic(page);
+ char *from = kmap_local_page(page);
memcpy(to, from + offset, len);
- kunmap_atomic(from);
+ kunmap_local(from);
}
static inline void memcpy_to_page(struct page *page, size_t offset,
const char *from, size_t len)
{
- char *to = kmap_atomic(page);
+ char *to = kmap_local_page(page);
memcpy(to + offset, from, len);
- kunmap_atomic(to);
+ kunmap_local(to);
}
#endif /* _LINUX_HIGHMEM_H */