diff options
author | Junaid <junaid@gluster.com> | 2011-03-25 01:48:52 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-26 06:45:42 -0700 |
commit | 0952bbb30564e8a2359039841290f9956c96e1b9 (patch) | |
tree | 1f0d50ba9352966c175d4f156e0be37400b8e6e5 /xlators | |
parent | c55d855c74d860ff0dae942f95c290eba45f15f8 (diff) |
features/quota: Return dynamically allocated address of local.
Signed-off-by: Junaid <junaid@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 2473 (Support for volume and directory level quota)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/quota/src/quota.c | 10 | ||||
-rw-r--r-- | xlators/features/quota/src/quota.h | 1 |
2 files changed, 3 insertions, 8 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 20e90cdec..89f390732 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 f849b86e2..1f0546d4e 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) \ |