Rename the SLAB_DESTROY_BY_RCU flag into SLAB_TYPESAFE_BY_RCU in the LinuxKPI

to be compatible with Linux.

MFC after:	1 week
Requested by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
This commit is contained in:
hselasky 2018-03-04 18:04:37 +00:00
parent 50932dab8f
commit 3f07451c55
2 changed files with 5 additions and 5 deletions

View File

@ -79,7 +79,7 @@ struct linux_kmem_cache {
};
#define SLAB_HWCACHE_ALIGN (1 << 0)
#define SLAB_DESTROY_BY_RCU (1 << 1)
#define SLAB_TYPESAFE_BY_RCU (1 << 1)
#define SLAB_RECLAIM_ACCOUNT (1 << 2)
static inline gfp_t
@ -162,7 +162,7 @@ extern void linux_kmem_cache_free_rcu(struct linux_kmem_cache *, void *);
static inline void
linux_kmem_cache_free(struct linux_kmem_cache *c, void *m)
{
if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU))
if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU))
linux_kmem_cache_free_rcu(c, m);
else
uma_zfree(c->cache_zone, m);

View File

@ -49,7 +49,7 @@ linux_kmem_ctor(void *mem, int size, void *arg, int flags)
{
struct linux_kmem_cache *c = arg;
if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU)) {
if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) {
struct linux_kmem_rcu *rcu = LINUX_KMEM_TO_RCU(c, mem);
/* duplicate cache pointer */
@ -85,7 +85,7 @@ linux_kmem_cache_create(const char *name, size_t size, size_t align,
else if (align != 0)
align--;
if (flags & SLAB_DESTROY_BY_RCU) {
if (flags & SLAB_TYPESAFE_BY_RCU) {
/* make room for RCU structure */
size = ALIGN(size, sizeof(void *));
size += sizeof(struct linux_kmem_rcu);
@ -118,7 +118,7 @@ linux_kmem_cache_free_rcu(struct linux_kmem_cache *c, void *m)
void
linux_kmem_cache_destroy(struct linux_kmem_cache *c)
{
if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU)) {
if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) {
/* make sure all free callbacks have been called */
rcu_barrier();
}