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

Pekka Enberg
2005-11-19T12:05:05Z

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@cs.helsinki.fi>

Pekka