summaryrefslogtreecommitdiffstats
path: root/include/linux/highmem.h
diff options
context:
space:
mode:
authorFabio M. De Francesco <fmdefrancesco@gmail.com>2022-06-06 16:15:33 +0200
committerakpm <akpm@linux-foundation.org>2022-06-16 19:48:29 -0700
commit9384d79249d04b03572abb7e551a35d99c9268c0 (patch)
tree02a003587fc361515b3d2df54a0d90c8b7d2de15 /include/linux/highmem.h
parent673520f8da64f16077c1ecb190cbb38aa939fb41 (diff)
downloadlinux-9384d79249d04b03572abb7e551a35d99c9268c0.tar.gz
linux-9384d79249d04b03572abb7e551a35d99c9268c0.tar.bz2
linux-9384d79249d04b03572abb7e551a35d99c9268c0.zip
mm/highmem: delete memmove_page()
Matthew Wilcox reported that, while he was looking at memmove_page(), he realized that it can't actually work. The reasons are hidden in its implementation, which makes use of memmove() on logical addresses provided by kmap_local_page(). memmove() does the wrong thing when it tests "if (dest <= src)". Therefore, delete memmove_page(). No need to change any other code because we have no call sites of memmove_page() across the whole kernel. Link: https://lkml.kernel.org/r/20220606141533.555-1-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Reported-by: Matthew Wilcox <willy@infradead.org> Reviewed-by: Baoquan He <bhe@redhat.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/highmem.h')
-rw-r--r--include/linux/highmem.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 3af34de54330..fee9835e3793 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -336,19 +336,6 @@ static inline void memcpy_page(struct page *dst_page, size_t dst_off,
kunmap_local(dst);
}
-static inline void memmove_page(struct page *dst_page, size_t dst_off,
- struct page *src_page, size_t src_off,
- size_t len)
-{
- char *dst = kmap_local_page(dst_page);
- char *src = kmap_local_page(src_page);
-
- VM_BUG_ON(dst_off + len > PAGE_SIZE || src_off + len > PAGE_SIZE);
- memmove(dst + dst_off, src + src_off, len);
- kunmap_local(src);
- kunmap_local(dst);
-}
-
static inline void memset_page(struct page *page, size_t offset, int val,
size_t len)
{