summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
diff options
context:
space:
mode:
authorMohammed Junaid Ahmed <junaid@gluster.com>2011-03-15 05:35:45 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-16 00:04:56 -0700
commit031eee923d8fd79bc1cf78b7b24fe82e44186848 (patch)
treea9f16f00850332f427bdab40105c28bec98d5e4e /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
parentc5d93456dcd17ddeb189c3e1390e58f95e30b851 (diff)
mgmt/glusterd: QUOTA Glusterd related changes.
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/mgmt/glusterd/src/glusterd-rpc-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index b46fb23db0f..966a8a94b5d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -336,6 +336,58 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret,
sfunc = gf_xdr_from_cli_stats_volume_rsp;
break;
}
+
+ case GD_OP_QUOTA:
+ {
+ int32_t type;
+ char *str = NULL;
+ char *errstr = NULL;
+ gf1_cli_quota_rsp rsp = {0,};
+
+ rsp.op_ret = op_ret;
+ rsp.op_errno = op_errno;
+ rsp.volname = "";
+
+ ctx = op_ctx;
+
+ if (op_errstr)
+ rsp.op_errstr = gf_strdup (op_errstr);
+ else {
+ ret = dict_get_str (ctx, "errstr", &errstr);
+ if (ret == 0)
+ rsp.op_errstr = gf_strdup (errstr);
+ else
+ rsp.op_errstr = "";
+ }
+
+ rsp.limit_list = "";
+
+ if (op_ret == 0 && ctx) {
+ ret = dict_get_str (ctx, "volname", &str);
+ if (ret == 0)
+ rsp.volname = gf_strdup (str);
+
+ ret = dict_get_int32
+ (ctx, "type", &type);
+ if (ret == 0)
+ rsp.type = type;
+ else
+ rsp.type = 0;
+
+ if (type == GF_QUOTA_OPTION_TYPE_LIST) {
+ ret = dict_get_str
+ (ctx,"limit_list", &str);
+
+ if (ret == 0)
+ rsp.limit_list =
+ gf_strdup (str);
+ }
+ }
+ cli_rsp = &rsp;
+ sfunc = gf_xdr_serialize_cli_quota_rsp;
+ break;
+ }
+
case GD_OP_NONE:
case GD_OP_MAX:
{