Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp551690rdb; Mon, 15 Jan 2024 06:07:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVja4S263T1mVqjhBYjG7/6aaTKpFXl/cw0AlD9RRO4P/jnqmYGXG3lSV//14VANB4D1mu X-Received: by 2002:a05:6e02:1688:b0:35f:f11b:c41e with SMTP id f8-20020a056e02168800b0035ff11bc41emr10049803ila.1.1705327620989; Mon, 15 Jan 2024 06:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705327620; cv=none; d=google.com; s=arc-20160816; b=AvejdREX62WblBwb0y9PvFiRNOM/gXX1O/UtIsd8B7/rwEn2csEEbMlqPTriP5f/Wr Qr/svRC7F7tVn+PcLxsL7nJZzSBbKmJPsignoIsBmk2sgCSxTkhk7q/6QiNBtMAK/Ggg Xx2I6R5u6nOKqwG/XboKZCUQjhxVV0AHhVXu2i4pv79lSlZNwJxgb0A5k9X8B794NO8W TPUSVZcAYnSEV3TAcaRjOSTqdcJd0H1aId7CPvlJSMN7pxYRIkVtjfiKV8Me5EsnBzpN RuPruT3ywoLVWRUKT6VTXvxn11+sBCOLDoC/fJduzAgNFzcIecPNYsYlxvRa+OZ8jOiM Mq0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=k+DYOQ+yWRd2pgMIRz/5wGINWA2P7yC/o6J+Q7W5b70=; fh=39S0oMDhn2FTIH+q8DQeqTev+QXn+LZogv9P7TeYLxs=; b=Q/j9j6LD5CmbPXnOksqwpm+XChJhjo6R49xqyVXIg+BurWSMrm4AbGsHo7KmK+7yae 6XV4ceE7VEDqTprJFOSMcBoFXSGKXuMh0Xfzto1aRJC+9D4U9I9Qk8Yi+4FQoWoha/zv 9Og+NnYyVdHhtM6i0LLgeF7RQ2jajlpVaTEPIU4/S+4fkKBiqXUVh4KuHsiRqU5ITSmO 9hQ+ePH3opuMyY4IFfwD/aaPwRs7QhFsfcxaAl/xYm4flhDjFTz5ijT4xhv4RvMJ4yeq yfDmx7SvfWot2oKj7OzjyvQagXx9sGgG6paikyadV/DCav/a0sJqQjxTMKgO/7CztCNs qoXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vATJg++B; spf=pass (google.com: domain of linux-kernel+bounces-26071-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26071-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s5-20020a656445000000b005ca5b61ca25si8859951pgv.233.2024.01.15.06.07.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 06:07:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26071-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vATJg++B; spf=pass (google.com: domain of linux-kernel+bounces-26071-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26071-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 58409282391 for ; Mon, 15 Jan 2024 14:07:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4A0D17594; Mon, 15 Jan 2024 14:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vATJg++B" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B97FA17584; Mon, 15 Jan 2024 14:06:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=k+DYOQ+yWRd2pgMIRz/5wGINWA2P7yC/o6J+Q7W5b70=; b=vATJg++BpawwIU6E3l3nCyM/fl CR1jGpmQB/8Vq7OxY1+wQ2R/Hf3ne8n0WN2AvXfif1DigL2m2rVPRPfBIGHsnUly6m2P18LQsHeeE pv+B6kcZ03YpFkpKUaN87vnGX7uiFbMHtRfudt/fZlAfUY3gjxMPFrspblYKei4oeLsyxJS6XNYy4 LqB76AJULX5LYDl+H6w6rAl7am/wUSRx0JzXHryKNdYAP90XSPckLxOj9SUfy7eZIE7Kyi9Iei+Yr r2XvhpG935/rETqKfQZjY4lEZGAuxuj/0flXZIbbrxN+farXylvZfJ9RJiRByx9wkGofpA3ZAue1Z aDzeDz7g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rPNbh-009rfH-Cs; Mon, 15 Jan 2024 14:06:29 +0000 Date: Mon, 15 Jan 2024 14:06:29 +0000 From: Matthew Wilcox To: Gao Xiang Cc: linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, David Howells , Christian Brauner , Jeff Layton , LKML , Chao Yu , Yue Hu , Jeffle Xu Subject: Re: [PATCH v2 3/4] erofs: Don't use certain internal folio_*() functions Message-ID: References: <20240115083337.1355191-1-hsiangkao@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240115083337.1355191-1-hsiangkao@linux.alibaba.com> On Mon, Jan 15, 2024 at 04:33:37PM +0800, Gao Xiang wrote: > From: David Howells > > Filesystems should use folio->index and folio->mapping, instead of > folio_index(folio), folio_mapping() and folio_file_mapping() since > they know that it's in the pagecache. > > Change this automagically with: > > perl -p -i -e 's/folio_mapping[(]([^)]*)[)]/\1->mapping/g' fs/erofs/*.c > perl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g' fs/erofs/*.c > perl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g' fs/erofs/*.c > > Reported-by: Matthew Wilcox > Signed-off-by: David Howells > Reviewed-by: Jeff Layton > Cc: Chao Yu > Cc: Yue Hu > Cc: Jeffle Xu > Cc: linux-erofs@lists.ozlabs.org > Cc: linux-fsdevel@vger.kernel.org > Signed-off-by: Gao Xiang > --- > Hi folks, > > I tend to apply this patch upstream since compressed data fscache > adaption touches this part too. If there is no objection, I'm > going to take this patch separately for -next shortly.. Could you change the subject? It's not that the functions are "internal", it's that filesystems don't need to use them because they're guaranteed to not see swap pages. Maybe just s/internal/unnecessary/ > Thanks, > Gao Xiang > > Change since v1: > - a better commit message pointed out by Jeff Layton. > > fs/erofs/fscache.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c > index 87ff35bff8d5..bc12030393b2 100644 > --- a/fs/erofs/fscache.c > +++ b/fs/erofs/fscache.c > @@ -165,10 +165,10 @@ static int erofs_fscache_read_folios_async(struct fscache_cookie *cookie, > static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio) > { > int ret; > - struct erofs_fscache *ctx = folio_mapping(folio)->host->i_private; > + struct erofs_fscache *ctx = folio->mapping->host->i_private; > struct erofs_fscache_request *req; > > - req = erofs_fscache_req_alloc(folio_mapping(folio), > + req = erofs_fscache_req_alloc(folio->mapping, > folio_pos(folio), folio_size(folio)); > if (IS_ERR(req)) { > folio_unlock(folio); > @@ -276,7 +276,7 @@ static int erofs_fscache_read_folio(struct file *file, struct folio *folio) > struct erofs_fscache_request *req; > int ret; > > - req = erofs_fscache_req_alloc(folio_mapping(folio), > + req = erofs_fscache_req_alloc(folio->mapping, > folio_pos(folio), folio_size(folio)); > if (IS_ERR(req)) { > folio_unlock(folio); > -- > 2.39.3 >