diff options
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/common-utils.c | 16 | ||||
-rw-r--r-- | libglusterfs/src/common-utils.h | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 973e31c636c..18f445ae265 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -4500,6 +4500,22 @@ gf_zero_fill_stat (struct iatt *buf) buf->ia_ctime = 0; } +gf_boolean_t +gf_is_valid_xattr_namespace (char *key) +{ + static char *xattr_namespaces[] = {"trusted.", "security.", "system.", + "user.", NULL }; + int i = 0; + + for (i = 0; xattr_namespaces[i]; i++) { + if (strncmp (key, xattr_namespaces[i], + strlen (xattr_namespaces[i])) == 0) + return _gf_true; + } + + return _gf_false; +} + int gf_bits_count (uint64_t n) { diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 93dee58b079..51264237ab4 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -835,7 +835,7 @@ void gf_zero_fill_stat (struct iatt *buf); gf_boolean_t -is_virtual_xattr (const char *k); +gf_is_valid_xattr_namespace (char *k); const char * gf_inode_type_to_str (ia_type_t type); |