summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2017-01-10 19:58:06 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-10 21:31:55 -0500
commit8c2dd3e4a4bae78093c4a5cee6494877651be3c9 (patch)
treed615ea6a6e65bbe9fba82d7c944ad3e762bd1f8d /mm/page_alloc.c
parentb4536f0c829c8586544c94735c343f9b5070bd01 (diff)
mm: rename __alloc_page_frag to page_frag_alloc and __free_page_frag to page_frag_free
Patch series "Page fragment updates", v4. This patch series takes care of a few cleanups for the page fragments API. First we do some renames so that things are much more consistent. First we move the page_frag_ portion of the name to the front of the functions names. Secondly we split out the cache specific functions from the other page fragment functions by adding the word "cache" to the name. Finally I added a bit of documentation that will hopefully help to explain some of this. I plan to revisit this later as we get things more ironed out in the near future with the changes planned for the DMA setup to support eXpress Data Path. This patch (of 3): This patch renames the page frag functions to be more consistent with other APIs. Specifically we place the name page_frag first in the name and then have either an alloc or free call name that we append as the suffix. This makes it a bit clearer in terms of naming. In addition we drop the leading double underscores since we are technically no longer a backing interface and instead the front end that is called from the networking APIs. Link: http://lkml.kernel.org/r/20170104023854.13451.67390.stgit@localhost.localdomain Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 74afdb4177cb..097893ffe194 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3931,8 +3931,8 @@ void __page_frag_drain(struct page *page, unsigned int order,
3931} 3931}
3932EXPORT_SYMBOL(__page_frag_drain); 3932EXPORT_SYMBOL(__page_frag_drain);
3933 3933
3934void *__alloc_page_frag(struct page_frag_cache *nc, 3934void *page_frag_alloc(struct page_frag_cache *nc,
3935 unsigned int fragsz, gfp_t gfp_mask) 3935 unsigned int fragsz, gfp_t gfp_mask)
3936{ 3936{
3937 unsigned int size = PAGE_SIZE; 3937 unsigned int size = PAGE_SIZE;
3938 struct page *page; 3938 struct page *page;
@@ -3983,19 +3983,19 @@ refill:
3983 3983
3984 return nc->va + offset; 3984 return nc->va + offset;
3985} 3985}
3986EXPORT_SYMBOL(__alloc_page_frag); 3986EXPORT_SYMBOL(page_frag_alloc);
3987 3987
3988/* 3988/*
3989 * Frees a page fragment allocated out of either a compound or order 0 page. 3989 * Frees a page fragment allocated out of either a compound or order 0 page.
3990 */ 3990 */
3991void __free_page_frag(void *addr) 3991void page_frag_free(void *addr)
3992{ 3992{
3993 struct page *page = virt_to_head_page(addr); 3993 struct page *page = virt_to_head_page(addr);
3994 3994
3995 if (unlikely(put_page_testzero(page))) 3995 if (unlikely(put_page_testzero(page)))
3996 __free_pages_ok(page, compound_order(page)); 3996 __free_pages_ok(page, compound_order(page));
3997} 3997}
3998EXPORT_SYMBOL(__free_page_frag); 3998EXPORT_SYMBOL(page_frag_free);
3999 3999
4000static void *make_alloc_exact(unsigned long addr, unsigned int order, 4000static void *make_alloc_exact(unsigned long addr, unsigned int order,
4001 size_t size) 4001 size_t size)