Re: [PATCH: 009/017]Memory hotplug for new nodes v.4.(add return code init_currently_empty_zone)

From: Dave Hansen <haveblue_at_us.ibm.com>
Date: 2006-03-18 04:19:11
On Fri, 2006-03-17 at 17:22 +0900, Yasunori Goto wrote:
> --- pgdat8.orig/mm/memory_hotplug.c	2006-03-16 16:05:38.000000000 +0900
> +++ pgdat8/mm/memory_hotplug.c	2006-03-16 16:45:30.000000000 +0900
> @@ -26,16 +26,23 @@
>  
>  extern void zonetable_add(struct zone *zone, int nid, int zid, unsigned long pfn,
>  			  unsigned long size);
> -static void __add_zone(struct zone *zone, unsigned long phys_start_pfn)
> +static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
>  {
>  	struct pglist_data *pgdat = zone->zone_pgdat;
>  	int nr_pages = PAGES_PER_SECTION;
>  	int nid = pgdat->node_id;
>  	int zone_type;
> +	int ret = 0;
>  
>  	zone_type = zone - pgdat->node_zones;
> +	if (!populated_zone(zone)) {
> +		ret = init_currently_empty_zone(zone, phys_start_pfn, nr_pages);
> +		if (ret < 0)
> +			return ret;
> +	}
>  	memmap_init_zone(nr_pages, nid, zone_type, phys_start_pfn);
>  	zonetable_add(zone, nid, zone_type, phys_start_pfn, nr_pages);
> +	return 0;
>  }

Minor nit: If you're going to introduce a top-level 'ret' variable, it
is probably best to just use it everywhere.  In this case, you only use
it inside of that if(), so you _could_ declare it in there.

-- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Mar 18 04:21:06 2006

This archive was generated by hypermail 2.1.8 : 2006-03-18 04:21:23 EST