diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-10-04 11:17:44 +0300 |
---|---|---|
committer | Xavi Hernandez <xhernandez@redhat.com> | 2019-10-14 08:21:52 +0000 |
commit | 704961a39ffd019487e36ac6dbd425399cb85cf2 (patch) | |
tree | bbdff1293d5cd5602a04d42822f2024d481a3754 /xlators/features/gfid-access | |
parent | 240eec91c6ab5818c3fa4a9087ba46bbed0e8d2b (diff) |
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 <ykaul@redhat.com>
Diffstat (limited to 'xlators/features/gfid-access')
-rw-r--r-- | xlators/features/gfid-access/src/gfid-access.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index ad7776741d9..3fea5672a21 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -327,10 +327,8 @@ out: static gf_boolean_t __is_gfid_access_dir(uuid_t gfid) { - uuid_t aux_gfid; - - memset(aux_gfid, 0, 16); - aux_gfid[15] = GF_AUX_GFID; + static uuid_t aux_gfid = {0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, GF_AUX_GFID}; if (gf_uuid_compare(gfid, aux_gfid) == 0) return _gf_true; |