From 5b867819167600770688dd31b3e1836e0ee50f3d Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Wed, 28 May 2014 13:08:22 +0200 Subject: [PATCH] Mempool: Do not count the struct mempool to its stats.used_size. --- ucw/mempool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ucw/mempool.c b/ucw/mempool.c index 1048686f..a66615ab 100644 --- a/ucw/mempool.c +++ b/ucw/mempool.c @@ -221,7 +221,8 @@ mp_stats(struct mempool *pool, struct mempool_stats *stats) ASSERT(stats->total_size == pool->total_size); stats->used_size = stats->chain_size[0] + stats->chain_size[1] - MP_CHUNK_TAIL * (stats->chain_count[0] + stats->chain_count[1]) - - pool->state.free[0] - pool->state.free[1]; + - pool->state.free[0] - pool->state.free[1] - sizeof(*pool); + ASSERT(stats->used_size < stats->total_size); } u64 -- 2.39.2