[PATCH 4/6] mm/page_io: rename bio_associate_blkg_from_page()

From: Tal Zussman

Date: Thu Aug 06 2026 - 18:59:48 EST


This function takes a folio. Rename it to
bio_associate_blkg_from_folio() accordingly. While at it, convert the
macro in the !CONFIG_MEMCG || !CONFIG_BLK_CGROUP case to a function.

Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
mm/page_io.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index c6d0949b3f1e..8573f7b8967a 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -276,7 +276,7 @@ static bool folio_blkg_can_merge(struct folio *folio, struct folio *prev_folio)
return can_merge;
}

-static void bio_associate_blkg_from_page(struct bio *bio, struct folio *folio)
+static void bio_associate_blkg_from_folio(struct bio *bio, struct folio *folio)
{
struct cgroup_subsys_state *css;

@@ -297,7 +297,9 @@ static bool folio_blkg_can_merge(struct folio *folio, struct folio *prev_folio)
{
return true;
}
-#define bio_associate_blkg_from_page(bio, folio) do { } while (0)
+static void bio_associate_blkg_from_folio(struct bio *bio, struct folio *folio)
+{
+}
#endif /* CONFIG_MEMCG && CONFIG_BLK_CGROUP */

struct swap_iocb {
@@ -595,7 +597,7 @@ static void swap_bdev_submit_write(struct swap_io_ctx *ctx)
REQ_OP_WRITE | REQ_SWAP);
bio->bi_iter.bi_size = sio->len;
bio->bi_iter.bi_sector = swap_folio_sector(bio_first_folio_all(bio));
- bio_associate_blkg_from_page(bio, bio_first_folio_all(bio));
+ bio_associate_blkg_from_folio(bio, bio_first_folio_all(bio));

if (ctx->sis->flags & SWP_SYNCHRONOUS_IO) {
submit_bio_wait(bio);

--
2.39.5