diff options
Diffstat (limited to 'xlators/features/quota/src/quotad-helpers.c')
-rw-r--r-- | xlators/features/quota/src/quotad-helpers.c | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/xlators/features/quota/src/quotad-helpers.c b/xlators/features/quota/src/quotad-helpers.c index 70298fc87f5..be8f9080f14 100644 --- a/xlators/features/quota/src/quotad-helpers.c +++ b/xlators/features/quota/src/quotad-helpers.c @@ -11,97 +11,97 @@ #include "quotad-helpers.h" quotad_aggregator_state_t * -get_quotad_aggregator_state (xlator_t *this, rpcsvc_request_t *req) +get_quotad_aggregator_state(xlator_t *this, rpcsvc_request_t *req) { - quotad_aggregator_state_t *state = NULL; - xlator_t *active_subvol = NULL; - quota_priv_t *priv = NULL; + quotad_aggregator_state_t *state = NULL; + xlator_t *active_subvol = NULL; + quota_priv_t *priv = NULL; - state = (void *)GF_CALLOC (1, sizeof (*state), - gf_quota_mt_aggregator_state_t); - if (!state) - return NULL; + state = (void *)GF_CALLOC(1, sizeof(*state), + gf_quota_mt_aggregator_state_t); + if (!state) + return NULL; - state->this = THIS; - priv = this->private; + state->this = THIS; + priv = this->private; - LOCK (&priv->lock); - { - active_subvol = state->active_subvol = FIRST_CHILD (this); - } - UNLOCK (&priv->lock); + LOCK(&priv->lock); + { + active_subvol = state->active_subvol = FIRST_CHILD(this); + } + UNLOCK(&priv->lock); - if (active_subvol->itable == NULL) - active_subvol->itable = inode_table_new (4096, active_subvol); + if (active_subvol->itable == NULL) + active_subvol->itable = inode_table_new(4096, active_subvol); - state->itable = active_subvol->itable; + state->itable = active_subvol->itable; - state->pool = this->ctx->pool; + state->pool = this->ctx->pool; - return state; + return state; } void -quotad_aggregator_free_state (quotad_aggregator_state_t *state) +quotad_aggregator_free_state(quotad_aggregator_state_t *state) { - if (state->xdata) - dict_unref (state->xdata); + if (state->xdata) + dict_unref(state->xdata); - GF_FREE (state); + GF_FREE(state); } call_frame_t * -quotad_aggregator_alloc_frame (rpcsvc_request_t *req) +quotad_aggregator_alloc_frame(rpcsvc_request_t *req) { - call_frame_t *frame = NULL; - quotad_aggregator_state_t *state = NULL; - xlator_t *this = NULL; + call_frame_t *frame = NULL; + quotad_aggregator_state_t *state = NULL; + xlator_t *this = NULL; - GF_VALIDATE_OR_GOTO ("server", req, out); - GF_VALIDATE_OR_GOTO ("server", req->trans, out); - GF_VALIDATE_OR_GOTO ("server", req->svc, out); - GF_VALIDATE_OR_GOTO ("server", req->svc->ctx, out); + GF_VALIDATE_OR_GOTO("server", req, out); + GF_VALIDATE_OR_GOTO("server", req->trans, out); + GF_VALIDATE_OR_GOTO("server", req->svc, out); + GF_VALIDATE_OR_GOTO("server", req->svc->ctx, out); - this = req->svc->xl; + this = req->svc->xl; - frame = create_frame (this, req->svc->ctx->pool); - if (!frame) - goto out; + frame = create_frame(this, req->svc->ctx->pool); + if (!frame) + goto out; - state = get_quotad_aggregator_state (this, req); - if (!state) - goto out; + state = get_quotad_aggregator_state(this, req); + if (!state) + goto out; - frame->root->state = state; - frame->root->unique = 0; + frame->root->state = state; + frame->root->unique = 0; - frame->this = this; + frame->this = this; out: - return frame; + return frame; } call_frame_t * -quotad_aggregator_get_frame_from_req (rpcsvc_request_t *req) +quotad_aggregator_get_frame_from_req(rpcsvc_request_t *req) { - call_frame_t *frame = NULL; + call_frame_t *frame = NULL; - GF_VALIDATE_OR_GOTO ("server", req, out); + GF_VALIDATE_OR_GOTO("server", req, out); - frame = quotad_aggregator_alloc_frame (req); - if (!frame) - goto out; + frame = quotad_aggregator_alloc_frame(req); + if (!frame) + goto out; - frame->root->op = req->procnum; + frame->root->op = req->procnum; - frame->root->unique = req->xid; + frame->root->unique = req->xid; - frame->root->uid = req->uid; - frame->root->gid = req->gid; - frame->root->pid = req->pid; + frame->root->uid = req->uid; + frame->root->gid = req->gid; + frame->root->pid = req->pid; - frame->root->lk_owner = req->lk_owner; + frame->root->lk_owner = req->lk_owner; - frame->local = req; + frame->local = req; out: - return frame; + return frame; } |