summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota/src/quota.c
diff options
context:
space:
mode:
authorJunaid <junaid@gluster.com>2011-03-25 01:48:52 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-26 06:45:42 -0700
commit0952bbb30564e8a2359039841290f9956c96e1b9 (patch)
tree1f0d50ba9352966c175d4f156e0be37400b8e6e5 /xlators/features/quota/src/quota.c
parentc55d855c74d860ff0dae942f95c290eba45f15f8 (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/features/quota/src/quota.c')
-rw-r--r--xlators/features/quota/src/quota.c10
1 files changed, 3 insertions, 7 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);