From 000e65d7af7be31236e060064fb3b4a332e78cf3 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 13 Nov 2012 01:14:43 +0530 Subject: core: remove all the 'inner' functions in codebase * move 'dict_keys_join()' from api/glfs_fops.c to libglusterfs/dict.c - also added an argument which is treated as a filter function if required, currently useful for fuse. * now 'make CFLAGS="-std=gnu99 -pedantic" 2>&1 | grep nested' gives no output. Change-Id: I4e18496fbd93ae1d3942026ef4931889cba015e8 Signed-off-by: Amar Tumballi BUG: 875913 Reviewed-on: http://review.gluster.org/4187 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- api/src/glfs-fops.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'api') diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index c9897243e52..be26dc121de 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -1856,32 +1856,12 @@ out: } -static int -dict_keys_join (void *value, int size, dict_t *dict) -{ - int len = 0; - - int add_key_len (dict_t *d, char *k, data_t *v, void *o) - { - if (value && size > len) - strncpy (value + len, k, size - len); - - len += (strlen (k) + 1); - - return 0; - } - - dict_foreach (dict, add_key_len, 0); - - return len; -} - int glfs_listxattr_process (void *value, size_t size, dict_t *xattr) { int ret = -1; - ret = dict_keys_join (NULL, 0, xattr); + ret = dict_keys_join (NULL, 0, xattr, NULL); if (!value || !size) goto out; @@ -1892,7 +1872,7 @@ glfs_listxattr_process (void *value, size_t size, dict_t *xattr) goto out; } - dict_keys_join (value, size, xattr); + dict_keys_join (value, size, xattr, NULL); out: if (xattr) dict_unref (xattr); -- cgit