From patchwork Tue Oct 16 03:10:51 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: 10642777 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 497B018FD for ; Tue, 16 Oct 2018 03:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36D6A29883 for ; Tue, 16 Oct 2018 03:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B47C298A3; Tue, 16 Oct 2018 03:11:00 +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 A278329883 for ; Tue, 16 Oct 2018 03:10:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 753FF6B026E; Mon, 15 Oct 2018 23:10:58 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 703846B026F; Mon, 15 Oct 2018 23:10:58 -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 5A6556B0271; Mon, 15 Oct 2018 23:10:58 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id 18F196B026E for ; Mon, 15 Oct 2018 23:10:58 -0400 (EDT) Received: by mail-pl1-f198.google.com with SMTP id t9-v6so17129196plq.15 for ; Mon, 15 Oct 2018 20:10:58 -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=lb4U9fh0/T25nnlP14YW6fUPBNu2o4N8MviaQslmg/dlkR5bGUp7P9QwADch+iwSwF y1Fwe2q4s3s2osKskqtXm2Ks7DGRmtkJCW9tpevW78dAxhBcRHoJNxIcThI/3XQ/5tE9 AyIAgf1L7NOtUF5cwA7EDLXzoPb4R9y/tF4rBfB6rwuCYiA76s17QtXeJKlIL7nijL7c 5yZ/WDgN16a0tjTSMmBNZSG6133ISVSw1A58NlVHrGEPhzcy7UwkaoF2rJZ8QnBqN70S 7oIudSJXpOmpQOIl/x2xjr3EwJRbek47tWZA6/dg+4Nb4CVvtkeCsgeeg5H7vcgcmNGn c9+w== X-Gm-Message-State: ABuFfojBlbFcvHEKkMCS5P3Y8b5CoD1+p5iw9lM41wUYhVdbSalnKJ02 SdtMVckNRGl8RDFdyEpzix1KnGSUk/uL7EFsMZnDcf9f5RiIO2f0fdS2AGT2+AK7xZHAsHVNMQq NJb2hVcTLtfsauiQygrX7cUiQRrc0Dmq5c90LoZjpdHV0NmJC+IjwUoHeJUdYSvFN5A== X-Received: by 2002:a17:902:aa48:: with SMTP id c8-v6mr20092549plr.100.1539659457764; Mon, 15 Oct 2018 20:10:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV62B2852cXyWov04gnhehM1K+KKhQOAWSysErgpGfhRKRuprQVDiVb6svHvOPfTA29MlORF+ X-Received: by 2002:a17:902:aa48:: with SMTP id c8-v6mr20092512plr.100.1539659456992; Mon, 15 Oct 2018 20:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539659456; cv=none; d=google.com; s=arc-20160816; b=wYxlH04ozJKOq1Z4SI9VJOaXPe7lWd6YbHS2qtLAsjyCokJ9QqW1DQ/0uQy0uL8Rgf 1NAlpoOcsyk0xJ5kCruXRhDNbYoRfzlPeP7b+rYII6tlfguhKpC+b7z5EX6KCZ8CUrjh oD84xoGaJGeXzMTVa0xOo4CF9bko8sG/9pEucx/IYENUBUoR1P/iwWyXTj3mWEfSPwhp ynhvxzvSC7sBhSznsk403RR4dCcHBg/xn4bMJcseXG4uGIizisYizbPnH0JnhvinVEjg VaRAlE3D2W5uurUFi1ds5V1wYuXSZNcCgpDo72/xBqtZ6DD29hscZmE2651x03k4fAK3 YiVA== 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=Ic3b5siOJVrCeYvflaBh1yRbLHeK6jaAQj44zvTDJeTz7tOOcPqzQxA6XKYhFroNs2 QyuSHojp1kjMjquCD5DmFKzEVKOo2zKpKi3YNHilgoMtxpOql5oUsfEYbYXKbv6m8kyw S9j80Z8v4hSuRRbhDdLa2zPgzmrMz1J6cY3u2okI781VCfmVak4LABiTOND0oFiZim1j /EyZoEniW9tWv28j4+AG1pSiB5nnx4gHaya3bsH9CdOrMfoVrNp/fQtFOKMbO//dOmJL O6o30x6syKu5zKfX+xyjnjWc0Gp0yDWodpLp5D+eIKzlbiy5ZNd5uZqpG4jP3dD5+wy7 Rn6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jehnLmBx; 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 e10-v6si11793983pgo.44.2018.10.15.20.10.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 20:10:56 -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=jehnLmBx; 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 w9G38Tv9053326; Tue, 16 Oct 2018 03:10:54 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=jehnLmBx9h/7vq0UO4WgR2MkYmrq915VuGIZ8013Avw2TsIpgewmlhzaqsXrS4A6rBnw ogfQgWOGOIQMaGJ186mIkeXhFNx6gzH/YnLd/wxcp8bXAyJBI7kshemk6BqWKYw8wUXI nmGmWDc3EWSe9miPvwWqNBUG/Fqrgy60NwTCCYnVyhfYDVDJZVGA3K4A1NHCdekHxX+4 a01Sf7B0oYVhJJklddBRYYU467Uh5uyzkNQuKaNRoZr5te4HgcV4wxBp+ebTRa23QWpM pPq4guHllomumVZhSSkzaK958rzXIjHzm8c8Bq7HU3DoG7Ydwo9DBzrTqQiE1pf/OxsB jg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2n38npwuwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 03:10:54 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9G3ArwQ012025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 03:10:54 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9G3Arr4009185; Tue, 16 Oct 2018 03:10:53 GMT Received: from localhost (/10.159.227.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Oct 2018 20:10:52 -0700 Subject: [PATCH 08/26] 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: Mon, 15 Oct 2018 20:10:51 -0700 Message-ID: <153965945139.1256.17779918536496926662.stgit@magnolia> In-Reply-To: <153965939489.1256.7400115244528045860.stgit@magnolia> References: <153965939489.1256.7400115244528045860.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9047 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=747 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810160026 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,