Skip to content

Commit 5ea0a35

Browse files
Kefeng Wangbrauner
authored andcommitted
fs: aio: use a folio in aio_free_ring()
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> Link: https://lore.kernel.org/r/20240321131640.948634-3-wangkefeng.wang@huawei.com Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 75a07b5 commit 5ea0a35

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

fs/aio.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,15 @@ static void aio_free_ring(struct kioctx *ctx)
334334
put_aio_ring_file(ctx);
335335

336336
for (i = 0; i < ctx->nr_pages; i++) {
337-
struct page *page;
338-
pr_debug("pid(%d) [%d] page->count=%d\n", current->pid, i,
339-
page_count(ctx->ring_pages[i]));
340-
page = ctx->ring_pages[i];
341-
if (!page)
337+
struct folio *folio = page_folio(ctx->ring_pages[i]);
338+
339+
if (!folio)
342340
continue;
341+
342+
pr_debug("pid(%d) [%d] folio->count=%d\n", current->pid, i,
343+
folio_ref_count(folio));
343344
ctx->ring_pages[i] = NULL;
344-
put_page(page);
345+
folio_put(folio);
345346
}
346347

347348
if (ctx->ring_pages && ctx->ring_pages != ctx->internal_pages) {

0 commit comments

Comments
 (0)