From patchwork Sun Oct 21 16:15: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: 10650995 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 B922213A9 for ; Sun, 21 Oct 2018 16:15:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A432B287C2 for ; Sun, 21 Oct 2018 16:15:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9573D287C7; Sun, 21 Oct 2018 16:15:59 +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 13C93287C2 for ; Sun, 21 Oct 2018 16:15:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 23F5E6B0266; Sun, 21 Oct 2018 12:15:58 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2151D6B026A; Sun, 21 Oct 2018 12:15: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 0B5846B026B; Sun, 21 Oct 2018 12:15:58 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by kanga.kvack.org (Postfix) with ESMTP id D37806B0266 for ; Sun, 21 Oct 2018 12:15:57 -0400 (EDT) Received: by mail-yb1-f198.google.com with SMTP id f2-v6so5926846ybo.1 for ; Sun, 21 Oct 2018 09:15:57 -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=seak5tXm0tQHJfqjATSRl+xIpqQtsLwAxMHcSJ7D5+TpeS2XnYNy+RUrE2gaYLL/lL MDX2hRxyMyOsztkK+9h7HFMUfcAF9j2TIuDfHnUCz1V6zavGIZLdlkPBIe+CigR1HaWv yAVWg8eA0eeXpmIKF+VcMOPFgdmsKK98ylft+BkDnoCZ+GARoZEgiaFyfmbydAk8KV20 X9/KDxkTZ1UjtZSg6h11g8iOZ1mjQiBExWmtfPxPxcmM7yYnz4jBNo06K30WvqpHLIvF YS6gnsZwY9TrDuJL6B22ch7W9xWP0odCY6rygApzIhBDXXqzSpnNtV7hrEowKaZBg/SN cVPw== X-Gm-Message-State: ABuFfogmOu3cBHq4U67OQbxMXSzg/xZM3IVM2od9CpTUyC58q+EaTYik Xkl1VnPuoUhk85AwjPsdoy2xmtqF6BqpqE4LSLpyNLmLnIJ4/cbaSlye7OM4P3S9U10WMLgud2E tmWvZZ7ucBIOb7wP2vyc8Xtvc4u2nFxFHm7FCuaJse8YoBQpy3QnDk1XieKiEShB3Qw== X-Received: by 2002:a81:2cc3:: with SMTP id s186-v6mr30263246yws.168.1540138557584; Sun, 21 Oct 2018 09:15:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV61P5IJSrmurUMVwFuAynUJXv6Xg8DHaiEGIY1bz1AsaJwLeK3x92iCwF+oX5y+NyP1I+hLN X-Received: by 2002:a81:2cc3:: with SMTP id s186-v6mr30263211yws.168.1540138556964; Sun, 21 Oct 2018 09:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540138556; cv=none; d=google.com; s=arc-20160816; b=fPli+Sq3h+lvfpsNGUXQ8EzOOyM6qmTeRitioyL35pvQaz5twi2VlkqwRzR55BkKrU M3CE7UMt18DA+XjNnAmLcPTlMX325FXkFyvZ1+4HIHd1fJtpe4jzZqbkwyKaKBLSu/6l Fo5phwsK6v5cnm1ekPLeyeaf79b2oO0h1HOx0Bicfv62HAzBXpmbDJJTm1SEqOiy90+c sij04kDxZINHeaZZHkQ46Q52T6X/1BZiodRBQAoIKQ8uWoWjXch34zCrGmNITcbWdkFl bxe24cOWCdh6JKT27fIptrKk9YugOpVyzTKHJ2cuybCIaEPtTzC1BoZ9wVd2U9rbf1Lt 3/Ag== 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=Ivgo03G/Ntk/pr9Cl+27yc/ISH9/cQSCtTDsDtixg6HD4kgCyj74rV1aTWZrxtOGzT ghfzizA7/cp8cuFbs47OU50an3Pegcts+9XEgz+f0OYAL00R3occzC4ZOBe5SwmAQz/I XWawlURbFGaAHYpSuK2epERUwPFjfU4EMTSyNjnHk4I0fCLT+tEZ2FIHadL5Ker9e+QY D+1ebuxhcRrTtF0wBGzbgShJp6CTh4IBoalj2+2UWSm8eUt0ngxsNTztgGCOdGAeuuZU vFpCTNHGuZ5iGtCsKjWtdV1b3iPDloXEctO7SXR6X0srcFtYz5bHzqwOjtdtaYLRowZe LUyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jjp1goek; spf=pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.85 as permitted sender) smtp.mailfrom=darrick.wong@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from userp2120.oracle.com (userp2120.oracle.com. [156.151.31.85]) by mx.google.com with ESMTPS id s9-v6si13765631ybg.344.2018.10.21.09.15.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Oct 2018 09:15:56 -0700 (PDT) Received-SPF: pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.85 as permitted sender) client-ip=156.151.31.85; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jjp1goek; spf=pass (google.com: domain of darrick.wong@oracle.com designates 156.151.31.85 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 (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9LGF9ta107440; Sun, 21 Oct 2018 16:15: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=jjp1goekmyibL+yh4EIs0el4hgqZmgMDX+/wChkYo/K9cm7WquwmJgKwfHIu8KZNQP+9 fSqI3Q0Psh7ss+Aoi85vg/nUvSAMsWldca5tCYMSLRQlzxX6Am2VkwHP0oG5SqREzDas ig1m5jdGSeWeWKyBINPywcrKc7E5LHBxekFvv1yYmtDjvcNfU9caXVF8Zojo6DGvZBc8 Cl1vud0+Ur3U6NDpMoOMnBdXyZvnmPIMkdNJ+0ILZkF09hmvzAeX1kD2uQnegDyigJ+l EK8OUSgjOeGHueXL5IQR0xKYrqWoORNh1s7R0KhTypvGYcZS6QZfHwZeDsIrBFWuOCFd nw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2n7w0qaxhj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 21 Oct 2018 16:15:54 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9LGFrr6011457 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 21 Oct 2018 16:15:53 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 w9LGFrC4024250; Sun, 21 Oct 2018 16:15:53 GMT Received: from localhost (/10.159.225.70) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 21 Oct 2018 09:15:53 -0700 Subject: [PATCH 07/28] 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: Sun, 21 Oct 2018 09:15:51 -0700 Message-ID: <154013855179.29026.12300431992865619414.stgit@magnolia> In-Reply-To: <154013850285.29026.16168387526580596209.stgit@magnolia> References: <154013850285.29026.16168387526580596209.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9053 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=749 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810210151 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,