diff options
author | Poornima G <pgurusid@redhat.com> | 2018-01-09 17:26:44 +0530 |
---|---|---|
committer | Poornima G <pgurusid@redhat.com> | 2018-01-22 04:10:52 +0000 |
commit | 24bf7715140586675f8d2036f4d589bc255c16dc (patch) | |
tree | 77c037c66bc14b40d79bed94770ec54303d2301b /libglusterfs/src | |
parent | 303cc2b54797bc5371be742543ccb289010c92f2 (diff) |
md-cache: Implement dynamic configuration of xattr list for caching
Currently, the list of xattrs that md-cache can cache is hard coded
in the md-cache.c file, this necessiates code change and rebuild
everytime a new xattr needs to be added to md-cache xattr cache
list.
With this patch, the user will be able to configure a comma
seperated list of xattrs to be cached by md-cache
Updates #297
Change-Id: Ie35ed607d17182d53f6bb6e6c6563ac52bc3132e
Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/common-utils.c | 17 | ||||
-rw-r--r-- | libglusterfs/src/common-utils.h | 3 | ||||
-rw-r--r-- | libglusterfs/src/libglusterfs.sym | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 4eed92a92f9..ac0325f9d60 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -2069,6 +2069,23 @@ skipwhite (char **s) (*s)++; } +void +gf_strTrim (char **s) +{ + char *end = NULL; + + end = *s + strlen(*s) - 1; + while (end > *s && isspace ((unsigned char)*end)) + end--; + + *(end+1) = '\0'; + + while (isspace (**s)) + (*s)++; + + return; +} + char * nwstrtail (char *str, char *pattern) { diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 89f7927aae1..c7f9fd58cc8 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -951,4 +951,7 @@ get_struct_variable (int mem_num, gf_gsync_status_t *sts_val); char * gf_strncpy (char *dest, const char *src, const size_t dest_size); +void +gf_strTrim (char **s); + #endif /* _COMMON_UTILS_H */ diff --git a/libglusterfs/src/libglusterfs.sym b/libglusterfs/src/libglusterfs.sym index 613c18ed3e9..a515caec3e9 100644 --- a/libglusterfs/src/libglusterfs.sym +++ b/libglusterfs/src/libglusterfs.sym @@ -677,6 +677,7 @@ gf_string2uint64 gf_string2uint_base10 gf_strip_whitespace gf_strncpy +gf_strTrim gf_strstr gf_thread_cleanup_xint gf_thread_create |