From 031eee923d8fd79bc1cf78b7b24fe82e44186848 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Ahmed Date: Tue, 15 Mar 2011 05:35:45 +0000 Subject: mgmt/glusterd: QUOTA Glusterd related changes. Signed-off-by: Junaid Signed-off-by: Vijay Bellur BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473 --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index ecf4df9dfe8..9e2c1f219eb 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -141,6 +141,7 @@ static struct volopt_map_entry glusterd_volopt_map[] = { {"performance.stat-prefetch", "performance/stat-prefetch", "!perf", "on", NO_DOC}, /* NODOC */ {MARKER_VOL_KEY, "features/marker", "!marker", "off", NO_DOC}, + {"marker_gsync", "features/marker", "gsync", "off"}, {"nfs.enable-ino32", "nfs/server", "nfs.enable-ino32", NULL, GLOBAL_DOC}, {"nfs.mem-factor", "nfs/server", "nfs.mem-factor", NULL, GLOBAL_DOC}, @@ -163,6 +164,12 @@ static struct volopt_map_entry glusterd_volopt_map[] = { {"nfs.export-dir", "nfs/server", "!nfs-export-dir", NULL, DOC}, {"nfs.disable", "nfs/server", "!nfs-disable", NULL, DOC}, + {"features.quota", "features/quota", "quota", "off"}, + {"features.quota", "features/marker", "quota", "off"}, + + {"features.limit-usage", "features/quota", "limit-set", NULL}, + {"features.quota_version", "features/quota", "version", "1"}, + {NULL, } }; @@ -1274,6 +1281,8 @@ client_graph_builder (glusterfs_graph_t *graph, glusterd_volinfo_t *volinfo, xlator_t *xl = NULL; xlator_t *txl = NULL; xlator_t *trav = NULL; + char *quota_val = NULL; + gf_boolean_t quota = _gf_false; volname = volinfo->volname; dict = volinfo->dict; @@ -1388,6 +1397,25 @@ client_graph_builder (glusterfs_graph_t *graph, glusterd_volinfo_t *volinfo, } } + ret = glusterd_volinfo_get (volinfo, "features.quota", "a_val); + if (ret) + return -1; + + if (quota_val) + ret = gf_string2boolean (quota_val, "a); + if (ret) { + gf_log ("", GF_LOG_ERROR, "value for quota option is not valid"); + + return -1; + } + + if (quota) { + xl = volgen_graph_add (graph, "features/quota", volname); + + if (!xl) + return -1; + } + ret = volgen_graph_set_options_generic (graph, set_dict, volname, &perfxl_option_handler); if (ret) -- cgit