diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-10-20 09:12:20 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@gmail.com> | 2019-11-06 16:31:42 +0000 |
commit | b17a65dc2e3b4eca0ddd3caf46120f35ed4574b2 (patch) | |
tree | 2496f65e749a12b2099b8597b2f88d8c1907addc /libglusterfs | |
parent | 6c08e5b0ed2bfdd46064187ba39a30c91913fcd7 (diff) |
posix-helpers.c (and others): minor changes to posix_xattr_fill()
posix_xattr_fill() is called from several POSIX functions.
Made minor changes to it and the functions called from it:
1. Dict functions to use known lengths (dict_getn() instead of dict_get(), etc.)
2. Re-ordered some static char[] arrays, to account (hopefully)
to the frequency of the xattrs usage (based on grep in the code...)
3. Before strcmp(), check if the strings lengths match.
4. Removed some dead code.
Hopefully, no functional changes.
Change-Id: I510c0d2785e54ffe0f82c4c449782f2302d63a32
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/common-utils.c | 4 | ||||
-rw-r--r-- | libglusterfs/src/glusterfs/common-utils.h | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 360bc222c7e..ddc3e486b6f 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -5017,8 +5017,8 @@ gf_zero_fill_stat(struct iatt *buf) gf_boolean_t gf_is_valid_xattr_namespace(char *key) { - static char *xattr_namespaces[] = {"trusted.", "security.", "system.", - "user.", NULL}; + static char *xattr_namespaces[] = {"trusted.", "system.", "user.", + "security.", NULL}; int i = 0; for (i = 0; xattr_namespaces[i]; i++) { diff --git a/libglusterfs/src/glusterfs/common-utils.h b/libglusterfs/src/glusterfs/common-utils.h index a11c3a5f458..bc4b4cb8e7d 100644 --- a/libglusterfs/src/glusterfs/common-utils.h +++ b/libglusterfs/src/glusterfs/common-utils.h @@ -424,9 +424,6 @@ BIT_VALUE(unsigned char *array, unsigned int index) } \ } while (0) -#define GF_FILE_CONTENT_REQUESTED(_xattr_req, _content_limit) \ - (dict_get_uint64(_xattr_req, "glusterfs.content", _content_limit) == 0) - #ifdef DEBUG #define GF_ASSERT(x) assert(x); #else |