MINOR: memory: Only init the pool spinlock once.

In pool_create(), only initialize the pool spinlock if we just created the
pool, in the event we're reusing it, there's no need to initialize it again.
This commit is contained in:
Olivier Houchard 2020-02-01 17:45:32 +01:00
parent b6fa08bc7b
commit 8af97eb4a1

View File

@ -139,11 +139,11 @@ struct pool_head *create_pool(char *name, unsigned int size, unsigned int flags)
for (thr = 0; thr < MAX_THREADS; thr++)
pool_cache[thr][idx].size = size;
}
}
pool->users++;
#ifndef CONFIG_HAP_LOCKLESS_POOLS
HA_SPIN_INIT(&pool->lock);
#endif
}
pool->users++;
return pool;
}