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/protocol/server/src/server-rpc-fops.c | 44 ++++++++++++++++----------- 1 file changed, 26 insertions(+), 18 deletions(-) (limited to 'xlators/protocol/server/src/server-rpc-fops.c') diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c index a8f79ea7629..db02aaf9275 100644 --- a/xlators/protocol/server/src/server-rpc-fops.c +++ b/xlators/protocol/server/src/server-rpc-fops.c @@ -904,15 +904,19 @@ server_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.xdata.xdata_len, op_errno, out); if (op_ret == -1) { - gf_log (this->name, ((op_errno == ENOTSUP) ? - GF_LOG_DEBUG : GF_LOG_INFO), - "%"PRId64": SETXATTR %s (%s) ==> %s (%s)", - frame->root->unique, state->loc.path, - uuid_utoa (state->resolve.gfid), - ((state->dict) ? ((state->dict->members_list) ? - state->dict->members_list->key : - "(null)") : ("null")), - strerror (op_errno)); + /* print every key */ + int _log_setxattr_failure (dict_t *d, char *k, data_t *v, + void *tmp) + { + gf_log (this->name, ((op_errno == ENOTSUP) ? + GF_LOG_DEBUG : GF_LOG_INFO), + "%"PRId64": SETXATTR %s (%s) ==> %s (%s)", + frame->root->unique, state->loc.path, + uuid_utoa (state->resolve.gfid), k, + strerror (op_errno)); + return 0; + } + dict_foreach (state->dict, _log_setxattr_failure, NULL); goto out; } @@ -944,15 +948,19 @@ server_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.xdata.xdata_len, op_errno, out); if (op_ret == -1) { - gf_log (this->name, ((op_errno == ENOTSUP) ? - GF_LOG_DEBUG : GF_LOG_INFO), - "%"PRId64": FSETXATTR %"PRId64" (%s) ==> %s (%s)", - frame->root->unique, state->resolve.fd_no, - uuid_utoa (state->resolve.gfid), - ((state->dict) ? ((state->dict->members_list) ? - state->dict->members_list->key : - "(null)") : "null"), - strerror (op_errno)); + /* print every key here */ + int _log_setxattr_failure (dict_t *d, char *k, data_t *v, + void *tmp) + { + gf_log (this->name, ((op_errno == ENOTSUP) ? + GF_LOG_DEBUG : GF_LOG_INFO), + "%"PRId64": FSETXATTR %"PRId64" (%s) ==> %s (%s)", + frame->root->unique, state->resolve.fd_no, + uuid_utoa (state->resolve.gfid), k, + strerror (op_errno)); + return 0; + } + dict_foreach (state->dict, _log_setxattr_failure, NULL); goto out; } -- cgit