From 15e28e8d45273677a31fad76102acc3bc4cf88f6 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 7 Oct 2002 20:38:55 -0700 Subject: [PATCH] remove get_free_page() This used to be a macro wrapper around get_zeroed_page(). It was a dreadful choice of name, because it hid the fact that this function memsets the page. Probably, lots of the callers didn't actually want to do that but this patch does not make such optimisations. At least now, people may spot a `get_zeroed_page' in there and realise that the page doesn't actually need to be initialised. The patch also changes get_zeroed_page() to go BUG if called with __GFP_HIGHMEM. It returns the address of the page's memory and hence can only be used for direct-mapped pages (wli). --- kernel/suspend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel') diff --git a/kernel/suspend.c b/kernel/suspend.c index 6eec7ed03b07..2aa820a6092b 100644 --- a/kernel/suspend.c +++ b/kernel/suspend.c @@ -393,7 +393,7 @@ static int write_suspend_image(void) int i; swp_entry_t entry, prev = { 0 }; int nr_pgdir_pages = SUSPEND_PD_PAGES(nr_copy_pages); - union diskpage *cur, *buffer = (union diskpage *)get_free_page(GFP_ATOMIC); + union diskpage *cur, *buffer = (union diskpage *)get_zeroed_page(GFP_ATOMIC); unsigned long address; struct page *page; @@ -554,7 +554,7 @@ static suspend_pagedir_t *create_suspend_pagedir(int nr_copy_pages) SetPageNosave(page++); while(nr_copy_pages--) { - p->address = get_free_page(GFP_ATOMIC); + p->address = get_zeroed_page(GFP_ATOMIC); if(!p->address) { free_suspend_pagedir((unsigned long) pagedir); return NULL; @@ -923,7 +923,7 @@ static int check_pagedir(void) unsigned long addr; do { - addr = get_free_page(GFP_ATOMIC); + addr = get_zeroed_page(GFP_ATOMIC); if(!addr) return -ENOMEM; } while (does_collide(addr)); @@ -1139,7 +1139,7 @@ static int read_suspend_image(const char * specialfile, int noresume) int error; resume_device = name_to_kdev_t(specialfile); - scratch_page = get_free_page(GFP_ATOMIC); + scratch_page = get_zeroed_page(GFP_ATOMIC); cur = (void *) scratch_page; if (cur) { struct block_device *bdev; -- cgit v1.2.3