Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp403861rdb; Mon, 15 Jan 2024 00:35:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IH90zlb7y84xLTJXvFcviJlBN6HbK609o23raIGO1BPe0prDNg12aDuv0ZuRpVckIXwjtRe X-Received: by 2002:a05:620a:2489:b0:783:3b4a:b55b with SMTP id i9-20020a05620a248900b007833b4ab55bmr7924972qkn.53.1705307715640; Mon, 15 Jan 2024 00:35:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705307715; cv=none; d=google.com; s=arc-20160816; b=RBNtFTNSoTooUQmTlKSbUWloYixQRTaslAF9H1GLvE/4TnNtTgJ4m242Znd+IybVy8 x0xV5AHRlMVROjwCQoD6IkV2yb3odXpKhnxse8oPpDobijV3hCbrsqoreYhOGI0FU+jy 6k5x/8Lhocit/KJX+GH20j0y7CzAlkT7UrvKkrQy+M0sNEOG34Jy5TocJDs1xFk6P0RA hUH8t+rhnzVtBqyT837J51omVog3pe1iWTu9AzqT+kLlx6D2wRrf1IuTg69R1BHIg8zd B37oIq/Cd3Ub9ptGBShbL74qkpBErVlGVxPO1R3RO9uTEBc8DM1C6j2GeUIrOxDh36Bv ysEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=/y/yzL8tML/pf3ry6uK+QziwiYPOWOXTZCXt4B4L3BQ=; fh=o2uHjugiPjB58XdARDWJKl3FTaqNvXZ1kJ/rwPVuIMM=; b=tZlkufq4csu/t9JLAHtu+7iZIvii9yUonk9onr4cTGHphDKwX62JWx7YoKT3PtJZ7d Pcnwpad5Ph2aBZL1Mp5j3Xd14VecgtNYK3WgljKuXgv7dxCQ/LOMj/LxUjxOG4YXIWxv CVi5xMKFFDJ8sPs1j8RXyNre4geB2w5dq60bjM05YSZr32VjLo7/cFp0rYik40MsIDew ZDkO4rhfBNenJf2ErmlwtP5FviEXWPlIrtVdYwMrz/CcqlBPfBF/iV0XTriMoIE5w4yO 5VuKZ3wqM9Rw3HG/H/L0WC5ERQQxP1AuARUoHNV80QnR2tGHnc1kJy8uelYXSMCi/hCG TC3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25738-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k14-20020a05620a07ee00b007833e3ec63fsi7339818qkk.172.2024.01.15.00.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 00:35:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25738-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 659C81C20845 for ; Mon, 15 Jan 2024 08:35:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85A5363DA; Mon, 15 Jan 2024 08:35:09 +0000 (UTC) Received: from out199-10.us.a.mail.aliyun.com (out199-10.us.a.mail.aliyun.com [47.90.199.10]) (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 B7B28256A; Mon, 15 Jan 2024 08:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R401e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0W-eSTCt_1705307687; Received: from e69b19392.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0W-eSTCt_1705307687) by smtp.aliyun-inc.com; Mon, 15 Jan 2024 16:34:48 +0800 From: Gao Xiang To: linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, David Howells , Christian Brauner , Jeff Layton Cc: LKML , Matthew Wilcox , Chao Yu , Yue Hu , Jeffle Xu , Gao Xiang Subject: [PATCH v2 3/4] erofs: Don't use certain internal folio_*() functions Date: Mon, 15 Jan 2024 16:34:45 +0800 Message-Id: <20240115083445.1356899-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240109180117.1669008-4-dhowells@redhat.com> References: <20240109180117.1669008-4-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.. 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