From patchwork Thu Oct 11 04:13:21 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: 10635791 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 A3F5214DB for ; Thu, 11 Oct 2018 04:13:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88F8521BED for ; Thu, 11 Oct 2018 04:13:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A2EA25223; Thu, 11 Oct 2018 04:13:31 +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 5167D21BED for ; Thu, 11 Oct 2018 04:13:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3ACF66B027A; Thu, 11 Oct 2018 00:13:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 35BEE6B027B; Thu, 11 Oct 2018 00:13:29 -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 2264F6B027C; Thu, 11 Oct 2018 00:13:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by kanga.kvack.org (Postfix) with ESMTP id ED1AD6B027A for ; Thu, 11 Oct 2018 00:13:28 -0400 (EDT) Received: by mail-qk1-f199.google.com with SMTP id f81-v6so7167523qkb.14 for ; Wed, 10 Oct 2018 21:13:28 -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=FPeyuRN3Xjx63rLkII3YE0NweIY+TcOwDUsAkW8yb78=; b=oGy7I1oeCME4KgcfmPDZlP55BD7UD1vKwd/XSYdcTrFS1uCAv35YgqA6SYXqm2Ct+Q 5KhGmoZwcL2AHOCQ8N9ryEkL/KslIjCOv9DeuGYmd7bFhi/etKiy1UHmOWWYoRFPWENO PkIosJU/VXDKy8P9cqL+ArqkqUSQVRztzoHLITUUlx87Vtv69JtY3rqUKj6C9PIjJQ82 zoSyhSAOtebsFS4pbvg9Jn4OCGFyn8ADlf1zB6UGeuxXzuGnavM2g4DXLeRt9hRLscx+ EIv5+6Gb+uVt5WOjojHZUogQ8DW0sgYUfYEHirgqLP0cgrsaUfCrNc+M+vY4JczyOZOC 1I7g== X-Gm-Message-State: ABuFfogqMBjj8qXx7JVTpVt81M+U7r839T1mUVhSpF565yf1bm95Civ5 fhR8dtwXHjcvQ72zmfcjSvkqmKoPgiulGcXhqvlkcHI/0TlpuvPa8VqMtJ1O6U9WgBlEMQXAq03 qd6OG9ePw0VA8u4mZbrcTDJDN8YdgCXeuxB8YEy0a+edF1biOpSC8ZxUrZK9F7RvxQw== X-Received: by 2002:ac8:3829:: with SMTP id q38-v6mr28804157qtb.91.1539231208746; Wed, 10 Oct 2018 21:13:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV61SiCO1YUZn8tC//t2dNGlGXFhahySsBM+TyTHFA3q7FA22xQB0kOSuMbaOqdAPQbZwKCkJ X-Received: by 2002:ac8:3829:: with SMTP id q38-v6mr28804141qtb.91.1539231208142; Wed, 10 Oct 2018 21:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539231208; cv=none; d=google.com; s=arc-20160816; b=MWDvu44Ddt0e/L6cATs52dyMQNdlCn2LDrE0GLn0wRbYpp72G1fmA/IRwvpUJIz5lm 4OQHSTOBijrRHoOSLXlJyh6DZpa2Q2uM/eruNYkZF8Yh0wzVvrJq4apeJF64CT2GdmeI 0PHC/FN8GS42VDl8gIIaSJTL3rGYlYmOjqXgG3J73/h1ZlvWVEsmtijGmW+kjVGPqZcC z+asKtrRirMdnYV5vlgDBBdmzv8M9rpibqGBFoudJE91f6KmmrjsVlzIv4ksq5m7QzDM U0vFmfBEmu8h1ilMlSxn8nt2l65Mm72chv6nhcgdQxf1zZEsxHylUbkhZrm5F3yrF1Cq rXBQ== 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=FPeyuRN3Xjx63rLkII3YE0NweIY+TcOwDUsAkW8yb78=; b=VGipzcRosuZ2qryu9clnOR0Yi7hU0Jj/rI2I2RGM5ohycRdevO4eY2W9/2tn5X6TVm z0ds3Z8vc9ippsOS1WLEAtUIUg5GDhv4Wa4fGjHMMw9+TLHF5Rx5h7c8Ana7OhcogV9D cIJR40oSgrpVPZBfNxXfJW/+AtpXAw9Td7Gx9IyihWdC5pDoy8di+s9iSqOCp94xrL07 4cao1XGAVvtQLeMcK12D6sHUXT3YKjhcEDshIktomU0qKHpuhrqrpGFZ0UVwa7/VidtT hBFkwSC3ZJSUgREz13M4bLxI9iBwWENMNUojg9bvp2U40unHJgJQuOqcmWGyqUBsnCxR EB0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="vHt/OMIm"; 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 39-v6si4346073qky.25.2018.10.10.21.13.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 21:13:28 -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="vHt/OMIm"; 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 w9B4971Z052718; Thu, 11 Oct 2018 04:13:25 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=FPeyuRN3Xjx63rLkII3YE0NweIY+TcOwDUsAkW8yb78=; b=vHt/OMImYZNFqmc1YloKKq39j03qykjhaz+ANO3Scb1JXvu1NqtJ0axxLs4HpEnSU1aM 8dW6kWKPz8Ph1xjKoTKOSdLluhhfZeYchTm70UH7R8lJEQPrIxEy2becj5963c/YVHWK sAjhWUs3ul3LUZbulmsI/UkixErrWgXEDNDxevRATFy7YrtP4bzgKqaCcYrbYHtQnAsY zm+MCPWVlVqunY9OiJUQzq8qSTHxA1voVe8IqN81FlyUXUHi1/YfYMavsXRW+E5DIhzB f/fIUqH58zlKJqah8gWCHaHN7JUyuvhxyy/1kKXf6KF8HRVU85ORB6t+TA0bZ/0t6Kls Tg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2mxn0q9dvs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Oct 2018 04:13:25 +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 w9B4DNnR019610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Oct 2018 04:13:24 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9B4DN2F008757; Thu, 11 Oct 2018 04:13:23 GMT Received: from localhost (/10.159.132.249) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Oct 2018 04:13:23 +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: Wed, 10 Oct 2018 21:13:21 -0700 Message-ID: <153923120146.5546.12819462933063012193.stgit@magnolia> In-Reply-To: <153923113649.5546.9840926895953408273.stgit@magnolia> References: <153923113649.5546.9840926895953408273.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9042 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-1810110039 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 4d6855671bf3..ebf62ffca57b 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); @@ -1809,7 +1809,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,