From 0952bbb30564e8a2359039841290f9956c96e1b9 Mon Sep 17 00:00:00 2001 From: Junaid Date: Fri, 25 Mar 2011 01:48:52 +0000 Subject: features/quota: Return dynamically allocated address of local. Signed-off-by: Junaid Signed-off-by: Vijay Bellur BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473 --- xlators/features/quota/src/quota.c | 10 +++------- xlators/features/quota/src/quota.h | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'xlators/features/quota') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 20e90cdeca1..89f390732c1 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -135,11 +135,8 @@ quota_local_new () int32_t ret = 0; QUOTA_LOCAL_ALLOC_OR_GOTO (local, quota_local_t, err); - - LOCK_INIT (&local->lock); - err: - return NULL; + return local; } @@ -1095,7 +1092,6 @@ quota_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, quota_local_t *local = NULL; call_stub_t *stub = NULL; int32_t validate_count = 0; - quota_inode_ctx_t *ctx = NULL; local = quota_local_new (); if (local == NULL) { @@ -1122,12 +1118,12 @@ quota_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, quota_check_limit (frame, loc->parent, this, NULL, 0); - LOCK (&ctx->lock); + LOCK (&local->lock); { local->link_count = 0; validate_count = local->validate_count; } - UNLOCK (&ctx->lock); + UNLOCK (&local->lock); if (validate_count == 0) { call_resume (stub); diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h index f849b86e201..1f0546d4e87 100644 --- a/xlators/features/quota/src/quota.h +++ b/xlators/features/quota/src/quota.h @@ -90,7 +90,6 @@ STACK_UNWIND_STRICT (fop, frame, params); \ quota_local_cleanup (_this, _local); \ GF_FREE (_local); \ - gf_log (this->name, GF_LOG_INFO, "stack unwind"); \ } while (0) #define QUOTA_FREE_CONTRIBUTION_NODE(_contribution) \ -- cgit