From patchwork Mon Jan 22 22:32:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13526327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DC96C46CD2 for ; Mon, 22 Jan 2024 22:32:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53B278D0005; Mon, 22 Jan 2024 17:32:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EA198D0003; Mon, 22 Jan 2024 17:32:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38B5E8D0005; Mon, 22 Jan 2024 17:32:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 24AB88D0003 for ; Mon, 22 Jan 2024 17:32:53 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B676C14014F for ; Mon, 22 Jan 2024 22:32:52 +0000 (UTC) X-FDA: 81708398184.09.118B0C9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 0026A140022 for ; Mon, 22 Jan 2024 22:32:49 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RpGeODmI; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705962770; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=x1zKGT6uFapv0Zv34dL5cckA4sfK0obP1h5qgfcrNJU=; b=i5VZ77WR+z4pL3mAFU/ZpkQszoG+IdqDRlCBusWTCVK6+VVQ/3Xrjh83sUJFNNa3R18QWV rUKYQ4V2RQVqyHsQGi13rMcCAC3YP3wDVAKemQtwlBni8MHYb3Fl+ZDpGahf2NnFJOUO8r JiaePzVqmTabzka+KfKKY9HIjvBte0I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705962770; a=rsa-sha256; cv=none; b=ksWuF67TQPhvG/UvPWF3f8g5VDhHCv/MBWgIeiDvR/V7h50myx3ErUDgXbjCqsIGUh7tdc noP40WhuEnEcORXWaOmw0sxxiiqYsTVFKInm/E4u/bup5zt871f3c3LA7RzZivGDdkd3Fy 8ixK9zWGAVaPQ18oYNXtZjn3i3TSCkg= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RpGeODmI; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705962769; 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=RpGeODmIY1BCh91xe6NDOdCDHISeaaU/v4+U08CnWvzjJFGdQdcMYs7vKmypLns2ALgabO 2y7jA8gl6/2kLOKYy7atwn5tHWafYlRK8uGxCW0JMWmAt7pn5keItjwRSk0HVXOaw1lI+e WF3wlX2UsMf9oPfvaMki0cRhciVVXE4= 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> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Stat-Signature: ch9x6hc13hrt9fkyj9r8mqnkpfi8aqau X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 0026A140022 X-Rspam-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FIDfDjeMtyZIKcqOWj9FXapD+atPlIcvJYnOKdzYiyIm/w4j3CV6j/6GRA5gYzwFmsd4MFX3tFd0yI1/YDts2DGIf6KJalDb5zucrv/sTPWtf3TaY0AtmpmHA1jjFQY/UkLvxLA4zImS9NMGxhIYow44f7jyZ1w5P3hbK/pg/ngrjGhE5+ehqItNWQlgoysfH89V0m6BEhZ0MmnNnC/zmotgwCZXNuno++H/uDDjkCNhk+WaeXbVwKWGvCx00ICatpEMchcyNoA2+GtMP4lL9UjOyhQrCgmbr8jqIrps6oF+rIw/F7VocFvd9usWNEJWMZ6zowwmi4MzKsKnSvHC23uXoWPaq3k= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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);