11
#include "quotad-helpers.h"
13
quotad_aggregator_state_t *
14
get_quotad_aggregator_state(xlator_t *this, rpcsvc_request_t *req)
16
quotad_aggregator_state_t *state = NULL;
17
xlator_t *active_subvol = NULL;
18
quota_priv_t *priv = NULL;
20
state = (void *)GF_CALLOC(1, sizeof(*state),
21
gf_quota_mt_aggregator_state_t);
30
active_subvol = state->active_subvol = FIRST_CHILD(this);
34
if (active_subvol->itable == NULL)
35
active_subvol->itable = inode_table_new(4096, active_subvol, 0, 0);
37
state->itable = active_subvol->itable;
39
state->pool = this->ctx->pool;
45
quotad_aggregator_free_state(quotad_aggregator_state_t *state)
48
dict_unref(state->xdata);
51
dict_unref(state->req_xdata);
57
quotad_aggregator_alloc_frame(rpcsvc_request_t *req)
59
call_frame_t *frame = NULL;
60
quotad_aggregator_state_t *state = NULL;
61
xlator_t *this = NULL;
63
GF_VALIDATE_OR_GOTO("server", req, out);
64
GF_VALIDATE_OR_GOTO("server", req->trans, out);
65
GF_VALIDATE_OR_GOTO("server", req->svc, out);
66
GF_VALIDATE_OR_GOTO("server", req->svc->ctx, out);
70
frame = create_frame(this, req->svc->ctx->pool);
74
state = get_quotad_aggregator_state(this, req);
78
frame->root->state = state;
86
quotad_aggregator_get_frame_from_req(rpcsvc_request_t *req)
88
call_frame_t *frame = NULL;
90
GF_VALIDATE_OR_GOTO("server", req, out);
92
frame = quotad_aggregator_alloc_frame(req);
96
frame->root->op = req->procnum;
98
frame->root->uid = req->uid;
99
frame->root->gid = req->gid;
100
frame->root->pid = req->pid;
102
lk_owner_copy(&frame->root->lk_owner, &req->lk_owner);