From patchwork Wed Oct 17 22:45:03 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: 10646235 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 88300157A for ; Wed, 17 Oct 2018 22:45:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7920C288C7 for ; Wed, 17 Oct 2018 22:45:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D6F4288E4; Wed, 17 Oct 2018 22:45:16 +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 E7590288C7 for ; Wed, 17 Oct 2018 22:45:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BC6C6B0274; Wed, 17 Oct 2018 18:45:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 06AF36B0275; Wed, 17 Oct 2018 18:45:14 -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 E29276B0276; Wed, 17 Oct 2018 18:45:14 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id 9D46F6B0274 for ; Wed, 17 Oct 2018 18:45:14 -0400 (EDT) Received: by mail-pg1-f200.google.com with SMTP id 127-v6so92071pgb.7 for ; Wed, 17 Oct 2018 15:45:14 -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=EVBOjpjVeZ0uqv5Ytj51D02SOvbvYZvIxgFPH2/97ks=; b=WST9Xh9Tuedea+7M9jheALjzZcOCv8IHcXzW6gPTDTI26VTPr/sNhS80gdhvblbZCi xU/G3rH9xVOuBRvtVxYKPL1EGpM7DaiTbHM8g8ZUJcxLmDrRlmX4thZhbC1rN1Ux6Gmh 8nJo2njo2CPHU7Xg1ZfouhzgwH6or4+vIhXU74JY4vU3Pvme3Sa8Ir8s5+FAjEtmYaqG ERpl0kj8pc3qn/nRzGqgpAwEN2MEmYByWWyC7nR2oOcKeWqiJz0YM//YGGY62B5ttSbx hXKF47dxSpuc5ur0kn1FewzjLuvRCrZPSAYP11YMrqj7Rjk0Hu/vH+m9anjJ0lTvjghe AcOA== X-Gm-Message-State: ABuFfoj/HPAmAy95CtFPw0vOafqncvBGYXLYS3W51qIxyTeR557CUIZY Y2lYb/VKZiRAZRGfW3QGpmW+6qYwDqHjI9QZea46VGflExJHqpMYIAiTYLB6DNDF5uvNDsndilJ EXkBsf4pRTQVOCSzTVXib812WdsIO8CxzR1NDe6JFbT3gvBt2KZcnCFhjfwpfdks7/Q== X-Received: by 2002:a62:c502:: with SMTP id j2-v6mr28872156pfg.194.1539816314310; Wed, 17 Oct 2018 15:45:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV63+SmQRnt9TPpTY8fRMQ9tWzaO76URObZ6qjWjd1PXkUAtLO6F5lHvNNG0frijU+VMYDURl X-Received: by 2002:a62:c502:: with SMTP id j2-v6mr28872109pfg.194.1539816313378; Wed, 17 Oct 2018 15:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539816313; cv=none; d=google.com; s=arc-20160816; b=IwASlibnWsUU66brtiwrDwwk6/VCqrfj8KnMLbx0FtBgkB+STBGWvSdGmQZnJuCnxX LvEebxw7BWaxvDbdaCBMdg7myZZlyU/Yi8EZyg06oBGKnO2/x6enTKMUa5n4X/5fAQW1 gCNO6GugCEL5b/qRDDvHEA7u/hfKZijBTuw8U7Aq1CTnGNaggzzW4noV2PBGoi+9c9wl zC9jY3L2+caSmjem8En8o/YjSWnZnPVM+AhIsnHMCTPdh73+rAwvA6FR/ZhDT4iyrAH2 5ggVZLRkgLkXzcvyO2fStIKwwbD8+v9ZiVjAcj9OZp7Ys6FuYdQ/jANKP6W/EUUZUuEU 5C2A== 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=EVBOjpjVeZ0uqv5Ytj51D02SOvbvYZvIxgFPH2/97ks=; b=W26QvWJpiqfpjmd4l1tUgV/kdxT6wPk1W5c07EEF3bySJ2tb+4zjmzyYgSV/nVxpkT NWXgWDOsAkALDb2p1mDLu2pYLaocRNUTk8iPMZmxJSAGA2PhfDKr1KBEdxyDjjDd349f rR0c/sdKSsOspS1no/r7x3Ng+ehputze0AN416/g5w4yNAQPPN+g+dJ61GxMI93Q9W13 VWiZHfRZFstaIdybDDAhvVAV+Vst3v9JY4mBb5gZOf0FLdXNzv9o4f9h25nz2gPEbBHo 9mJN5T80dPEX4xpAMfsC3BAdb9aJc+4v1Eime/D1uCFMmYQC99FYC0qhmbxXV9BA8PeQ Zkaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=xC+PVhCV; spf=pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.86 as permitted sender) smtp.mailfrom=darrick.wong@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from userp2130.oracle.com (userp2130.oracle.com. [156.151.31.86]) by mx.google.com with ESMTPS id 20-v6si18579995pfk.287.2018.10.17.15.45.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Oct 2018 15:45:13 -0700 (PDT) Received-SPF: pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.86 as permitted sender) client-ip=156.151.31.86; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=xC+PVhCV; spf=pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.86 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 (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9HMhlJY040059; Wed, 17 Oct 2018 22:45:11 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=EVBOjpjVeZ0uqv5Ytj51D02SOvbvYZvIxgFPH2/97ks=; b=xC+PVhCV2MUkoCriIdCTKjieFycCSlQ45RgvqEaWIXaQ2wNgkFqI/WURC6boEo8PeY9z uNzBprCxbKBWLJB+qVc5BDXluCEyunTE0FZtN6RydvxsPAhtYCatnA2SK4Rxk/UTY8Cv 2Zy3D2y9WDokefKWu2fF4/RsAl3ixgAOGUm1dcqpj9Qq6cyr8sViGrj++/mwQ7HhR+AE gveqdG6PiDNIyR++6EMlSG+kDIwBO7Z8Zy53G5iD+p24wWlIPD+Uk00rPyK1VlRCHSYc 6/X8+Oq5SIuC/sK/XCAhZMJolslhxwZNGRE0//RNYRCWuITppm598E3QeuDK2n+bkKLS Hw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2n384u9yx0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Oct 2018 22:45:11 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9HMj5MQ011933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Oct 2018 22:45:05 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9HMj5ei031599; Wed, 17 Oct 2018 22:45:05 GMT Received: from localhost (/10.159.132.177) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 17 Oct 2018 15:45:05 -0700 Subject: [PATCH 07/29] 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, Amir Goldstein , 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: Wed, 17 Oct 2018 15:45:03 -0700 Message-ID: <153981630347.5568.10618491872993138395.stgit@magnolia> In-Reply-To: <153981625504.5568.2708520119290577378.stgit@magnolia> References: <153981625504.5568.2708520119290577378.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9049 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=750 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810170188 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 Reviewed-by: Amir Goldstein --- 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 f5395d8da741..aca75a97a695 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1745,9 +1745,9 @@ static int generic_remap_check_len(struct inode *inode_in, * 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); @@ -1822,7 +1822,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 281d5f53f2ec..a7757a128a78 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -1326,7 +1326,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 ba93a6e7dac4..55729e1c2e75 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1825,9 +1825,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,