From 9969d1dc2a3e815b161ce8a3dc5d08f84cfe011f Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Mon, 9 Dec 2019 21:28:00 +0200 Subject: multiple xlators: reduce key length In many cases, we were freely allocating long keys with no need. Smaller char arrays are just fine almost anywhere, so just went ahead and looked where they we can use smaller ones. In some cases, annotated the functions as static and the prefixes passed as const as it was easier to read and understand. Where relevant, converted the dict functions to use known key length. Change-Id: I882ab33ea20d90b63278336cd1370c09ffdab7f2 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/cluster/afr/src/afr-self-heald.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c index 7066c01971b..aa774bb8d51 100644 --- a/xlators/cluster/afr/src/afr-self-heald.c +++ b/xlators/cluster/afr/src/afr-self-heald.c @@ -1024,7 +1024,7 @@ afr_shd_dict_add_crawl_event(xlator_t *this, dict_t *output, { int ret = 0; uint64_t count = 0; - char key[256] = {0}; + char key[128] = {0}; int keylen = 0; char suffix[64] = {0}; int xl_id = 0; @@ -1149,9 +1149,9 @@ afr_shd_dict_add_path(xlator_t *this, dict_t *output, int child, char *path, { int ret = -1; uint64_t count = 0; - char key[256] = {0}; + char key[64] = {0}; int keylen = 0; - char xl_id_child_str[64] = {0}; + char xl_id_child_str[32] = {0}; int xl_id = 0; ret = dict_get_int32(output, this->name, &xl_id); -- cgit