887953
From 9080a49b75c2802f7739cb631050c8befa9ae760 Mon Sep 17 00:00:00 2001
887953
From: Mohit Agrawal <moagrawa@redhat.com>
887953
Date: Mon, 31 Dec 2018 13:52:27 +0530
887953
Subject: [PATCH 498/498] mem-pool: Code refactor in mem_pool.c
887953
887953
Problem: In the last commit 10868bfc5ed099a90fbfd2310bc89c299475d94e
887953
         the patch was not complete according to upstream commit.
887953
887953
Solution: Update some changes to match with an upstream patch.
887953
887953
BUG: 1648893
887953
> Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
887953
> Reviewed-on: https://code.engineering.redhat.com/gerrit/159029
887953
> Tested-by: RHGS Build Bot <nigelb@redhat.com>
887953
> Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
887953
Change-Id: I924ba4967ce28ece6329dbda3e0309b79784fbe7
887953
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/159628
887953
Tested-by: RHGS Build Bot <nigelb@redhat.com>
887953
Reviewed-by: Niels de Vos <ndevos@redhat.com>
887953
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
---
887953
 libglusterfs/src/mem-pool.c | 6 +-----
887953
 1 file changed, 1 insertion(+), 5 deletions(-)
887953
887953
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
887953
index 76daca9..7b62358 100644
887953
--- a/libglusterfs/src/mem-pool.c
887953
+++ b/libglusterfs/src/mem-pool.c
887953
@@ -825,6 +825,7 @@ mem_get_from_pool (struct mem_pool *mem_pool)
887953
         if (retval) {
887953
                 retval->magic = GF_MEM_HEADER_MAGIC;
887953
                 retval->next = NULL;
887953
+                retval->pool = mem_pool;
887953
                 retval->pool_list = pool_list;
887953
                 retval->power_of_two = mem_pool->pool->power_of_two;
887953
         }
887953
@@ -860,11 +861,6 @@ mem_get (struct mem_pool *mem_pool)
887953
                 return NULL;
887953
         }
887953
 
887953
-        retval->magic = GF_MEM_HEADER_MAGIC;
887953
-        retval->pool = mem_pool;
887953
-        retval->pool_list = pool_list;
887953
-        retval->power_of_two = mem_pool->pool->power_of_two;
887953
-
887953
         GF_ATOMIC_INC (mem_pool->active);
887953
 
887953
         return retval + 1;
887953
-- 
887953
1.8.3.1
887953