Re: [RFC] SL[AUO]B common code 3/9] Extract common fields from struct kmem_cache

Christoph Lameter
2012-05-18T13:57:42Z

On Fri, 18 May 2012, Pekka Enberg wrote:

> Why not make a "struct kmem_cache_common" structure and use that? You can
> embed it in "struct kmem_cache" just fine.

Tried that but I ended up with having to qualify all common variables.

I.e.

struct kmem_cache {
struct kmem_cache_common {
int a,b
} common
} kmem_cache;

requires

kmemcache->common.a

instead of

kmemcache->a

That in turn requires significant changes to all allocators.