From patchwork Tue Jan 9 18:01:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 186498 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp286359dyi; Tue, 9 Jan 2024 10:04:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYXF096zziAYfbzLeMQ2SMT7r/1cNFb8964mXhx6RI/uQy2tvxya25vk+sRLLqLe3/dw+C X-Received: by 2002:a05:6808:229e:b0:3bd:3c90:1f70 with SMTP id bo30-20020a056808229e00b003bd3c901f70mr1290919oib.76.1704823465552; Tue, 09 Jan 2024 10:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704823465; cv=none; d=google.com; s=arc-20160816; b=RVI6zb33Z72BlbxSSq4fF2PJwdeopPUJJUMvwIgOrVDm5TwjxHSMekiJmwglSL932m 6crppasCl0akN+WUPO/gUgccUtoaCJInL8jDKKCLb8SroCYGdYKr8xbAS/lgagsvMqUV gNfr1Fm+SyBOq2Q3Ue+kaQGDoW3iefUkV9AE5SLphUZRmXLY7DmeSE+VKC2GOXwnGfVK vKetF1ZJMHpmR9euG68CnumdbE7XCPKl4KMnbWe8ObqO4bOsUHzsOos3qY2BwFKR+pRz 7IRDdjBWd7wohJNijg1xCBbOaCQUcip3C35dZ0EYt0nf32u2OHAb2YiiwbW4RYhJZ9Fz 27uA== 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:dkim-signature; bh=7Xf1sEICUh1u9jN2O9W9Y+tFVYV24JiIia24sIupeow=; fh=7XFl5BWf++B7gqC2nwdA1vswDuQtYm8daAuHT226Q+A=; b=uW2Iff6O6qheUGaouZH/e/Cx0B7q68omhXKFQoB9SOu46+/7ce8gLisIcXvauqOIUs TT+ysBpJ3IYfu15nA4Mckb8x5mJ3+Jds8QqXPBV/Mv1X9zp3tkWqbH5bHawB6+bAL9GM YmBL3LWIwm/khjZYqvdMpiZ2VENBYRoKuqKX6uIixfd9wIOk83or5GUeYlivio/t7QcH 7BFxp7XY7qt4DJXsfqfjy3gzpfWX5MdUstFhoBCRQuYFomUB/NvkuPfKbCHf7/n22nLi hftjzFyC7vlFXcSNomIUfi9kWWmmPlt4on8Bh5L3mBh9Dg8HzUZI46RhlQRZp4ksM6+Y mw0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Tw6dJz05; spf=pass (google.com: domain of linux-kernel+bounces-21209-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21209-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n28-20020a05680803bc00b003bc37ee0f53si742951oie.34.2024.01.09.10.04.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 10:04:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21209-ouuuleilei=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=@redhat.com header.s=mimecast20190719 header.b=Tw6dJz05; spf=pass (google.com: domain of linux-kernel+bounces-21209-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21209-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3539E287E75 for ; Tue, 9 Jan 2024 18:04:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC6243D971; Tue, 9 Jan 2024 18:01:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Tw6dJz05" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 C53243BB30 for ; Tue, 9 Jan 2024 18:01:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704823307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Xf1sEICUh1u9jN2O9W9Y+tFVYV24JiIia24sIupeow=; b=Tw6dJz05elh+Lvaa8nVOcMIoctIlQOvCuMw3WeB1SNshGBnzhkHJlRIceru0jkiGxh3oBJ 8cr+OZ1nIxRQdIXxdJfL6sZcxaEZgyWaO4kejxVQK/oIH+qdmMrB6rMUigqcfH/0KdK84B wfr5bl6Jjnach8SwVsexZtqMwKufxUc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-208-RosHVIG7NrOQHYngSPvMtw-1; Tue, 09 Jan 2024 13:01:43 -0500 X-MC-Unique: RosHVIG7NrOQHYngSPvMtw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0453E83BA8F; Tue, 9 Jan 2024 18:01:37 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C42D5012; Tue, 9 Jan 2024 18:01:33 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu Subject: [PATCH 3/4] erofs: Don't use certain internal folio_*() functions Date: Tue, 9 Jan 2024 18:01:14 +0000 Message-ID: <20240109180117.1669008-4-dhowells@redhat.com> In-Reply-To: <20240109180117.1669008-1-dhowells@redhat.com> References: <20240109180117.1669008-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787636970547289014 X-GMAIL-MSGID: 1787636970547289014 Filesystems should not be using folio->index not folio_index(folio) and folio->mapping, not folio_mapping() or folio_file_mapping() in filesystem code. 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 cc: Gao Xiang cc: Chao Yu cc: Yue Hu cc: Jeffle Xu cc: linux-erofs@lists.ozlabs.org cc: linux-fsdevel@vger.kernel.org --- 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);