From 24bf7715140586675f8d2036f4d589bc255c16dc Mon Sep 17 00:00:00 2001 From: Poornima G Date: Tue, 9 Jan 2018 17:26:44 +0530 Subject: 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 --- libglusterfs/src/common-utils.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libglusterfs/src/common-utils.c') 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) { -- cgit