linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@saeurebad.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Linux MM <linux-mm@kvack.org>
Subject: [RFC][patch 4/5] mm: Normalize internal argument passing of bootmem data
Date: Wed, 16 Apr 2008 13:36:33 +0200	[thread overview]
Message-ID: <20080416113719.395268372@skyscraper.fehenstaub.lan> (raw)
In-Reply-To: <20080416113629.947746497@skyscraper.fehenstaub.lan>

[-- Attachment #1: 0004-bootmem-Normalize-internal-argument-passing-of-boot.patch --]
[-- Type: text/plain, Size: 2700 bytes --]

All _core functions only need the bootmem data, not the node
descriptor.  Adjust the two functions that take a node descriptor
unneededly.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
---
 mm/bootmem.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

Index: tree-linus/mm/bootmem.c
===================================================================
--- tree-linus.orig/mm/bootmem.c
+++ tree-linus/mm/bootmem.c
@@ -85,10 +85,9 @@ static unsigned long __init get_mapsize(
 /*
  * Called once to set up the allocator itself.
  */
-static unsigned long __init init_bootmem_core(pg_data_t *pgdat,
+static unsigned long __init init_bootmem_core(bootmem_data_t *bdata,
 	unsigned long mapstart, unsigned long start, unsigned long end)
 {
-	bootmem_data_t *bdata = pgdat->bdata;
 	unsigned long mapsize;
 
 	bdata->node_bootmem_map = phys_to_virt(PFN_PHYS(mapstart));
@@ -314,11 +313,10 @@ found:
 	return ret;
 }
 
-static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat)
+static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
 {
 	struct page *page;
 	unsigned long pfn;
-	bootmem_data_t *bdata = pgdat->bdata;
 	unsigned long i, count, total = 0;
 	unsigned long idx;
 	unsigned long *map; 
@@ -384,7 +382,7 @@ static unsigned long __init free_all_boo
 unsigned long __init init_bootmem_node(pg_data_t *pgdat, unsigned long freepfn,
 				unsigned long startpfn, unsigned long endpfn)
 {
-	return init_bootmem_core(pgdat, freepfn, startpfn, endpfn);
+	return init_bootmem_core(pgdat->bdata, freepfn, startpfn, endpfn);
 }
 
 void __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
@@ -401,14 +399,14 @@ void __init free_bootmem_node(pg_data_t 
 
 unsigned long __init free_all_bootmem_node(pg_data_t *pgdat)
 {
-	return free_all_bootmem_core(pgdat);
+	return free_all_bootmem_core(pgdat->bdata);
 }
 
 unsigned long __init init_bootmem(unsigned long start, unsigned long pages)
 {
 	max_low_pfn = pages;
 	min_low_pfn = start;
-	return init_bootmem_core(NODE_DATA(0), start, 0, pages);
+	return init_bootmem_core(NODE_DATA(0)->bdata, start, 0, pages);
 }
 
 #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
@@ -451,7 +449,7 @@ void __init free_bootmem(unsigned long a
 
 unsigned long __init free_all_bootmem(void)
 {
-	return free_all_bootmem_core(NODE_DATA(0));
+	return free_all_bootmem_core(NODE_DATA(0)->bdata);
 }
 
 void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align,

-- 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2008-04-16 11:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-16 11:36 [RFC][patch 0/5] Bootmem fixes Johannes Weiner
2008-04-16 11:36 ` [RFC][patch 1/5] mm: Revert "mm: fix boundary checking in free_bootmem_core" Johannes Weiner
2008-04-16 17:49   ` Yinghai Lu
2008-04-16 11:36 ` [RFC][patch 2/5] mm: Node-setup agnostic free_bootmem() Johannes Weiner
2008-04-16 17:54   ` Yinghai Lu
2008-04-16 18:44     ` Yinghai Lu
2008-04-16 18:48       ` Ingo Molnar
2008-04-16 19:17         ` Johannes Weiner
2008-04-18  5:06           ` Yinghai Lu
2008-04-16 19:19     ` Johannes Weiner
2008-04-16 11:36 ` [RFC][patch 3/5] mm: Unexport __alloc_bootmem_core() Johannes Weiner
2008-04-16 11:36 ` Johannes Weiner [this message]
2008-04-16 11:36 ` [RFC][patch 5/5] mm: Move bootmem descriptors definition to a single place Johannes Weiner
2008-04-16 17:30   ` Ralf Baechle
2008-04-17  9:36 ` [RFC][patch 0/5] Bootmem fixes KAMEZAWA Hiroyuki
2008-04-17 10:49   ` Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080416113719.395268372@skyscraper.fehenstaub.lan \
    --to=hannes@saeurebad.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox