From f8f09178bb890924a8050b466cc2e7a0a30e35a7 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Fri, 17 May 2019 19:26:48 +0530 Subject: glusterd: Optimize code to copy dictionary in handshake code path Problem: While high no. of volumes are configured around 2000 glusterd has bottleneck during handshake at the time of copying dictionary Solution: To avoid the bottleneck serialize a dictionary instead of copying key-value pair one by one Change-Id: I9fb332f432e4f915bc3af8dcab38bed26bda2b9a fixes: bz#1711297 Signed-off-by: Mohit Agrawal --- libglusterfs/src/dict.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libglusterfs/src/dict.c') diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c index 2374ab032d1..6648be123b7 100644 --- a/libglusterfs/src/dict.c +++ b/libglusterfs/src/dict.c @@ -2799,10 +2799,6 @@ dict_rename_key(dict_t *this, char *key, char *replace_key) * 4 4 4 */ -#define DICT_HDR_LEN 4 -#define DICT_DATA_HDR_KEY_LEN 4 -#define DICT_DATA_HDR_VAL_LEN 4 - /** * dict_serialized_length_lk - return the length of serialized dict. This * procedure has to be called with this->lock held. @@ -2812,7 +2808,7 @@ dict_rename_key(dict_t *this, char *key, char *replace_key) * : failure: -errno */ -static int +int dict_serialized_length_lk(dict_t *this) { int ret = -EINVAL; -- cgit