From patchwork Tue Nov 24 06:07:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 11927207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B40B1C64E7B for ; Tue, 24 Nov 2020 06:08:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 841A22076C for ; Tue, 24 Nov 2020 06:08:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729428AbgKXGIK (ORCPT ); Tue, 24 Nov 2020 01:08:10 -0500 Received: from mga09.intel.com ([134.134.136.24]:46773 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729392AbgKXGIK (ORCPT ); Tue, 24 Nov 2020 01:08:10 -0500 IronPort-SDR: tSukXnsy5ujVf6P5I2Qes+gmtFQamP/tFM3ZqLsx8prryjz7t96AJ3lB3OlYkJFJfxeedLPFEJ oTpxHyzxpU7Q== X-IronPort-AV: E=McAfee;i="6000,8403,9814"; a="172052674" X-IronPort-AV: E=Sophos;i="5.78,365,1599548400"; d="scan'208";a="172052674" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 22:08:08 -0800 IronPort-SDR: dPkuJ3cNpwAQdF4IO+jQMXzUYsWknEpJ9XFX9SluvT2WJYgM+NOtXoIN5Iiym2a6VoF/+lWsq2 rgtY2MOcyv9g== X-IronPort-AV: E=Sophos;i="5.78,365,1599548400"; d="scan'208";a="343047661" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 22:08:07 -0800 From: ira.weiny@intel.com To: Andrew Morton Cc: Ira Weiny , Jaegeuk Kim , Chao Yu , Thomas Gleixner , Dave Hansen , Matthew Wilcox , Christoph Hellwig , Dan Williams , Al Viro , Eric Biggers , Luis Chamberlain , Patrik Jakobsson , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Howells , Chris Mason , Josef Bacik , David Sterba , Steve French , Nicolas Pitre , "Martin K. Petersen" , Brian King , Greg Kroah-Hartman , Alexei Starovoitov , Daniel Borkmann , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Kirti Wankhede , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 09/17] fs/f2fs: Remove f2fs_copy_page() Date: Mon, 23 Nov 2020 22:07:47 -0800 Message-Id: <20201124060755.1405602-10-ira.weiny@intel.com> X-Mailer: git-send-email 2.28.0.rc0.12.gb6a658bd00c9 In-Reply-To: <20201124060755.1405602-1-ira.weiny@intel.com> References: <20201124060755.1405602-1-ira.weiny@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Ira Weiny The new common function memcpy_page() provides this exactly functionality. Remove the local f2fs_copy_page() and call memcpy_page() instead. Cc: Jaegeuk Kim Cc: Chao Yu Signed-off-by: Ira Weiny Acked-by: Chao Yu --- 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 #include #include +#include #include #include #include @@ -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);