From patchwork Sat Oct 13 00:06:38 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: 10639503 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 7945A1869 for ; Sat, 13 Oct 2018 00:06:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6612A2B79F for ; Sat, 13 Oct 2018 00:06:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 597432B78F; Sat, 13 Oct 2018 00:06:51 +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 C56CB2B78F for ; Sat, 13 Oct 2018 00:06:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A26FF6B0271; Fri, 12 Oct 2018 20:06:49 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9FE8B6B0272; Fri, 12 Oct 2018 20:06:49 -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 8ED996B0273; Fri, 12 Oct 2018 20:06:49 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id 643D36B0271 for ; Fri, 12 Oct 2018 20:06:49 -0400 (EDT) Received: by mail-qt1-f200.google.com with SMTP id d52-v6so13963791qta.9 for ; Fri, 12 Oct 2018 17:06:49 -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=RBiUtJQJTFjVx5Jsi2oXpat+Xjxoo1AZnkNlS024TVM=; b=MNjyXfsQAzNMXBPYBiZaH7V7gks1hO1ftgJKVH5cswSgSQ6cDsPfJWDNcjNnL+Z3v7 rWID7raX6T98df7J7stRIkxyE4zjEDA6mEuEhn4sTUGXYWQklWscOR05e9D2hO/Z9Pdg JfuF3Ss/YQcxHIuz6sDEGb8ryToI+KT+YRgY9iqOVuHEWG+sn8WXkDgIWUNtDEsnWgLL MPLT+QnXQ5ijw49wJuMAJ+PY4JTnrR7lcVgKuQ92QrBYqCCqhdhmJzlrZ9Mx01gg34X4 Jg5Bl8OPH4c5TpYyYWBQGBomaoRiUBFdjwcs46eE8MKQAr6VQC/hQHB/1xLNdzcQBWFP 1umg== X-Gm-Message-State: ABuFfohHDTEXGO1BVPVdBdN2cJrYNgT+qEctKBl7bH/OAfT20o7SmkBH IE513ZlairYehpKeDT4OghLDAego02Kf7PFXqPOrx030Plys10dz48VHfKkmYNMdbFKCTFHkcdg CzVePnJPdJg6+bdLw40dxyHPQ66YaiFntpRXPMduERtH1Nhsm/WzRQ/wpn+pmu+Ba4g== X-Received: by 2002:a37:ef08:: with SMTP id j8-v6mr8037361qkk.26.1539389209177; Fri, 12 Oct 2018 17:06:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV60uUibnfTboe5OszVvkGJqMl7GJA+iMILUkZ6qufVtixnLAUL+USniMoO2N9NBobL+r2KS1 X-Received: by 2002:a37:ef08:: with SMTP id j8-v6mr8037340qkk.26.1539389208597; Fri, 12 Oct 2018 17:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539389208; cv=none; d=google.com; s=arc-20160816; b=K0E0zJSnYJ4Msmuw6jcX1Ro2d3Ueha57jmLDWWTw7Wm7/fII1hzy60lZdaTQlBu3OL S1xOMck/KsQW5miV06rTEpWzN/f3b7fkCOaB2Jv5/3xI5pGVVKFr2HP/OMMwSHNwURsJ f/ti/OGfoF1o1GPXvMPPeqxDKl5Y+yy1FyOVS6/lsGq7kVQu7ypNBoa1kMduC+Kn/oTq H6A2AB6czvbfu6nPoKoLQeoBTmVsn4tK8waOMKPmL94e3VzUImATL1w4Kt5zpXT+KAUb BEMe8GCgMWQAnuHbWZMopLwpFGov993PRXRuhHEtLQhSjSqNx0nQcUg5YfQcW+BUvMM4 +oTw== 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=RBiUtJQJTFjVx5Jsi2oXpat+Xjxoo1AZnkNlS024TVM=; b=Jb9aMNcAab/htiICgfp5JdLxuT2TCXu8NQhk70lhX+xRtevOVnL0ZOm6GzxoGPfoa4 ZPyv47sM61ScXD7+HD6ZE7WMc6uGfudIpwQIHfpisk9MynV2Odxmgf/lgIiubsRQHFkE sYzM+CYM/ek5f+2mPqYxG4riKyN9vNePTqjOjckWEvnsJbt0ksMd3edGEAcvLW1mo3ch Sre24oca7+1qo4WeZC6eyo0+SUbg78cGnlufMthOj925/vjUWZuFR4yywLAEe80K5EEZ BG5dcbdXqxhqBfJaNAZzDo0pVk/nLa2f3lzmV4KH4j6Jr1DI0uKMcgkTrxQsYYpDMYNO nyvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=d0KLJhFJ; 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 13si2452566qvo.211.2018.10.12.17.06.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 17:06:48 -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=d0KLJhFJ; 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 w9D0473N163230; Sat, 13 Oct 2018 00:06:46 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=RBiUtJQJTFjVx5Jsi2oXpat+Xjxoo1AZnkNlS024TVM=; b=d0KLJhFJqZ1bEFCZ28T0Hyc0NnV4V3cFyWAvt3zBczVgdO4xPl7Rc2K6QDduEw6y+4rn uGo+cAzrGlMDNbZc1mCySkK3JtpRld9Bddzn1dkqTS8tmDnwv6X60BFaH7QYIKG6WP1S bHe0UjEE6UhTfoxmd4nPHf1LwRxZVH4p6OHVaxQCZhVshyipGxOsFZSxqT7SYdWmb/Ay LgHQw5bzXI7QlcMaRnVfex+1zvUOOXy7r3v15+PqKxMI1ptU9VEOedoCMDY1jOWOr3E3 ry6t529e7MV4E4iMrEZs49k/u6ipKvW6MYvAiaXT/MLqqJDSd/b6zPqCsxTBIiZdm7mu Ew== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2mxn0qnme5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Oct 2018 00:06:46 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9D06emt002301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Oct 2018 00:06:40 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9D06eKl019410; Sat, 13 Oct 2018 00:06:40 GMT Received: from localhost (/10.159.251.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 13 Oct 2018 00:06:39 +0000 Subject: [PATCH 08/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, 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: Fri, 12 Oct 2018 17:06:38 -0700 Message-ID: <153938919824.8361.6077145801942639742.stgit@magnolia> In-Reply-To: <153938912912.8361.13446310416406388958.stgit@magnolia> References: <153938912912.8361.13446310416406388958.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9044 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=781 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810130000 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 fd3fe05060a4..65285524e4c3 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); @@ -1804,7 +1804,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 11fe36576d34..686905be04c0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1844,9 +1844,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,