From 09198e203ece6925791a8a3a6121c5f808e4e873 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Mon, 3 Sep 2018 13:55:01 +0300 Subject: Some (mgmt) xlators: use dict_{setn|getn|deln|get_int32n|set_int32n|set_strn} In a previous patch (https://review.gluster.org/20769) we've added the key length to be passed to dict_* funcs, to remove the need to strlen() it. This patch moves some xlators to use it. - It also adds dict_get_int32n which was missing. - It also reduces the size of some key variables. They were set to 1024b or PATH_MAX, where sometimes 64 bytes were really enough. Please review carefully: 1. That I did not reduce some the size of the key variables too much. 2. That I did not mix up some keys. Compile-tested only! Change-Id: Ic729baf179f40e8d02bc2350491d4bb9b6934266 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/mgmt/glusterd/src/glusterd-utils.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.h') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h index 97f3cc6edf0..6f77ca6fbd6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-utils.h @@ -566,14 +566,15 @@ int glusterd_get_next_global_opt_version_str (dict_t *opts, char **version_str); int -glusterd_generate_and_set_task_id (dict_t *dict, char *key); +glusterd_generate_and_set_task_id (dict_t *dict, char *key, const int keylen); int glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict, char **op_errstr); int -glusterd_copy_uuid_to_dict (uuid_t uuid, dict_t *dict, char *key); +glusterd_copy_uuid_to_dict (uuid_t uuid, dict_t *dict, char *key, + const int keylen); gf_boolean_t glusterd_is_same_address (char *name1, char *name2); -- cgit