From patchwork Wed Oct 10 00:11:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10633531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD1C517E3 for ; Wed, 10 Oct 2018 00:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC50F29CD7 for ; Wed, 10 Oct 2018 00:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA9A429CDB; Wed, 10 Oct 2018 00:11:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37A9629CC9 for ; Wed, 10 Oct 2018 00:11:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F27F26B0273; Tue, 9 Oct 2018 20:11:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EB0CD6B0274; Tue, 9 Oct 2018 20:11:51 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D52B46B0275; Tue, 9 Oct 2018 20:11:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by kanga.kvack.org (Postfix) with ESMTP id 8E0976B0273 for ; Tue, 9 Oct 2018 20:11:51 -0400 (EDT) Received: by mail-pl1-f200.google.com with SMTP id f59-v6so2658828plb.5 for ; Tue, 09 Oct 2018 17:11:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:from:to:cc:date :message-id:in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=MFRIwz6CBqFVERKzCNBTAbGcC1anU5teARhXCpG9dhQ=; b=EuvNOO770FJaV47bs25ZcXZEQ0ecbJrCQdmKMWIHjgnR6Yeh/i0Uwep31abhp2i1SE 2JYScaQX3FkkR9rrXKEVzBbrlCAJSswtWNQNnv0ZhlYyUJERNtfG03SeYTee1cZBmkfU oEp2wTnV4RKDvOpCfrIJ95cxT5TihXaALkxzmCvgc+i80XcFciJ2aIFFer+d8FNQ3FCC mr//m6kqCYXjIjRBri3ceCtqX6G0uDdEtZ186TgFpC9KGvJbkJZ9s50IHecOTkjnE1YO 1anissjCCCjG9DbbcQ1QCbRBpFwYCOs6GIxtsN9G4HLvss4exP3oXi4EHzlwOR60sPx1 veWw== X-Gm-Message-State: ABuFfogFruaTLb1UOatj8l5VoBo2etDRtCFac88507Uf5KMS+6XakVxd qnjE370ASRrORpSvrz2V2QJNtZkQNcSqBaD098hvD8eAJL2jmobf+/WBI1co7fpl0KZRmiEUmIE oUKuMOpMM/B1z3/ZCtrEja9534hP8vyFdWzDJTZztUUAOCbX/kvjABp6QZFMZmKOXWg== X-Received: by 2002:a62:70c7:: with SMTP id l190-v6mr31978209pfc.186.1539130311158; Tue, 09 Oct 2018 17:11:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV60th2ddkwPxX99/9qk3RnLf/Ty8Ohsj9K3OTCaSgjDaZ0Svf0H+sjVbrVhEH7pyVNPnZVhv X-Received: by 2002:a62:70c7:: with SMTP id l190-v6mr31978146pfc.186.1539130310375; Tue, 09 Oct 2018 17:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539130310; cv=none; d=google.com; s=arc-20160816; b=pBLmsS7uQGNrLR0eShACOwwvl0Tod9fOMwrhw//WhX6zsqm9H8jX9rj6Pc7RoPn2TZ H0oS3sXewtd7fzhb+Zo2kfxorscGF1QNQQiydZ+JfLvDeBEloxblMnHb1gciin93FowK iWk+ocTc97scFQRcQO9U7qZPtn33FJgH4zhssdeM41uQDPDG0MWscZoODzIzl5EhQPEF dVpQFEUT0y/cHj6uIeZ+DLG2rai7GkJwFEJc0p1kOTj6DXEDxAb9l8wu1COpogVKH5C1 /FfYtOacGnIvp3QHt4CHDBB2TnyfkqEkLmWjPGiNJHcfXUj56/KNCdGypThuQkCEK59l A0vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:message-id:date:cc:to:from:subject:dkim-signature; bh=MFRIwz6CBqFVERKzCNBTAbGcC1anU5teARhXCpG9dhQ=; b=qIsUHNNw5JO5qn7kQW6LFUmX8219X8j1sxwqxI1LQTTPTTLwCywCKaS2T/B464O3Bv zaVuO9SbigbIOpD19jShU/z7eXoDtA17fCwxCCLMUv/S5MWAB7LThNmZwR8ysrpCsuSA WWck7Jr/4qqOeLYDy6K3E4pHc3bvviI83nR5DgAiMj4fCK/4JDI5Gsp+F1aj4vCy4T1z 7YfSLO++u1rHVN/upu7aMtANaInuLu3FKZB91KQ6Swis5vYWbCSUvsHrV65LM0Rw4dXh 2anwIy31fatnU7a6hCFqDYJUTCLeY8P051vRcP4Tc5gmyVhQB+3vhIn09Cd9Uu683TKr yFvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=3UbwYI6o; spf=pass (google.com: domain of darrick.wong@oracle.com designates 141.146.126.78 as permitted sender) smtp.mailfrom=darrick.wong@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from aserp2120.oracle.com (aserp2120.oracle.com. [141.146.126.78]) by mx.google.com with ESMTPS id x1-v6si19082805plb.132.2018.10.09.17.11.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 17:11:50 -0700 (PDT) Received-SPF: pass (google.com: domain of darrick.wong@oracle.com designates 141.146.126.78 as permitted sender) client-ip=141.146.126.78; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=3UbwYI6o; spf=pass (google.com: domain of darrick.wong@oracle.com designates 141.146.126.78 as permitted sender) smtp.mailfrom=darrick.wong@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9A08Z06138530; Wed, 10 Oct 2018 00:11:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=MFRIwz6CBqFVERKzCNBTAbGcC1anU5teARhXCpG9dhQ=; b=3UbwYI6o8zuAm1YHNg4j48vh8tw6hhgMDh2mod00P5l18lD+iIErI+hNvaWVN1TvtZyM S9Exu7FsQvCNPXzShBzsJbtxAqRIceiWCO+8K3WpgmWtcI7apLpXfKzyJSgTndHJWrK/ CMp9R/I1d1tk8f/t7wPC8R2h6sQS5GdYcPwMPo7ecc9gXc3KBPVXNH/NJvrw1bRCrV1l 3oyFb0jFqBhxsEjKVS9xR8irJSNa9r0SJczzImMCeH0KhS+ePOJ1bmCvqfLWberEHPVc KXnn1rKiSbn0uF6Wf7zyIW8UUPYGHQRDEyF6muwVyeBr1kdBuN51qfYn3szujmGDar4V xg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2mxn0q0tj1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Oct 2018 00:11:49 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9A0Bm5q032650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Oct 2018 00:11:48 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9A0BlMu020940; Wed, 10 Oct 2018 00:11:47 GMT Received: from localhost (/10.159.249.114) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 10 Oct 2018 00:11:47 +0000 Subject: [PATCH 09/25] vfs: rename vfs_clone_file_prep to be more descriptive From: "Darrick J. Wong" To: david@fromorbit.com, darrick.wong@oracle.com Cc: sandeen@redhat.com, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com Date: Tue, 09 Oct 2018 17:11:45 -0700 Message-ID: <153913030578.32295.3542082209724064016.stgit@magnolia> In-Reply-To: <153913023835.32295.13962696655740190941.stgit@magnolia> References: <153913023835.32295.13962696655740190941.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9041 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=782 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810100000 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong The vfs_clone_file_prep is a generic function to be called by filesystem implementations only. Rename the prefix to generic_ and make it more clear that it applies to remap operations, not just clones. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c | 2 +- fs/read_write.c | 8 ++++---- fs/xfs/xfs_reflink.c | 2 +- include/linux/fs.h | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 19e03936c5e1..36c56dfbe485 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -4850,7 +4850,7 @@ int ocfs2_reflink_remap_range(struct file *file_in, (OCFS2_I(inode_out)->ip_flags & OCFS2_INODE_SYSTEM_FILE)) goto out_unlock; - ret = vfs_clone_file_prep(file_in, pos_in, file_out, pos_out, + ret = generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out, &len, is_dedupe); if (ret <= 0) goto out_unlock; diff --git a/fs/read_write.c b/fs/read_write.c index a33c8503f12e..4ea81ea7d78d 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1717,9 +1717,9 @@ static int clone_verify_area(struct file *file, loff_t pos, u64 len, bool write) * Returns: 0 for "nothing to clone", 1 for "something to clone", or * the usual negative error code. */ -int vfs_clone_file_prep(struct file *file_in, loff_t pos_in, - struct file *file_out, loff_t pos_out, - u64 *len, bool is_dedupe) +int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in, + struct file *file_out, loff_t pos_out, + u64 *len, bool is_dedupe) { struct inode *inode_in = file_inode(file_in); struct inode *inode_out = file_inode(file_out); @@ -1788,7 +1788,7 @@ int vfs_clone_file_prep(struct file *file_in, loff_t pos_in, return 1; } -EXPORT_SYMBOL(vfs_clone_file_prep); +EXPORT_SYMBOL(generic_remap_file_range_prep); int do_clone_file_range(struct file *file_in, loff_t pos_in, struct file *file_out, loff_t pos_out, u64 len) diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index a4a7b2d9c8a1..4cf1e52efbff 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -1303,7 +1303,7 @@ xfs_reflink_remap_prep( if (IS_DAX(inode_in) || IS_DAX(inode_out)) goto out_unlock; - ret = vfs_clone_file_prep(file_in, pos_in, file_out, pos_out, + ret = generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out, len, is_dedupe); if (ret <= 0) goto out_unlock; diff --git a/include/linux/fs.h b/include/linux/fs.h index 6fedfe4fb5ef..d8f90bdd34e2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1830,9 +1830,9 @@ extern ssize_t vfs_readv(struct file *, const struct iovec __user *, unsigned long, loff_t *, rwf_t); extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *, loff_t, size_t, unsigned int); -extern int vfs_clone_file_prep(struct file *file_in, loff_t pos_in, - struct file *file_out, loff_t pos_out, - u64 *count, bool is_dedupe); +extern int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in, + struct file *file_out, loff_t pos_out, + u64 *count, bool is_dedupe); extern int do_clone_file_range(struct file *file_in, loff_t pos_in, struct file *file_out, loff_t pos_out, u64 len); extern int vfs_clone_file_range(struct file *file_in, loff_t pos_in,