Re: [PATCH] genalloc: add support of named pool
From: Stephen Rothwell
Date: Fri Dec 16 2011 - 20:05:50 EST
Hi,
On Thu, 8 Dec 2011 16:50:08 +0100 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@xxxxxxxxxxxx> wrote:
>
> struct gen_pool {
> + char *name; /* pool name */
Any reason that this can't be "const char *"?
> +extern struct gen_pool *gen_pool_create_byname(char*, int, int);
const char *
> +extern struct gen_pool* gen_pool_byname(char *name);
const char *
> +/**
> * gen_pool_create - create a new special memory pool
gen_pool_create_byname
> +struct gen_pool *gen_pool_create_byname(char *name, int min_alloc_order, int nid)
const char *
> {
> struct gen_pool *pool;
>
> + if (gen_pool_byname(name))
> + return NULL;
> +
> pool = kmalloc_node(sizeof(struct gen_pool), GFP_KERNEL, nid);
> if (pool != NULL) {
> spin_lock_init(&pool->lock);
> INIT_LIST_HEAD(&pool->chunks);
> pool->min_alloc_order = min_alloc_order;
> }
> +
> + list_add_tail(&pool->list, &pools);
> return pool;
> }
I don't see where you assign pool->name to anything ...
--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/
Attachment:
pgp00000.pgp
Description: PGP signature