From patchwork Tue Jan 9 18:01:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13515191 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 E7093C46CD2 for ; Tue, 9 Jan 2024 18:01:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A1CF6B008C; Tue, 9 Jan 2024 13:01:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6519F6B0092; Tue, 9 Jan 2024 13:01:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A7706B0093; Tue, 9 Jan 2024 13:01:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 37A026B008C for ; Tue, 9 Jan 2024 13:01:39 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 02FFC1209C4 for ; Tue, 9 Jan 2024 18:01:38 +0000 (UTC) X-FDA: 81660540318.20.3BF4275 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id 0B401A000B for ; Tue, 9 Jan 2024 18:01:36 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=h3eQAKkA; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf25.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=1704823297; 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=D4ihKq2RSkKhUM5kA055LwpHV4/BqtYxlxEJ8VssZ38=; b=Mk1IAJvZ6Oa57b3gJ+fC+5eJOIrgfP+NYzlfSUnC+KsCZkiQ0wgQNmOkm5udwQYQmPeUyG JlmVdThNw85E9hOoXppGMpO0WfUQeHLENy5PXNoe0oIHwXsoVYWpve5GIrN3jZTDkjEYVq ba/G9DcnLvUjqHEZJxAZMmMawDAvkQc= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=h3eQAKkA; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf25.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=1704823297; a=rsa-sha256; cv=none; b=AOzSTCwflW7dPNwG9+be6uYONCI6rieZpD5U/pIqAZY3fDwrYIAxvCIxkBkDILFiF+1e0l R8fD0cBdHf/DcIHzy66U6rwL81RWp25cobh6R4nTGao6dddjwKXi2FR7Ru31Iw39ZfgIph N8djk21/9zhxWcb2o2iX8Ag4Pa9tE+k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704823296; 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=D4ihKq2RSkKhUM5kA055LwpHV4/BqtYxlxEJ8VssZ38=; b=h3eQAKkAb6mhZnzm2kybd/uvBUgNm9bnowYKb34v9lCc2tuqh7OPj9cyMbY0ajyFwxIppl wJ5GIp2qM4KzlAgqEhdrEJOIYM1rf8rAqYhCQZl7a5PpkFYx9PWaX8rfM+9PJG4dIGts5F Jviz0jzmKELEPZFRNzpVTjY1fUYdtXo= 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-452-BvkGftaQOpql1newkq7g1g-1; Tue, 09 Jan 2024 13:01:32 -0500 X-MC-Unique: BvkGftaQOpql1newkq7g1g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 415E110334A3; Tue, 9 Jan 2024 18:01:29 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BE45C15A0C; Tue, 9 Jan 2024 18:01:26 +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 1/4] netfs: Don't use certain internal folio_*() functions Date: Tue, 9 Jan 2024 18:01:12 +0000 Message-ID: <20240109180117.1669008-2-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.8 X-Rspam-User: X-Stat-Signature: mfu9etaqcjddg643feq7tafbxzz5ojh6 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0B401A000B X-HE-Tag: 1704823296-768329 X-HE-Meta: U2FsdGVkX1+RsKOkgGv4HDuXixkXVRMAcjtpvqGx/qSnl4h4dDWNcj1Uu10jWAK4XoxBttJBZYGNrTqwIXLy2jBWyQ/t2GDNC2mbUOUUqBCCmpv4qjq41JIBrNs2virIvmCMNXGho17IlIib2LAJHncwh33P2g0DGdzkg6Iib1xzn5HpYO7y313w+mjeKxDLdIGsmqpSLDpocB48KdgHvugpDRrWQllcAn/gET8W4Uu+TJyGM14MvMZjyWRQt6wbLoCbnKz9xGarltAmqO4jT6qtRSxy8a9aTgm2W+pcuSfdcKP1Dcbfp3PJ+mNG7HtD3lA+DB2LqZk4gtl1wXjo1Ot9cNEYVQhvzwW1czdybr3ivXGx/ByO3awrE2O6vNUAUoFYktAwJoMC5ty+WA5URxw0wx0TEM92Io9FQpyrkn4Qt9Ler1ikTRgtxePH5pMxd8JaEzcjIeZbFXtGZjBGrdjpPz5A/3u/4LXWlNTEEfh9qQ95yIYw/WLR5PNXkrsi+Dhv1asKxcYOxuVH2rI1+bQJDKeLJys1TmBSnAznYz03gn5rXwLbCQVq9tXAldG22XLlM4wB0xIUocdtB0W+rx6lKsj+xtZRHjdYxwuE91pOz2l4llf86p9eCHg7KkzCO+EIdzm/28FfzRgCwU0YjRsQ/9xqX3uzu6ei0uwRdXKTf6ei0tqJN5gtzmVLQcuZpluLa60K2HPhq8GtWrHeJF29SSvEtmJvSyLGGvCg2NImmlGafVf/36f33HKY6EmwcaSNELn0kM+h2GTvsd9Rd0+m/23OqB9rJza1BBHMUnpSRUR1cHvACx4o26WZK7mB5451xQJqtlWTbf49YpprOBzOLGZjDaJERBRyTwJ9oclZek2J7Z4IxnJNLbFd+46aXIY5CQS1z0ko+hVdb2Wr6K/z+JwwL7U5EugCjThuOC6KRq8TT3NDiM48dTPSiK+1+U352+1BNgKOo5mClmd y5pfEhAY QDgIY5EsDkPBPEXcNb2567H6czGamr/XEYnhH/CyvbYXGtzH7qbaeNnQZlR5oJeyrv+T7OrzMtkN5UxwOh+0FDI42hTCKlQ1lvvnHDgwbwgSpxriG0BvOALiFXpTM7A86zhjYJAKHScpF6OD0XnulocBZZPgY4zIZDziYaqGoNjPAzeR6XZzrFbTO3Fizhmxt97dy+7aMpTS8v/C8q3aAz8DkQaX7/ZpB8GQvAduocxsb3tZVbhFfxjyHz4qYwOa5CUfXAfJz4/ZPAEjC56ZBaetmvby8EptohcnFDItoCFE2KBAzAVVQ2SVUKzEJCr+QLJmGNiWaONQLqjuz8t3PSyN8K14Tr9XAs+1mfEeQ7dae0O4zc/UJoAMm46+QgqRgvXXhVs2o+ZyynR42zEo9O3EJew== 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/netfs/*.c perl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g' fs/netfs/*.c perl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g' fs/netfs/*.c Reported-by: Matthew Wilcox Signed-off-by: David Howells cc: Jeff Layton cc: linux-afs@lists.infradead.org cc: linux-cachefs@redhat.com cc: linux-cifs@vger.kernel.org cc: linux-erofs@lists.ozlabs.org cc: linux-fsdevel@vger.kernel.org --- fs/netfs/buffered_read.c | 12 ++++++------ fs/netfs/buffered_write.c | 10 +++++----- fs/netfs/io.c | 2 +- fs/netfs/misc.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c index a59e7b2edaac..3298c29b5548 100644 --- a/fs/netfs/buffered_read.c +++ b/fs/netfs/buffered_read.c @@ -101,7 +101,7 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq) } if (!test_bit(NETFS_RREQ_DONT_UNLOCK_FOLIOS, &rreq->flags)) { - if (folio_index(folio) == rreq->no_unlock_folio && + if (folio->index == rreq->no_unlock_folio && test_bit(NETFS_RREQ_NO_UNLOCK_FOLIO, &rreq->flags)) _debug("no unlock"); else @@ -246,13 +246,13 @@ EXPORT_SYMBOL(netfs_readahead); */ int netfs_read_folio(struct file *file, struct folio *folio) { - struct address_space *mapping = folio_file_mapping(folio); + struct address_space *mapping = folio->mapping; struct netfs_io_request *rreq; struct netfs_inode *ctx = netfs_inode(mapping->host); struct folio *sink = NULL; int ret; - _enter("%lx", folio_index(folio)); + _enter("%lx", folio->index); rreq = netfs_alloc_request(mapping, file, folio_file_pos(folio), folio_size(folio), @@ -460,7 +460,7 @@ int netfs_write_begin(struct netfs_inode *ctx, ret = PTR_ERR(rreq); goto error; } - rreq->no_unlock_folio = folio_index(folio); + rreq->no_unlock_folio = folio->index; __set_bit(NETFS_RREQ_NO_UNLOCK_FOLIO, &rreq->flags); ret = netfs_begin_cache_read(rreq, ctx); @@ -518,7 +518,7 @@ int netfs_prefetch_for_write(struct file *file, struct folio *folio, size_t offset, size_t len) { struct netfs_io_request *rreq; - struct address_space *mapping = folio_file_mapping(folio); + struct address_space *mapping = folio->mapping; struct netfs_inode *ctx = netfs_inode(mapping->host); unsigned long long start = folio_pos(folio); size_t flen = folio_size(folio); @@ -535,7 +535,7 @@ int netfs_prefetch_for_write(struct file *file, struct folio *folio, goto error; } - rreq->no_unlock_folio = folio_index(folio); + rreq->no_unlock_folio = folio->index; __set_bit(NETFS_RREQ_NO_UNLOCK_FOLIO, &rreq->flags); ret = netfs_begin_cache_read(rreq, ctx); if (ret == -ENOMEM || ret == -EINTR || ret == -ERESTARTSYS) diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index de517ca70d91..3afb1a0f92d1 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -343,7 +343,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter, break; default: WARN(true, "Unexpected modify type %u ix=%lx\n", - howto, folio_index(folio)); + howto, folio->index); ret = -EIO; goto error_folio_unlock; } @@ -648,7 +648,7 @@ static void netfs_pages_written_back(struct netfs_io_request *wreq) xas_for_each(&xas, folio, last) { WARN(!folio_test_writeback(folio), "bad %zx @%llx page %lx %lx\n", - wreq->len, wreq->start, folio_index(folio), last); + wreq->len, wreq->start, folio->index, last); if ((finfo = netfs_folio_info(folio))) { /* Streaming writes cannot be redirtied whilst under @@ -795,7 +795,7 @@ static void netfs_extend_writeback(struct address_space *mapping, continue; if (xa_is_value(folio)) break; - if (folio_index(folio) != index) { + if (folio->index != index) { xas_reset(xas); break; } @@ -901,7 +901,7 @@ static ssize_t netfs_write_back_from_locked_folio(struct address_space *mapping, long count = wbc->nr_to_write; int ret; - _enter(",%lx,%llx-%llx,%u", folio_index(folio), start, end, caching); + _enter(",%lx,%llx-%llx,%u", folio->index, start, end, caching); wreq = netfs_alloc_request(mapping, NULL, start, folio_size(folio), NETFS_WRITEBACK); @@ -1047,7 +1047,7 @@ static ssize_t netfs_writepages_begin(struct address_space *mapping, start = folio_pos(folio); /* May regress with THPs */ - _debug("wback %lx", folio_index(folio)); + _debug("wback %lx", folio->index); /* At this point we hold neither the i_pages lock nor the page lock: * the page may be truncated or invalidated (changing page->mapping to diff --git a/fs/netfs/io.c b/fs/netfs/io.c index 4309edf33862..e8ff1e61ce79 100644 --- a/fs/netfs/io.c +++ b/fs/netfs/io.c @@ -124,7 +124,7 @@ static void netfs_rreq_unmark_after_write(struct netfs_io_request *rreq, /* We might have multiple writes from the same huge * folio, but we mustn't unlock a folio more than once. */ - if (have_unlocked && folio_index(folio) <= unlocked) + if (have_unlocked && folio->index <= unlocked) continue; unlocked = folio_next_index(folio) - 1; trace_netfs_folio(folio, netfs_folio_trace_end_copy); diff --git a/fs/netfs/misc.c b/fs/netfs/misc.c index 0e3af37fc924..90051ced8e2a 100644 --- a/fs/netfs/misc.c +++ b/fs/netfs/misc.c @@ -180,7 +180,7 @@ void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length) struct netfs_folio *finfo = NULL; size_t flen = folio_size(folio); - _enter("{%lx},%zx,%zx", folio_index(folio), offset, length); + _enter("{%lx},%zx,%zx", folio->index, offset, length); folio_wait_fscache(folio); 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); 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: 13515193 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 A9C92C47079 for ; Tue, 9 Jan 2024 18:01:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4CD286B0096; Tue, 9 Jan 2024 13:01:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 47DB06B0099; Tue, 9 Jan 2024 13:01:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3456B8D0001; Tue, 9 Jan 2024 13:01:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 214C36B0096 for ; Tue, 9 Jan 2024 13:01:59 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 77654A1E52 for ; Tue, 9 Jan 2024 18:01:51 +0000 (UTC) X-FDA: 81660540822.08.940E828 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id B6823C001C for ; Tue, 9 Jan 2024 18:01:49 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cZUutkf5; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.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=1704823309; 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=7Xf1sEICUh1u9jN2O9W9Y+tFVYV24JiIia24sIupeow=; b=qgiJckL5usyy29U+bTb2gVdEG8/R2Uop8rXIvkbv6VS0mlSpP5GtzflIoiD4ExK8VTu7m8 CDS1hzipqsNXrQuPFZks9oL/3xIAh2XYcb57BYyKFTV4rQjBtn/pCXXes3WBNjSO/ZTWBw Y4h+cjkOlOIo8HKVDWm+/V71tnxwKFs= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cZUutkf5; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.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=1704823309; a=rsa-sha256; cv=none; b=FksBZWZYGh1k5g9Hqi1F+Q0DEZ2EjscShXwdEiA4tg0xN3uCwI5ZgA0QD+6F5U6aDGwQz2 Cv6icm9FNJc4MukgEkDxmAhv4OXmAymfAUjOT6Yk+URyFIeMAUja2bMT8dD4fUvcioVPbi RaZfNTs43hEGJNh4bexslk+MgsRThbs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704823309; 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=cZUutkf5DEQR/coFNw3VBj6zjpEQOGDa8SI7Ol0qYmZRpBjHdW1GCDdGel3UVNu8RFjUx2 mibFFJl4B02CRCzl4lGSjl75fyyqDnRxSNT3k4WwYhxZ1hrOZs94HRDN3gZJL3oi4OWnB/ AtMkRQ2vYa05n1ksU6OUENEzU5e95rc= 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> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B6823C001C X-Stat-Signature: mcrfrwpznsyjkq7m3gy1mm8omzuhfmuh X-Rspam-User: X-HE-Tag: 1704823309-786843 X-HE-Meta: U2FsdGVkX1+EERKKXzElTUYgQ0991ctZi/sruhGrKYWNZ9fRXm3KbkhG0gkd5awMrV+yrpcgsuCUrds4vc0M9IIdX1YE70CcfRCsfAcdkOLDw2cg6L8dKY5WqAIWuTLh6FXU6UH7zxNx4hn+92rPs4usFOxTCgKTdJ6fBjmD0NaBkZmttt6VCiXJUAXVxLJdeifE1knKwN0cfmd9/wOTt3VHjytHyn85keWPCylIRl8O+Jl5q6fjVJAJFHI7c6IjhmkC/wk1iYdZk3gvviMybwcbnnhVgg8hot+65yYrOujdtHJFqjtdigtNa5ppxJ2JLmFmx/DTdVYEmbmHPdGV8lzkT8lnbqyY4r0y7pTVfKKZhTpv+ziX3FbCczRHSaIegp5tml3NFT0mlkD8GakhAg3Ma5f4ae5nyqKPNHamgjRR2Ovd68vZpY08TlNXDNIPLf4AYd+sfNUl8/5AAJ5zRG73oyLAxuj061QpFmz5idHmgleWDLmUavH7e+rid1CarzUcaui0mkN8x8EnI3BpO8fZUblsR8bib6PPSHMoVwZEqR/q/sDVh6XnWEmur21PB5IbFibRh56yyA+Yv6DyT22XJMPlv9CodsqvGZ8GNsvtznz2UfziXambC1AlD3SF1jvoef98ghUJIXlkt+b1uh+Lqq7JCVt8jMfdd9eUxBQW1urL1dKHVA64OtxEDtvGfMOjM0+0ipQaCpl4IoXLBBSbzJWGTr5rYr+moBUHHMJdWqKQT9UT238T9P2T4OPD2T0jYswlFxCe1xF0xywbrVlY/mVQevneJXSO3KDMbsxugk01szknqY6r12YmXwXDUu++J4eJ+pScqc/a/Qbg7SgaTYVa/plrU4EBXDNlCLjhGmjzl+qxQyiwiKrkPhC0Agqb0tzOdrv3UKGm7v+Dt2U9wz8VATBQoEpWUa9Y/VkYM0sLfnlyT4MTJTFna1mC8Md/ayKUVSwDRdjEmKU VaUSY4mK CECkFaZaNBkMvvT7183ELcfdVrxvaxgdDpYkRf6eZLRDSaWHXzxtAVeQdNmCxWI9jjg5J6vsP5wqUNDD/gDAC1pSyE87/iYQd4VrAeRTpbFZ2G4RRY7dzg248Kl/a4gDOYK3lvkqBsbtam15rFxLBhwZDQvIaCeWUJiq7j2iuS6SCoYgGu/e7gIgJyNjVDLCRq1AxoCKBpR7NWHQTXWK1c+yC4yFEmuQ3keWb0N2ZCfhbrDQjpHdjhcTM5N+Jj6JOX0Zw0EfbjH/4MuWWAVleZNyJ1UQnUXJMtFUSV1pqfevR6m+bEp1v6CZ+Rru/WTLDw+T8xBWDSMJcOgcqddM8JE/BP3GQhNHptBOzCEOSng1PsYoyPKWuqgZg9bhMoe8feUqnIp14goUm01GWyKu1cg0Tk7McKeN5i98R6fQlFrh1hoYmt32VXPLHqb/RjcFK5rEQjciP/9MvVL3MRwPeFywqpvTjWBks+DFM 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/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 Reviewed-by: Gao Xiang --- 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); From patchwork Tue Jan 9 18:01: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: 13515194 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 24180C4707B for ; Tue, 9 Jan 2024 18:02:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 03BC66B0099; Tue, 9 Jan 2024 13:02:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EDED28D0001; Tue, 9 Jan 2024 13:01:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D30896B009B; Tue, 9 Jan 2024 13:01:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C302D6B0099 for ; Tue, 9 Jan 2024 13:01:59 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6CD42A1DE4 for ; Tue, 9 Jan 2024 18:01:49 +0000 (UTC) X-FDA: 81660540738.09.D3FECA6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 2B8BAC0035 for ; Tue, 9 Jan 2024 18:01:45 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BcRHj73F; spf=pass (imf10.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704823306; a=rsa-sha256; cv=none; b=DuDp/STY0aQZPNactZXiaYdOne0a/YF2Oytr2r8mQOlrX0QGE1kXqnuqMz84UFL/fDgKt7 EVkNbsMFsHBd4aDICa/x/TK9z5g/H5EVA6JJvh+XwL638bzfbXmn/AihHGwqq9393pclEX 8M2se8Rk5Batl7MtUf3D+OUD6hrfAww= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BcRHj73F; spf=pass (imf10.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1704823306; 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=htZaU1/QSRuOWh3B5AYLSVZDvmENK74hhmVyyviJXCk=; b=BU/qgepFPISX8NcM/j5ObypbO2dYc5gWHnrk7T95ypDVGPJOuYhPcZJ+bSoPUZFnggNbFc CXbPgBSxTpjH6CZKw+WGTGKqSmkXqT04mAjE4t4BUxds6dYouX8dp79j3Mx3boZhkI6Mey aLfux3B2PD1ao5vlKqCkNFb7nb9WYlY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704823305; 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=htZaU1/QSRuOWh3B5AYLSVZDvmENK74hhmVyyviJXCk=; b=BcRHj73FP96v8+KuWZX8TT+HVxMQwBnp0g6HTXjQY+oz6hsjlKTdc3zehMnh5uk/clWUSj igKUQJsTPaZryR4peMj0TK8KSVheItD8r87SEMwH1lWaM/Yd73/i7PF3/D0lBXu0JO0JWZ xeNwH3n70JPzST96Xy0F9LzyRbG90E0= 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-166-1HRLsJ-qPNSJzgSw3CTxDA-1; Tue, 09 Jan 2024 13:01:44 -0500 X-MC-Unique: 1HRLsJ-qPNSJzgSw3CTxDA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 01B2C85A58E; Tue, 9 Jan 2024 18:01:41 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id C01671121306; Tue, 9 Jan 2024 18:01:37 +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, Steve French , Ronnie Sahlberg Subject: [PATCH 4/4] cifs: Don't use certain internal folio_*() functions Date: Tue, 9 Jan 2024 18:01:15 +0000 Message-ID: <20240109180117.1669008-5-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.3 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2B8BAC0035 X-Stat-Signature: tbazio95rhmkbya7653grshnoxpedoby X-Rspam-User: X-HE-Tag: 1704823305-681423 X-HE-Meta: U2FsdGVkX188p6SiImyWHFZunPFMdMmZdzC3cQz1RTzILgwr58Mtup9YQkcytrvoks8Sh5MORF4YHZGOLq/W8lYw3WDMGa6spfMoxMC59+jaPC01NeC1/qbyOA8Rg2I+T8shiuRBQCLBP9ttsfR2davK6DcB0qcBYZyxAZZ+jKm9doytOfJIh8FVFBnv49CM3mkA74C7Zc+sFCHCSnw1bjccGY/xg3uPpDaUXeRrRJNGVAGl6oGJSFKFyf69WiCtD1Nvuz9y6QILNd7jZX5RSwNMTFIG50VUUlKjh3owBBPqE25NjBvRkLNTuixrzSNgRTMj+4PYuwglA2+cvwe01wD94P/yltNx3L/DudZur/J5RWQkC2eYwtZvmgEYayGhPyVNNictwVZIn1zRX3D7r+3C8UndajsSb4hFYew3229nlUAf/fYdYmmvUVnh42Ug2d6QanlBtsa5l44lOi0lRwH9dlsydPEzmJGW3QFJCyVaBcTtFSXD2p69RjFx9B+evxMYOzHNUmB3yvOtJob0BbpHCN1Lm/FoYcawFhpLEi+lsoas8t57B8hEoKoYoSFqP6P3JMZNXf1JX2/770rWMH8x5mpHxWJR8KD9u8Dn3qPBmQE5G453Rc/XqOclK08MlkkELp1yHCfvg66vnPQ5FwTy9MQ9FMMJFbQ3o5WLm7yuohMwyT8rcSjGXs18cTjT4BZtzdrq5NrwSWSvTPxukHz4cWpi2kK1dZZKnrOOcFwxr9qTpbpAwtpReyul2o4XF/6LN7GY/kDd4YGtgf+IRmKuGXDemy97THJ2EG06eoDNEo6mxtMsy45y972PLWuD3up6nFvQ10jx9imspWY3o5I0XiKqlHSCCxNJyq7IHm3cj7cF8+7lUFJOKOlpsbqDhB593w5P/XkUGRhF4YrOCZv/WSrG+mBsvdNNEv+JeGg2pssAj6wJAy0n8B32DvTUzCL8iGMlZpJQAIfbFEJ pdYMgCGG eSpsg5au3RPb7JnfJGdMjw8byJsuru+f98l9vmwb+I6oTFoIp7qakXY+rF/7/4BovRO9flvfwkpgIbTVnbYgWChr1dGKVxRZnzzRhhCeNkGNJJ3PWYI0UEyepyN3KkO3vpRZkH72d/frqq5fvJtzVncOGvM9nE9fl1/UmUdPyjgLCXhZgw6Ok637SnKeALjG9rVo67n89s/X1JujaLy/V4nXfzqVWUpnZ8Ir/9tCnzSMONblA3w8N1w8vs+qOetWHdnjD3LRaDToUijmIjFbLj+C11X6SSlx2PaapQ/jd9+kMCnYpyKHTqHaOFwaDyJnIPnDFF49laMWooJwZCcLhvZPXBznjz2b/haiU0vtvwraVmgFslREn1ifqLO1DpoQmRTTCFbXRKQB3KFG+iB96883mTv7TwRvUvcHapn1YWRrbr+nf8rUpBbSdbzHuF7QY+Iu37DJJlHN4pqxqzZTlnKgyqe4HQ/bskgpclrNb8vY5zfoc//9WbvoFxS1GUasuN9Ktpl9QQIhhO0bTl9VF661j/LxaBahxGbLh 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/smb/client/*.c perl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g' fs/smb/client/*.c perl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g' fs/smb/client/*.c Reported-by: Matthew Wilcox Signed-off-by: David Howells cc: Jeff Layton cc: Steve French cc: Paulo Alcantara cc: Ronnie Sahlberg cc: Shyam Prasad N cc: Tom Talpey cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- fs/smb/client/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index b02b7f0a47dc..253e06a7875e 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -87,7 +87,7 @@ void cifs_pages_written_back(struct inode *inode, loff_t start, unsigned int len continue; if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -120,7 +120,7 @@ void cifs_pages_write_failed(struct inode *inode, loff_t start, unsigned int len continue; if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -151,7 +151,7 @@ void cifs_pages_write_redirty(struct inode *inode, loff_t start, unsigned int le xas_for_each(&xas, folio, end) { if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -2649,7 +2649,7 @@ static void cifs_extend_writeback(struct address_space *mapping, continue; if (xa_is_value(folio)) break; - if (folio_index(folio) != index) + if (folio->index != index) break; if (!folio_try_get_rcu(folio)) { xas_reset(&xas); @@ -2899,7 +2899,7 @@ static int cifs_writepages_region(struct address_space *mapping, goto skip_write; } - if (folio_mapping(folio) != mapping || + if (folio->mapping != mapping || !folio_test_dirty(folio)) { start += folio_size(folio); folio_unlock(folio);