From 704961a39ffd019487e36ac6dbd425399cb85cf2 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Fri, 4 Oct 2019 11:17:44 +0300 Subject: Multiple files: make root gfid a static variable In many places we use it, compare to it, etc. It could be a static variable, as it really doesn't change. I think it's better than initializing to 0 and then doing gfid[15] = 1 or other tricks. I think there are additional oppportunuties to make more variables static. This is an attempt at an easy one. Change-Id: I7f23a30a94056d8f043645371ab841cbd0f90d19 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/mount/fuse/src/fuse-bridge.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index e1bd095b177..2ed8bbdcc44 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -5220,7 +5220,7 @@ fuse_first_lookup(xlator_t *this) }; xlator_t *xl = NULL; dict_t *dict = NULL; - uuid_t gfid; + static uuid_t gfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; int ret = -1; struct iatt iatt = { 0, @@ -5238,8 +5238,6 @@ fuse_first_lookup(xlator_t *this) xl = priv->active_subvol; - memset(gfid, 0, 16); - gfid[15] = 1; ret = dict_set_gfuuid(dict, "gfid-req", gfid, true); if (ret) { gf_log(xl->name, GF_LOG_ERROR, "failed to set 'gfid-req'"); -- cgit