lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240321082733.614329-3-wangkefeng.wang@huawei.com>
Date: Thu, 21 Mar 2024 16:27:32 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: Alexander Viro <viro@...iv.linux.org.uk>, Benjamin LaHaise
	<bcrl@...ck.org>, Christian Brauner <brauner@...nel.org>, Jan Kara
	<jack@...e.cz>, <linux-kernel@...r.kernel.org>, Matthew Wilcox
	<willy@...radead.org>
CC: <linux-aio@...ck.org>, <linux-fsdevel@...r.kernel.org>, Kefeng Wang
	<wangkefeng.wang@...wei.com>
Subject: [PATCH 2/3] fs: aio: use a folio in aio_free_ring()

Use a folio throughout aio_free_ring() to remove calls to compound_head().

Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
 fs/aio.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index d7f6c8705016..2c155be67b9a 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ