Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp129639rdb; Mon, 22 Jan 2024 14:33:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdBuVRJIs8NIJqyCuXkD2mJeTBdhS9iMEoCh0XkyhrIh0kX+9MFvsj7aDKgREizEBP3ACq X-Received: by 2002:ac8:4796:0:b0:42a:2ec6:bf1a with SMTP id k22-20020ac84796000000b0042a2ec6bf1amr5575671qtq.95.1705962808288; Mon, 22 Jan 2024 14:33:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705962808; cv=pass; d=google.com; s=arc-20160816; b=NEJk1LEMOtbCdmA+cz3kCfoF38fMtmdMzH7JhzycZ/e9nSAbehjPxjd0N80rr3KgtO fwyTD7uPgxcZPOWmG7R5re/OKZ6/juqBQ6MBfCPIUQBfVyNmhNboHY2pFqCFvJkQMlJe xAWuZaX38H1srKXNCaNw9BceTJ4efVI1aYJS+c8jfDtNK6XIkayGhKXTT/iJPqFt8kN0 nhj1d8V2E8AEZRRZEU2d1OSg0ez78iTjFuwjpU2cqKMR8s9s7BwgPe8jKmXvV3tma5gn 45naF8jv32AkHyEoAGVR47NNGI6qm3ebj2+UISJXUJThahxFaoO/jWNL2IsJBCwmvFdw 6hUA== ARC-Message-Signature: i=2; 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=x1zKGT6uFapv0Zv34dL5cckA4sfK0obP1h5qgfcrNJU=; fh=jD/G7UrdWzQUaVcsyZL0Br5qChVzoyKXvXZLpQibT6A=; b=S0rCXaEFVeh5aduVJnrqmAC5WXA3d1knwi7OVuY7LSPLfs/BJljcc55KRgh9V016MX NzM/rCywMGQSdqiFe52+T0ek0pwQ5eWepuHdteikgQ52P9Uj/NorozgtLRWl9ObzOGpd XYMfdQeXB0gIUp/ERTrjp+4ScQwF4z3zF+ixWaJlj5XsU9yzRRwyvyWKhCwmYhpBN25H 252ZzUFp/HLpEchnv14wg2zeyr7VW/A7i6ytwl6iWl9fem0aFMURW4eP753zgBVenLhn Tk8u06/bmJbQ327QKRFfRnTn031j9rTXpnc5xW5DaubdGZ+wI5kw/UYfvxGHLEtCRwTF WIfA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Wb/QxFiM"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-1261-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1261-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 f17-20020a05622a105100b0042a3f467282si3171946qte.414.2024.01.22.14.33.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 14:33:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1261-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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Wb/QxFiM"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-1261-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1261-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F36ED1C24E90 for ; Mon, 22 Jan 2024 22:33:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D29BD2110D; Mon, 22 Jan 2024 22:32:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Wb/QxFiM" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 28ABA1D536 for ; Mon, 22 Jan 2024 22:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705962764; cv=none; b=HPZNabm+QI6T0o7iZt71BgBc4NPm5JkXIfhbu4s3q5ILHGIaScvi1p/Pfd4r6YQIvw0t6y4sMgQTJbFrxvFpeY1jKJtZYCGuWYxXJ4aDktnXS+rW8FZr3gtgUuHY8hr0lX4aG0TosFzmZs9nbOcja2071iPIkWq1RMf8PI2jTWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705962764; c=relaxed/simple; bh=/cvksSSZmxrtzmRzMtQyJ29qGFgkxxbGXyOn+BgtGh0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mJjkV6rVQSrI9nE9OWt7LpGhowqeT9vb/ntPSI5okeZpZfrONCT8/zbiDl8c5kOZYitx1YgMXleI4MqJiC5cy7JuMteCQoIW72KaKtFKUti+tzKQT9XfdgnKOsamT77NYBIbXm31ogEQIuNPDXPw1kLC3JrTF6fATaiz0AnUVKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Wb/QxFiM; arc=none smtp.client-ip=170.10.129.124 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=1705962762; 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=x1zKGT6uFapv0Zv34dL5cckA4sfK0obP1h5qgfcrNJU=; b=Wb/QxFiM+NkATy7wg9JU6pbMHDCnKF8QzQ0MBRB5TvXOKoZ6LonYXn+V/RVRKP2Ntv+681 Q/XZvn43Mmfp0pJeD42iwfjDSBOXRoqzntk7gLRByo+0OfQRYajd0z/w9PQWEmxpXaMUu9 PPIY8qywnawRDAw0/xq7GCUJzZzwsd8= 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-677-D55WZ7cLO0uVwnEeCzBXJA-1; Mon, 22 Jan 2024 17:32:39 -0500 X-MC-Unique: D55WZ7cLO0uVwnEeCzBXJA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 233F61C04181; Mon, 22 Jan 2024 22:32:39 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C0FC2026D66; Mon, 22 Jan 2024 22:32:37 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, 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, linux-kernel@vger.kernel.org, Marc Dionne Subject: [PATCH v2 02/10] afs: Don't use certain unnecessary folio_*() functions Date: Mon, 22 Jan 2024 22:32:15 +0000 Message-ID: <20240122223230.4000595-3-dhowells@redhat.com> In-Reply-To: <20240122223230.4000595-1-dhowells@redhat.com> References: <20240122223230.4000595-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.4 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/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 c14533ef108f..3f73d61f7c8a 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); @@ -2022,7 +2022,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);