The page allocated in io_mem_alloc_compound() is actually used as a folio later in io_region_mmap(). So allocate a folio instead of a compound page and rename io_mem_alloc_compound() to io_mem_alloc_folio(). This prepares for code separation of compound page and folio in a follow-up commit. Signed-off-by: Zi Yan --- io_uring/memmap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/io_uring/memmap.c b/io_uring/memmap.c index 7d3c5eb58480..8ed8a78d71cc 100644 --- a/io_uring/memmap.c +++ b/io_uring/memmap.c @@ -15,10 +15,10 @@ #include "rsrc.h" #include "zcrx.h" -static bool io_mem_alloc_compound(struct page **pages, int nr_pages, +static bool io_mem_alloc_folio(struct page **pages, int nr_pages, size_t size, gfp_t gfp) { - struct page *page; + struct folio *folio; int i, order; order = get_order(size); @@ -27,12 +27,12 @@ static bool io_mem_alloc_compound(struct page **pages, int nr_pages, else if (order) gfp |= __GFP_COMP; - page = alloc_pages(gfp, order); - if (!page) + folio = folio_alloc(gfp, order); + if (!folio) return false; for (i = 0; i < nr_pages; i++) - pages[i] = page + i; + pages[i] = folio_page(folio, i); return true; } @@ -162,7 +162,7 @@ static int io_region_allocate_pages(struct io_mapped_region *mr, if (!pages) return -ENOMEM; - if (io_mem_alloc_compound(pages, mr->nr_pages, size, gfp)) { + if (io_mem_alloc_folio(pages, mr->nr_pages, size, gfp)) { mr->flags |= IO_REGION_F_SINGLE_REF; goto done; } -- 2.51.0