From d6c99b6134f1eb90b3a8020c3538101df266e9b5 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 6 Sep 2012 00:13:04 +0530 Subject: libglusterfs/dict: make 'dict_t' a opaque object * ie, don't dereference dict_t pointer, instead use APIs everywhere * other than dict_t only 'data_t' should be the valid export from dict.h * added 'dict_foreach_fnmatch()' API * changed dict_lookup() to use data_t, instead of data_pair_t Change-Id: I400bb0dd55519a7c5d2a107e67c8e7a7207228dc Signed-off-by: Amar Tumballi BUG: 850917 Reviewed-on: http://review.gluster.org/3829 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/debug/io-stats/src/io-stats.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/debug') diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 3bb48b905..82159fcac 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -2139,7 +2139,7 @@ io_stats_fsync (call_frame_t *frame, xlator_t *this, } -void +int conditional_dump (dict_t *dict, char *key, data_t *value, void *data) { struct { @@ -2163,20 +2163,21 @@ conditional_dump (dict_t *dict, char *key, data_t *value, void *data) if (!strncmp (filename, "", 1)) { gf_log (this->name, GF_LOG_ERROR, "No filename given"); - return; + return -1; } logfp = fopen (filename, "w+"); GF_ASSERT (logfp); if (!logfp) { gf_log (this->name, GF_LOG_ERROR, "failed to open %s " "for writing", filename); - return; + return -1; } (void) ios_dump_args_init (&args, IOS_DUMP_TYPE_FILE, logfp); io_stats_dump (this, &args); fclose (logfp); } + return 0; } -- cgit