From 2a2060359a6991e310e6532376273bccb9cfbadc Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Tue, 12 Apr 2011 05:19:22 +0000 Subject: DHT: check for mis-matching user xattrs Signed-off-by: shishir gowda Signed-off-by: Anand Avati BUG: 2717 (Detect user_xattr mismatches for dir's) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2717 --- libglusterfs/src/dict.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libglusterfs/src/dict.c') diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c index c8f43e31..66fe31bc 100644 --- a/libglusterfs/src/dict.c +++ b/libglusterfs/src/dict.c @@ -214,6 +214,26 @@ _dict_lookup (dict_t *this, char *key) return NULL; } +int32_t +dict_lookup (dict_t *this, char *key, data_pair_t **data) +{ + if (!this || !key || !data) { + gf_log_callingfn ("dict", GF_LOG_WARNING, + "!this || !key || !data"); + return -1; + } + + LOCK (&this->lock); + { + *data = _dict_lookup (this, key); + } + UNLOCK (&this->lock); + if (*data) + return 0; + else + return -1; + +} static int32_t _dict_set (dict_t *this, -- cgit