From 015244c23938be2ce452edd2ff9adadfcf9423c7 Mon Sep 17 00:00:00 2001 From: Tal Zussman Date: Wed, 2 Sep 2026 12:11:28 -0400 Subject: [PATCH] ceph: convert ceph_wait_until_current_writes_complete() to folios 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. Signed-off-by: Tal Zussman Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Alex Markuze Signed-off-by: Ilya Dryomov --- 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 a0c18b93182a..d735b45fc2b2 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1671,7 +1671,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 && @@ -1686,10 +1686,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);