On Tuesday 07 August 2007 07:34, Michael S. Tsirkin wrote:
> Hmm, I thought about it some more.
> kmem_cache struct is not exported on recent kernels,
> so this might br hard to do.
I looked at slab.h in various kernel and see this function
extern unsigned int kmem_cache_size(kmem_cache_t *);
which returns buffer_size that is set by kmem_cache_create() to size.
So the backport will look like:
static inline
void *kmem_cache_zalloc(kmem_cache_t *cache, gfp_t flags)
{
        void *ret = kmem_cache_alloc(cache, flags);
        if (ret)
                memset(ret, 0, kmem_cache_size(cache));
        return ret;
}
Would you agree? Do I oversee something else?

Nam

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to