diff options
author | Kefeng Wang <wangkefeng.wang@huawei.com> | 2024-03-21 14:16:39 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-04-05 15:53:46 +0200 |
commit | 5ea0a35511895f10b965e24ed6f11adae47668d2 (patch) | |
tree | e30fd4624137b4e2709929e226052715858e1314 /fs/aio.c | |
parent | fs: aio: use a folio in aio_setup_ring() (diff) | |
download | linux-5ea0a35511895f10b965e24ed6f11adae47668d2.tar.xz linux-5ea0a35511895f10b965e24ed6f11adae47668d2.zip |
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>
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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) { |