From: Ira Weiny <[email protected]>

The new common function memcpy_page() provides this exactly
functionality.  Remove the local f2fs_copy_page() and call memcpy_page()
instead.

Cc: Jaegeuk Kim <[email protected]>
Cc: Chao Yu <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>
---
 fs/f2fs/f2fs.h | 10 ----------
 fs/f2fs/file.c |  3 ++-
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index cb700d797296..546dba7d7cc2 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -2428,16 +2428,6 @@ static inline struct page *f2fs_pagecache_get_page(
        return pagecache_get_page(mapping, index, fgp_flags, gfp_mask);
 }
 
-static inline void f2fs_copy_page(struct page *src, struct page *dst)
-{
-       char *src_kaddr = kmap(src);
-       char *dst_kaddr = kmap(dst);
-
-       memcpy(dst_kaddr, src_kaddr, PAGE_SIZE);
-       kunmap(dst);
-       kunmap(src);
-}
-
 static inline void f2fs_put_page(struct page *page, int unlock)
 {
        if (!page)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index ee861c6d9ff0..c38aa186a7c6 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -17,6 +17,7 @@
 #include <linux/uaccess.h>
 #include <linux/mount.h>
 #include <linux/pagevec.h>
+#include <linux/pagemap.h>
 #include <linux/uio.h>
 #include <linux/uuid.h>
 #include <linux/file.h>
@@ -1234,7 +1235,7 @@ static int __clone_blkaddrs(struct inode *src_inode, 
struct inode *dst_inode,
                                f2fs_put_page(psrc, 1);
                                return PTR_ERR(pdst);
                        }
-                       f2fs_copy_page(psrc, pdst);
+                       memcpy_page(psrc, 0, pdst, 0, PAGE_SIZE);
                        set_page_dirty(pdst);
                        f2fs_put_page(pdst, 1);
                        f2fs_put_page(psrc, 1);
-- 
2.28.0.rc0.12.gb6a658bd00c9

Reply via email to