[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210210062221.3023586-3-ira.weiny@intel.com>
Date: Tue, 9 Feb 2021 22:22:15 -0800
From: ira.weiny@...el.com
To: Andrew Morton <akpm@...ux-foundation.org>,
David Sterba <dsterba@...e.cz>
Cc: Ira Weiny <ira.weiny@...el.com>,
Christoph Hellwig <hch@...radead.org>, clm@...com,
josef@...icpanda.com, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: [PATCH V2 2/8] mm/highmem: Convert memcpy_[to|from]_page() to kmap_local_page()
From: Ira Weiny <ira.weiny@...el.com>
kmap_local_page() is more efficient and is well suited for these calls.
Convert the kmap() to kmap_local_page()
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Christoph Hellwig <hch@...radead.org>
Signed-off-by: Ira Weiny <ira.weiny@...el.com>
---
New for V2
---
include/linux/highmem.h | 8 ++++----
1 file 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 */
--
2.28.0.rc0.12.gb6a658bd00c9
Powered by blists - more mailing lists