From patchwork Tue Jan 9 18:01:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13515192 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 C5B4BC4707C for ; Tue, 9 Jan 2024 18:01:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B79C6B0093; Tue, 9 Jan 2024 13:01:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5417B6B0095; Tue, 9 Jan 2024 13:01:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BAE28D0001; Tue, 9 Jan 2024 13:01:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 25DCA6B0093 for ; Tue, 9 Jan 2024 13:01:42 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id EE208A02FE for ; Tue, 9 Jan 2024 18:01:41 +0000 (UTC) X-FDA: 81660540402.20.51F6A81 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 09C3020026 for ; Tue, 9 Jan 2024 18:01:39 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="N2C+I/oC"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf03.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704823300; 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=e4MRJOyXPjbNk2hR0Bl18LltS/kUEDv+XACveM0IT3M=; b=0UTbGn3GN70N4RS0WG9p5eelAQq+fdfUsbF1A/pkIxhZwTo3CLr4gzxq26TfAyLywsC6/x gFYTrGF4kyU4PBmrjr1vLYxgJKCwaq0z/V5vRI7kVp6XF+sF1XYH3l7lQ3ZZcT4lCBEpnj B7BItzsCnaUF/WEOarWRd4iir4eRZQ4= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="N2C+I/oC"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf03.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704823300; a=rsa-sha256; cv=none; b=Bd3mHjQyNhThBiTsGQQlBYDMnpVn6EvDtjhmMk+L3U2NRdIjpkO2CQq2jzfUHVSNDh+j6o htmA0pncWIPnIiu1W/pgHsRuwaO769GcpyJTD4KYNERM9acV0o6JhsuqAeM+6ndSP410sQ 0L6Hc1lLhcC5C0S5W86FU6m43w/MP1s= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704823299; 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=N2C+I/oCChAoq2NOoKpmUlJupKothul6DJ+NvUgU0dNG5KIP9BnjNaJf1DJXzoC9Q8eH5Y VDTU8PZSBU/nwv2VbFg79c7BgzRv31dKdcLJgOoJO1nlneP5QtmBu6Wljfj/Iufnh9Xni3 1KW/O2yevyBMK3oyw4t3Fd6Jp/Fu/Gw= 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> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Rspamd-Queue-Id: 09C3020026 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: fn8jun9fw7picbtct964kwi7kwj4jz38 X-HE-Tag: 1704823299-785641 X-HE-Meta: U2FsdGVkX1/H6vTxmaPATum8Bv7/pJGTkEGBIY55uX666qqWmuLmsGIvKJ183J79ggAY5CnDdC7DWx2dki02TfioKtp+KmHnV3rzBYSPfs6Mz3maG9eoNO3wnSN2/XOcheorx7qhH4yQf09dP6MLQvZUuTcHTAwkR+O2PQxiCe4LPTIBg3izfX+OBIBuzV05X66CH10FmKw5zmsjRfDFtfnV/CJX72lQRCLJJC4JhCqDnVy94c/Rc6t3YLcJ2uyIls/XfdR6AFaOMYukkb7Hb1Fccjm5qhmdgbGOeAPWoHYsFkMqTxPuBdVXTSFcBNte38YIJ0ttDLvTtCPAG158gfvS+pCWM8b6el43YGtJOKW7u++yD7A2jSSQNVuMXeBPAVzW8yRpTmVM0B/xjCKoRycKG3M/fgqe36nJ8GLQ7GWyl3R4p9RljJji2DlLxdt/nKoIfqJx9wLnnw/E/n3B/vvfv+/hsL1cF66WqBulS/O+lR3tnjBwzkaqjzqpsQR45JY/Kz5UI0hUpuBu39iwXrf/wOtlGYE5Mv5pDPAo+ntO1I068w30pcR784X5HYMxX1v7EtA+TYeZDaLFn08kMtEnep6Dvb/3dfn5gzva/Gf3Wia3zLOiA818UeCv16UtGM+8AQs8bQizPKc0U6TO2jvXu5zL0toChcJlfFn51w6/PAWjo3Kv8QyKD5f7noH7IH9l4FeaS/OQpJG28td+YBrFVLIEliSC89Btf4Ykvp7v2W+pP7GORQNY7IE/O4Ntx5NvVhhYqNq0jkuClNQNhwk6aGpTF1kwdAH9YVbmbZd+52ldvu7PJkNkuFfcOcp2zwUYDTj0PAyyaCo1gLAZTMX0yIqgHdgT8/Lr0Si/wONHGZIoNOALf3QyN0mlelOMBgovMQNYvNf45elnKdq/yoys5uu9sNELGMR4jooSZe5EFZ3JeETtvfVFInswCy+EVYt4UoIQsNJjLSgKUac 7wM8qqod u2n51JGAHshpd+LUwjwzm7OcBqNyjTIDBWTLQ/XH/236S8vOZiFe1A2Nzfes5KMfyCCSz9yCdD7ORosPTxeU4ruRPbT4STYPa50DqtU+j+zTBbKxLhI+6d0Ayr0MAFg8u8ubXSD9OdMNIz858CKxo5k9TU+aY8HsElaLK8SEF+dgZsF80SQXDQqMun9WJ+UhLnBGSSLkVrQjoOscNtYy4SQ5kahl+U2/HhihYBqU/0WgiXNRlIrcX7wDgGUGdr8KTCXavFYJsNifzrs2KGD09SIUYQFAm7+oOYScg7t5tjAnfODk+OJdOPpes9r3HnJVjqC5IJjgKh7loEb55eFgl/rbJKl4cLMGxlwcVbCBThT9ikjS0Wi2Vnu3FBdcidO0DRkhibH6OOslWUYA= 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 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);