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) Signed-off-by: Tal Zussman --- 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 3d86e4c85b06..c08fc70321e6 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1637,7 +1637,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 && @@ -1652,10 +1652,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