From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Benjamin LaHaise <bcrl@kvack.org>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
<linux-kernel@vger.kernel.org>,
Matthew Wilcox <willy@infradead.org>
Cc: <linux-aio@kvack.org>, <linux-fsdevel@vger.kernel.org>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH v2 2/3] fs: aio: use a folio in aio_free_ring()
Date: Thu, 21 Mar 2024 21:16:39 +0800 [thread overview]
Message-ID: <20240321131640.948634-3-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20240321131640.948634-1-wangkefeng.wang@huawei.com>
Use a folio throughout aio_free_ring() to remove calls to compound_head(),
also move pr_debug after folio check to remove unnecessary print.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
fs/aio.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/aio.c b/fs/aio.c
index 60da236ad575..738654b58bfb 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -334,14 +334,15 @@ static void aio_free_ring(struct kioctx *ctx)
put_aio_ring_file(ctx);
for (i = 0; i < ctx->nr_pages; i++) {
- struct page *page;
- pr_debug("pid(%d) [%d] page->count=%d\n", current->pid, i,
- page_count(ctx->ring_pages[i]));
- page = ctx->ring_pages[i];
- if (!page)
+ struct folio *folio = page_folio(ctx->ring_pages[i]);
+
+ if (!folio)
continue;
+
+ pr_debug("pid(%d) [%d] folio->count=%d\n", current->pid, i,
+ folio_ref_count(folio));
ctx->ring_pages[i] = NULL;
- put_page(page);
+ folio_put(folio);
}
if (ctx->ring_pages && ctx->ring_pages != ctx->internal_pages) {
--
2.27.0
next prev parent reply other threads:[~2024-03-21 13:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 13:16 [PATCH v2 0/3] fs: aio: more folio conversion Kefeng Wang
2024-03-21 13:16 ` [PATCH v2 1/3] fs: aio: use a folio in aio_setup_ring() Kefeng Wang
2024-03-21 13:16 ` Kefeng Wang [this message]
2024-03-21 13:16 ` [PATCH v2 3/3] fs: aio: convert to ring_folios and internal_folios Kefeng Wang
2024-03-22 14:12 ` [PATCH v2 0/3] fs: aio: more folio conversion Christian Brauner
2024-03-25 19:50 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240321131640.948634-3-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=bcrl@kvack.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®