Re: [PATCH 1/5] slab: rename obj_reallen to obj_size

From: Pekka Enberg
Date: Sat Nov 19 2005 - 07:04:50 EST


Hi Manfred,

On Sat, 2005-11-19 at 12:57 +0100, Manfred Spraul wrote:
> With your change, cachep->objsize is the internal allocation and
> obj_size(cachep) is the user visible part. This reduces the readability.
> I agree that the names obj_size and reallen are bad. What about the
> attached patch?

I like your patch a lot. Some comments below.

> + /*
> + * If debugging is enabled, then the allocator can add additional
> + * fields and/or padding to every object. objsize contains the total
> + * object size including these internal fields, the following two
> + * variables contain the offset to the user object and its size.
> + */
> + int user_off;

user_offset is more readable.

> + int user_size;

> #endif
> };
> -static int obj_dbghead(kmem_cache_t *cachep)
> +static int obj_user_off(kmem_cache_t *cachep)

So why not call the above obj_offset() ?

> -static int obj_reallen(kmem_cache_t *cachep)
> +static int obj_user_size(kmem_cache_t *cachep)

and this one obj_size() ?

Other than that looks good.

Acked-by: Pekka Enberg <penberg@xxxxxxxxxxxxxx>

Pekka

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/