Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/slab.h
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static inline void | static inline void | ||||
kfree(const void *ptr) | kfree(const void *ptr) | ||||
{ | { | ||||
free(__DECONST(void *, ptr), M_KMALLOC); | free(__DECONST(void *, ptr), M_KMALLOC); | ||||
} | } | ||||
static inline size_t | |||||
ksize(const void *ptr) | |||||
{ | |||||
return (malloc_usable_size(ptr)); | |||||
} | |||||
extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name, | extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name, | ||||
size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor); | size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor); | ||||
static inline void * | static inline void * | ||||
linux_kmem_cache_alloc(struct linux_kmem_cache *c, gfp_t flags) | linux_kmem_cache_alloc(struct linux_kmem_cache *c, gfp_t flags) | ||||
{ | { | ||||
return (uma_zalloc_arg(c->cache_zone, c, | return (uma_zalloc_arg(c->cache_zone, c, | ||||
linux_check_m_flags(flags))); | linux_check_m_flags(flags))); | ||||
Show All 14 Lines | linux_kmem_cache_free(struct linux_kmem_cache *c, void *m) | ||||
if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) | if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) | ||||
linux_kmem_cache_free_rcu(c, m); | linux_kmem_cache_free_rcu(c, m); | ||||
else | else | ||||
uma_zfree(c->cache_zone, m); | uma_zfree(c->cache_zone, m); | ||||
} | } | ||||
extern void linux_kmem_cache_destroy(struct linux_kmem_cache *); | extern void linux_kmem_cache_destroy(struct linux_kmem_cache *); | ||||
#endif /* _LINUX_SLAB_H_ */ | #endif /* _LINUX_SLAB_H_ */ | ||||
kib: Can we drop all that extern from function declarations in linuxkpi ? |
Can we drop all that extern from function declarations in linuxkpi ?