Commit 6bf9b5b4 authored by Luiz Capitulino's avatar Luiz Capitulino Committed by Andrew Morton
Browse files

mm: alloc_pages_bulk: rename API

The previous commit removed the page_list argument from
alloc_pages_bulk_noprof() along with the alloc_pages_bulk_list() function.

Now that only the *_array() flavour of the API remains, we can do the
following renaming (along with the _noprof() ones):

  alloc_pages_bulk_array -> alloc_pages_bulk
  alloc_pages_bulk_array_mempolicy -> alloc_pages_bulk_mempolicy
  alloc_pages_bulk_array_node -> alloc_pages_bulk_node

Link: https://lkml.kernel.org/r/275a3bbc0be20fbe9002297d60045e67ab3d4ada.1734991165.git.luizcap@redhat.com


Signed-off-by: default avatarLuiz Capitulino <luizcap@redhat.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent c8b97953
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -624,10 +624,10 @@ static int alloc_private_pages(struct hmm_buffer_object *bo)
	const gfp_t gfp = __GFP_NOWARN | __GFP_RECLAIM | __GFP_FS;
	int ret;

	ret = alloc_pages_bulk_array(gfp, bo->pgnr, bo->pages);
	ret = alloc_pages_bulk(gfp, bo->pgnr, bo->pages);
	if (ret != bo->pgnr) {
		free_pages_bulk_array(ret, bo->pages);
		dev_err(atomisp_dev, "alloc_pages_bulk_array() failed\n");
		dev_err(atomisp_dev, "alloc_pages_bulk() failed\n");
		return -ENOMEM;
	}

+7 −7
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ void mlx5vf_free_data_buffer(struct mlx5_vhca_data_buffer *buf)
				  buf->dma_dir, 0);
	}

	/* Undo alloc_pages_bulk_array() */
	/* Undo alloc_pages_bulk() */
	for_each_sgtable_page(&buf->table.sgt, &sg_iter, 0)
		__free_page(sg_page_iter_page(&sg_iter));
	sg_free_append_table(&buf->table);
@@ -431,7 +431,7 @@ static int mlx5vf_add_migration_pages(struct mlx5_vhca_data_buffer *buf,
		return -ENOMEM;

	do {
		filled = alloc_pages_bulk_array(GFP_KERNEL_ACCOUNT, to_fill,
		filled = alloc_pages_bulk(GFP_KERNEL_ACCOUNT, to_fill,
					  page_list);
		if (!filled) {
			ret = -ENOMEM;
@@ -1342,7 +1342,7 @@ static void free_recv_pages(struct mlx5_vhca_recv_buf *recv_buf)
{
	int i;

	/* Undo alloc_pages_bulk_array() */
	/* Undo alloc_pages_bulk() */
	for (i = 0; i < recv_buf->npages; i++)
		__free_page(recv_buf->page_list[i]);

@@ -1361,7 +1361,7 @@ static int alloc_recv_pages(struct mlx5_vhca_recv_buf *recv_buf,
		return -ENOMEM;

	for (;;) {
		filled = alloc_pages_bulk_array(GFP_KERNEL_ACCOUNT,
		filled = alloc_pages_bulk(GFP_KERNEL_ACCOUNT,
					  npages - done,
					  recv_buf->page_list + done);
		if (!filled)
+3 −3
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ static int virtiovf_add_migration_pages(struct virtiovf_data_buffer *buf,
		return -ENOMEM;

	do {
		filled = alloc_pages_bulk_array(GFP_KERNEL_ACCOUNT, to_fill,
		filled = alloc_pages_bulk(GFP_KERNEL_ACCOUNT, to_fill,
					  page_list);
		if (!filled) {
			ret = -ENOMEM;
@@ -112,7 +112,7 @@ static void virtiovf_free_data_buffer(struct virtiovf_data_buffer *buf)
{
	struct sg_page_iter sg_iter;

	/* Undo alloc_pages_bulk_array() */
	/* Undo alloc_pages_bulk() */
	for_each_sgtable_page(&buf->table.sgt, &sg_iter, 0)
		__free_page(sg_page_iter_page(&sg_iter));
	sg_free_append_table(&buf->table);
+1 −1
Original line number Diff line number Diff line
@@ -632,7 +632,7 @@ int btrfs_alloc_page_array(unsigned int nr_pages, struct page **page_array,
	for (allocated = 0; allocated < nr_pages;) {
		unsigned int last = allocated;

		allocated = alloc_pages_bulk_array(gfp, nr_pages, page_array);
		allocated = alloc_pages_bulk(gfp, nr_pages, page_array);
		if (unlikely(allocated == last)) {
			/* No progress, fail and do cleanup. */
			for (int i = 0; i < allocated; i++) {
+2 −2
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ int z_erofs_gbuf_growsize(unsigned int nrpages)
			tmp_pages[j] = gbuf->pages[j];
		do {
			last = j;
			j = alloc_pages_bulk_array(GFP_KERNEL, nrpages,
			j = alloc_pages_bulk(GFP_KERNEL, nrpages,
					     tmp_pages);
			if (last == j)
				goto out;
Loading