summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.h
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2019-09-30 20:27:27 +0300
committerAtin Mukherjee <amukherj@redhat.com>2019-10-14 09:23:01 +0000
commitcdf34880e6788a396c8f02ba7e0263ea09d3676a (patch)
tree5749ea938730f2ef1024854cc15b44d5461d5577 /xlators/mgmt/glusterd/src/glusterd-volgen.h
parent704961a39ffd019487e36ac6dbd425399cb85cf2 (diff)
glusterd-volgen.c: fix setting the key export-dir
The return value of gf_asprintf() was used as the key length, and it was stored into ret. ret was re-used before the dict function was called, therefore was invalid as the real key length and contained a different value. That was masked by the fact the key length was only used in key hash, so while it was incorrect, it was harmless. The hash was consistent and the key length was re-calculated anyway in dict_set_lk(). This patch fixes it, so later on we can use the key length also in dict_set_lk() to save another strlen() (sent in a different patch). However, in the course of this patch I've also decided to reduce the copy-pasta in this code path and put all NFS options in an array and iterate through them. This makes the code shorter and easier to read. (It's also more efficient since once an entry was found, there's no additional strcmp()'s as the previous code did). Change-Id: I968ed50a55f3b1a7ad027c72b06e0fa3788eaa9b updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h
index 5c4bfe0db0b..406fcf52817 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.h
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h
@@ -174,6 +174,12 @@ struct volgen_brick_xlator {
* delay-gen before this xlator */
char *dbg_key;
};
+
+struct nfs_opt {
+ const char *pattern;
+ const char *printf_pattern;
+};
+
typedef struct volgen_brick_xlator volgen_brick_xlator_t;
int