Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp487960rdd; Tue, 9 Jan 2024 10:03:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHesR3Azc+BxWmpuTA3KmyKZ2h0FfRx5Dr1r6ZCnHkfeGuEGFHZCg8o9XsgKcmy+LMW6flA X-Received: by 2002:a2e:7c03:0:b0:2cd:c2c:1c5 with SMTP id x3-20020a2e7c03000000b002cd0c2c01c5mr1167765ljc.158.1704823399848; Tue, 09 Jan 2024 10:03:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704823399; cv=none; d=google.com; s=arc-20160816; b=tAhCzmkyFkDORTFoWDSJjupAzybKiiMwdJ6rruwr+c2mFyOom8a7yRui06aytc5f34 yJ4xNRkgMm8JO11foCpRVI7b9BDbMmubMMMpgQ+SbhvOokEbyWcMZV9l7xJgl0AZmv42 l7TbnSPabj5hfckm90ZkD7JKd2NPd1XNaLqo3P3pWOjjwpjsDYuQEG6ytM01i3a9RO5z NEiHp7iwXUm6kJ/BwO3xPuDoQisX5sal8Wo0mwpWjRwY7jENQK+uivWM+IA2qG1N0ya7 ek7CavafL1C5OQsHU2eDzWwL8vndf2rHiislKUJMMzcgZJCba6Mkk1bcLbPehM61K9uw wS/A== 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=e4MRJOyXPjbNk2hR0Bl18LltS/kUEDv+XACveM0IT3M=; fh=wHeWnRAPvg2xJ56RgmOMhm93PiD0Bj1H5ZiEjecP7fw=; b=uI9lESHr3E4R49avzF9GLHHhphn6fdXGyTdL0NnyRqF3MHdEztLzB8NoYsxEaDd2uh JwdP/4txkV7nngUIGkvoyVKUv9FZcPob6jyeiv5i4Hp6y6VVLEfYnkQG3NsRh5EdD9d5 mJOxoyNVk8i6kXg0DDdoA2e6nSebHq1rYupg7yqyt/XgaCbGVh9Iopo1giW1WFl2lu1B KiEzqczh8F3Qg8BNE6nDq8oKCYWjE/8XZmsDPFrJ3NmbJz/GOPnpGNLT1VaW/IL7sjbI RT0IEQUe7QvediAcPwVBUEA0y9xLCdUa6fy1YeHSoaFfkmEO3oa78bXT1DBftYTUgIoF wTpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CeDtwi01; spf=pass (google.com: domain of linux-nfs+bounces-995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w15-20020a50d78f000000b005549157eb2asi899229edi.585.2024.01.09.10.03.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 10:03:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CeDtwi01; spf=pass (google.com: domain of linux-nfs+bounces-995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-995-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 903681F2492E for ; Tue, 9 Jan 2024 18:03:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DBFB3D0D8; Tue, 9 Jan 2024 18:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CeDtwi01" X-Original-To: linux-nfs@vger.kernel.org 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 0F0CD3C689 for ; Tue, 9 Jan 2024 18:01:40 +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=1704823300; 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=e4MRJOyXPjbNk2hR0Bl18LltS/kUEDv+XACveM0IT3M=; b=CeDtwi01Uw20gdhI8jOfEMqIBeP9fN4FYuN6ox8s29oQX/z+KChuRU5PpRF0fr6rTWuqgP 4Ht2uAqg5YxNhtey+Vlkmp7wC6XfZcUgqC7Xif2maIcaPYznXNC6OxuMr+RD5woq2XnMhY 0978yW/w+SBNaQ+qyzPijy3Oq8wF8y8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-352-2TOU-R33PZWGsoiEHyyung-1; Tue, 09 Jan 2024 13:01:34 -0500 X-MC-Unique: 2TOU-R33PZWGsoiEHyyung-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 B9C091C068D1; Tue, 9 Jan 2024 18:01:32 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3C3A40C6EB9; Tue, 9 Jan 2024 18:01:29 +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 Subject: [PATCH 2/4] afs: Don't use certain internal folio_*() functions Date: Tue, 9 Jan 2024 18:01:13 +0000 Message-ID: <20240109180117.1669008-3-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-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 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/afs/*.c perl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g' fs/afs/*.c perl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g' fs/afs/*.c Reported-by: Matthew Wilcox Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org cc: linux-fsdevel@vger.kernel.org --- fs/afs/dir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 5219182e52e1..35f7da6963fa 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -124,7 +124,7 @@ static void afs_dir_read_cleanup(struct afs_read *req) if (xas_retry(&xas, folio)) continue; BUG_ON(xa_is_value(folio)); - ASSERTCMP(folio_file_mapping(folio), ==, mapping); + ASSERTCMP(folio->mapping, ==, mapping); folio_put(folio); } @@ -202,12 +202,12 @@ static void afs_dir_dump(struct afs_vnode *dvnode, struct afs_read *req) if (xas_retry(&xas, folio)) continue; - BUG_ON(folio_file_mapping(folio) != mapping); + BUG_ON(folio->mapping != mapping); size = min_t(loff_t, folio_size(folio), req->actual_len - folio_pos(folio)); for (offset = 0; offset < size; offset += sizeof(*block)) { block = kmap_local_folio(folio, offset); - pr_warn("[%02lx] %32phN\n", folio_index(folio) + offset, block); + pr_warn("[%02lx] %32phN\n", folio->index + offset, block); kunmap_local(block); } } @@ -233,7 +233,7 @@ static int afs_dir_check(struct afs_vnode *dvnode, struct afs_read *req) if (xas_retry(&xas, folio)) continue; - BUG_ON(folio_file_mapping(folio) != mapping); + BUG_ON(folio->mapping != mapping); if (!afs_dir_check_folio(dvnode, folio, req->actual_len)) { afs_dir_dump(dvnode, req); @@ -2014,7 +2014,7 @@ static bool afs_dir_release_folio(struct folio *folio, gfp_t gfp_flags) { struct afs_vnode *dvnode = AFS_FS_I(folio_inode(folio)); - _enter("{{%llx:%llu}[%lu]}", dvnode->fid.vid, dvnode->fid.vnode, folio_index(folio)); + _enter("{{%llx:%llu}[%lu]}", dvnode->fid.vid, dvnode->fid.vnode, folio->index); folio_detach_private(folio);