From patchwork Thu Oct 15 00:31:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11838321 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5750F14B2 for ; Thu, 15 Oct 2020 00:31:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C9CCD22244 for ; Thu, 15 Oct 2020 00:31:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="c5JKROgL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9CCD22244 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C12966B0062; Wed, 14 Oct 2020 20:31:20 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BC2806B0068; Wed, 14 Oct 2020 20:31:20 -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 AB0B86B006E; Wed, 14 Oct 2020 20:31:20 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0143.hostedemail.com [216.40.44.143]) by kanga.kvack.org (Postfix) with ESMTP id 7B4056B0062 for ; Wed, 14 Oct 2020 20:31:20 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 12F10181AC9CC for ; Thu, 15 Oct 2020 00:31:20 +0000 (UTC) X-FDA: 77372280720.08.sea67_5316b5827210 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id E49481819E766 for ; Thu, 15 Oct 2020 00:31:19 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,darrick.wong@oracle.com,,RULES_HIT:30012:30054:30064:30091,0,RBL:156.151.31.85:@oracle.com:.lbl8.mailshell.net-62.18.0.100 64.10.201.10;04y8bw8c11zw7wry8bjs1eenifcuoycxcg449mg8w6zn8mbc34rxoxjw6muipxz.araxw1i31daqmbyheqg9cowk7zp5wx1fnffo8uhj8134y8knihzaoc36xxtqbst.k-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:31,LUA_SUMMARY:none X-HE-Tag: sea67_5316b5827210 X-Filterd-Recvd-Size: 5404 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Thu, 15 Oct 2020 00:31:19 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09F0VIn2057469; Thu, 15 Oct 2020 00:31:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=Y8qiMhy/TtMb2QqybxDtEswQihoXnMGkdNPr8ht3+QI=; b=c5JKROgL5I9Uys/T0AKfNyjlPFIob2PLlL42IJ931DvFIJ5uJl0JrDSW/RztEm5LotNT dnjzKXRmqM8oWvf/ztAWG5YE1NQOtZdv1nMjicovdD5e5X4TvsOvN+4PAdExAjnzlatb MleMyS7Of4leuhdXljneGoYwH88kMLuT4GqUpZQiaW2gTKxPdXWw++LWr0qptGrJJmhR sfdBSxVgtpTh6F7d6tGsr14BHCCYBeiWzMQwYpVhbEAnUcORCsKSKC3B9oQVHTBMih9I +gVyNUjrD/4GH5uusHjWJUEuowb4gKXdbGTQA3ZTW/vc0Hf5JBJil1cD+ZD99H7j0mpD WA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 343vaegmrp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Oct 2020 00:31:18 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09F0TiwR123312; Thu, 15 Oct 2020 00:31:17 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 343phqb09a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Oct 2020 00:31:17 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09F0VGQU017266; Thu, 15 Oct 2020 00:31:16 GMT Received: from localhost (/10.159.142.84) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Oct 2020 17:31:16 -0700 Subject: [PATCH 0/2] vfs: move the clone/dedupe/remap helpers to a single file From: "Darrick J. Wong" To: darrick.wong@oracle.com, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, torvalds@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Date: Wed, 14 Oct 2020 17:31:14 -0700 Message-ID: <160272187483.913987.4254237066433242737.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150001 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 clxscore=1015 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150001 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: Hi all, I would like to move the generic helper functions that support the file remap range operations (aka clone and dedupe) to a separate file under fs/. For the moment, I have a few goals here: one is to declutter fs/read_write.c and mm/filemap.c. The second goal is to be able to deselect all the remap code if no filesystems require it. The third (and much more long term) goal is to have a place to land the generic code for the atomic file extent swap functionality, since it will reuse some of the functionality. Someday. Whenever I get around to submitting that again. AFAICT, nobody is attempting to land any major changes in any of the vfs remap functions during the 5.10 window -- for-next showed conflicts only in the Makefile, so it seems like a quiet enough time to do this. There are no functional changes here, it's just moving code blocks around. So, I have a few questions, particularly for Al, Andrew, and Linus: (1) Do you find this reorganizing acceptable? (2) I was planning to rebase this series next Friday and try to throw it in at the end of the merge window; is that ok? (The current patches are based on 5.9, and applying them manually to current master and for-next didn't show any new conflicts.) (3) Can I just grab the copyrights from mm/filemap.c? Or fs/read_write.c? Or something entirely different? If you're going to start using this mess, you probably ought to just pull from my git trees, which are linked below. This is an extraordinary way to destroy everything. Enjoy! Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=vfs-rearrange-remap-helpers --- fs/Makefile | 3 fs/read_write.c | 473 ------------------------------------------- fs/remap_range.c | 577 ++++++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/fs.h | 5 mm/filemap.c | 81 ------- 5 files changed, 582 insertions(+), 557 deletions(-) create mode 100644 fs/remap_range.c