Commit 61b205f5 authored by Ira Weiny's avatar Ira Weiny Committed by David Sterba
Browse files

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: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent bb90d4bc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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 */