[PATCH] xen: Rename xenmem_reservation_increase to xenmem_populate_physmap

Teddy Astie posted 1 patch 2 months, 1 week ago
drivers/xen/balloon.c         | 2 +-
drivers/xen/grant-table.c     | 2 +-
drivers/xen/mem-reservation.c | 4 ++--
include/xen/mem-reservation.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
[PATCH] xen: Rename xenmem_reservation_increase to xenmem_populate_physmap
Posted by Teddy Astie 2 months, 1 week ago
xenmem_reservation_increase currently calls XENMEM_populate_physmap.
Rename the function to avoid confusion with XENMEM_increase_reservation.

Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
---
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
 drivers/xen/balloon.c         | 2 +-
 drivers/xen/grant-table.c     | 2 +-
 drivers/xen/mem-reservation.c | 4 ++--
 include/xen/mem-reservation.h | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 2de37dcd7556..ac52dfd03be4 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -407,7 +407,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages)
 		page = balloon_next_page(page);
 	}
 
-	rc = xenmem_reservation_increase(nr_pages, frame_list);
+	rc = xenmem_populate_physmap(nr_pages, frame_list);
 	if (rc <= 0)
 		return BP_EAGAIN;
 
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 04a6b470b15d..e1a5041b4b8a 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1125,7 +1125,7 @@ int gnttab_dma_free_pages(struct gnttab_dma_alloc_args *args)
 	for (i = 0; i < args->nr_pages; i++)
 		args->frames[i] = page_to_xen_pfn(args->pages[i]);
 
-	ret = xenmem_reservation_increase(args->nr_pages, args->frames);
+	ret = xenmem_populate_physmap(args->nr_pages, args->frames);
 	if (ret != args->nr_pages) {
 		pr_debug("Failed to increase reservation for DMA buffer\n");
 		ret = -EFAULT;
diff --git a/drivers/xen/mem-reservation.c b/drivers/xen/mem-reservation.c
index 24648836e0d4..332eab71e977 100644
--- a/drivers/xen/mem-reservation.c
+++ b/drivers/xen/mem-reservation.c
@@ -83,7 +83,7 @@ EXPORT_SYMBOL_GPL(__xenmem_reservation_va_mapping_reset);
 #endif /* CONFIG_XEN_HAVE_PVMMU */
 
 /* @frames is an array of PFNs */
-int xenmem_reservation_increase(int count, xen_pfn_t *frames)
+int xenmem_populate_physmap(int count, xen_pfn_t *frames)
 {
 	struct xen_memory_reservation reservation = {
 		.address_bits = 0,
@@ -96,7 +96,7 @@ int xenmem_reservation_increase(int count, xen_pfn_t *frames)
 	reservation.nr_extents = count;
 	return HYPERVISOR_memory_op(XENMEM_populate_physmap, &reservation);
 }
-EXPORT_SYMBOL_GPL(xenmem_reservation_increase);
+EXPORT_SYMBOL_GPL(xenmem_populate_physmap);
 
 /* @frames is an array of GFNs */
 int xenmem_reservation_decrease(int count, xen_pfn_t *frames)
diff --git a/include/xen/mem-reservation.h b/include/xen/mem-reservation.h
index a2ab516fcd2c..e2b78a517cd1 100644
--- a/include/xen/mem-reservation.h
+++ b/include/xen/mem-reservation.h
@@ -53,7 +53,7 @@ static inline void xenmem_reservation_va_mapping_reset(unsigned long count,
 #endif
 }
 
-int xenmem_reservation_increase(int count, xen_pfn_t *frames);
+int xenmem_populate_physmap(int count, xen_pfn_t *frames);
 
 int xenmem_reservation_decrease(int count, xen_pfn_t *frames);
 
-- 
2.50.1



Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
Re: [PATCH] xen: Rename xenmem_reservation_increase to xenmem_populate_physmap
Posted by Jürgen Groß 2 months, 1 week ago
On 25.07.25 12:12, Teddy Astie wrote:
> xenmem_reservation_increase currently calls XENMEM_populate_physmap.
> Rename the function to avoid confusion with XENMEM_increase_reservation.

Hmm, I'm not convinced this is a good move.

xenmem_reservation_increase() has the counterpart xenmem_reservation_decrease(),
which shouldn't change its name.

So for the caller the naming is consistent. It is just the implementation which
is using a different hypercall. IMO such a detail should not be propagated to
higher logical levels.


Juergen