From 341ba81448e869ae388b4b37556e47f6bf7413a5 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Sun, 23 Sep 2018 11:04:22 +0300 Subject: Quota related files: 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 code to use it. Please review carefully. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul Change-Id: If4f425a9827be7c36ccfbb9761006ae824a818c6 --- xlators/features/quota/src/quota-enforcer-client.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'xlators/features/quota/src/quota-enforcer-client.c') diff --git a/xlators/features/quota/src/quota-enforcer-client.c b/xlators/features/quota/src/quota-enforcer-client.c index 57105549cf..d69bc919e2 100644 --- a/xlators/features/quota/src/quota-enforcer-client.c +++ b/xlators/features/quota/src/quota-enforcer-client.c @@ -395,7 +395,8 @@ quota_enforcer_blocking_connect(rpc_clnt_t *rpc) if (options == NULL) goto out; - ret = dict_set_str(options, "non-blocking-io", "no"); + ret = dict_set_nstrn(options, "non-blocking-io", SLEN("non-blocking-io"), + "no", SLEN("no")); if (ret) goto out; @@ -403,7 +404,8 @@ quota_enforcer_blocking_connect(rpc_clnt_t *rpc) rpc_clnt_start(rpc); - ret = dict_set_str(options, "non-blocking-io", "yes"); + ret = dict_set_nstrn(options, "non-blocking-io", SLEN("non-blocking-io"), + "yes", SLEN("yes")); if (ret) goto out; @@ -442,16 +444,21 @@ quota_enforcer_init(xlator_t *this, dict_t *options) priv->quota_enforcer = "a_enforcer_clnt; - ret = dict_set_str(options, "transport.address-family", "unix"); + ret = dict_set_nstrn(options, "transport.address-family", + SLEN("transport.address-family"), "unix", + SLEN("unix")); if (ret) goto out; - ret = dict_set_str(options, "transport-type", "socket"); + ret = dict_set_nstrn(options, "transport-type", SLEN("transport-type"), + "socket", SLEN("socket")); if (ret) goto out; - ret = dict_set_str(options, "transport.socket.connect-path", - "/var/run/gluster/quotad.socket"); + ret = dict_set_nstrn(options, "transport.socket.connect-path", + SLEN("transport.socket.connect-path"), + "/var/run/gluster/quotad.socket", + SLEN("/var/run/gluster/quotad.socket")); if (ret) goto out; -- cgit