[PATCH v4 04/10] ceph: convert ceph_wait_until_current_writes_complete() to folios
From: Tal Zussman
Date: Mon Aug 17 2026 - 15:18:59 EST
Iterate the writeback batch as folios rather than using
&folios[i]->page. Use ceph_folio_snap_context() for the snap context
check and folio_wait_writeback() instead of wait_on_page_writeback().
This removes one call to compound_head() and the last caller of
wait_on_page_writeback(). No functional change.
Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
fs/ceph/addr.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 60955060dd1b..5efc8c7c91df 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1648,7 +1648,7 @@ void ceph_wait_until_current_writes_complete(struct address_space *mapping,
struct writeback_control *wbc,
struct ceph_writeback_ctl *ceph_wbc)
{
- struct page *page;
+ struct folio *folio;
unsigned i, nr;
if (wbc->sync_mode != WB_SYNC_NONE &&
@@ -1663,10 +1663,10 @@ void ceph_wait_until_current_writes_complete(struct address_space *mapping,
PAGECACHE_TAG_WRITEBACK,
&ceph_wbc->fbatch))) {
for (i = 0; i < nr; i++) {
- page = &ceph_wbc->fbatch.folios[i]->page;
- if (page_snap_context(page) != ceph_wbc->snapc)
+ folio = ceph_wbc->fbatch.folios[i];
+ if (ceph_folio_snap_context(folio) != ceph_wbc->snapc)
continue;
- wait_on_page_writeback(page);
+ folio_wait_writeback(folio);
}
folio_batch_release(&ceph_wbc->fbatch);
--
2.39.5