diff options
author | Mohammed Junaid Ahmed <junaid@gluster.com> | 2011-03-15 05:35:45 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-16 00:04:56 -0700 |
commit | 031eee923d8fd79bc1cf78b7b24fe82e44186848 (patch) | |
tree | a9f16f00850332f427bdab40105c28bec98d5e4e /xlators/mgmt/glusterd/src/glusterd-volgen.c | |
parent | c5d93456dcd17ddeb189c3e1390e58f95e30b851 (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-volgen.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index ecf4df9df..9e2c1f219 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) |