Skip to contentSkip to conversation

kmem_cache_init ()

DISCUSSION [email protected] 1 participant 1 message May 14, 2001

lore
Share & tools
lore
#0 lore raw

Hi,
I was unable to understand the logic of the following sanity checks in
slab.c/kmem_cache_init ().

if (kmem_cache_diff(c_firstp,c_magic) != kmem_slab_diff(s_nextp,s_magic) || kmem_cache_diff(c_firstp,c_inuse) != kmem_slab_diff(s_nextp,s_inuse) || kmem_cache_offset(c_lastp) - ((unsigned long) kmem_slab_end((kmem_cache_t *)NULL)) != kmem_slab_offset(s_prevp) || kmem_cache_diff(c_lastp,c_firstp) !=

kmem_slab_diff(s_prevp,s_nextp)) {
     /** offsets to the magic are incorrect **/
}

can someone throw some light behind the above logic

Thanks
Amol