diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2010-09-18 03:31:56 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-18 07:02:03 -0700 |
commit | 5c297be9612f76dad6f970092fb6762b4ee4844a (patch) | |
tree | f65290e7f12e8d6913f3f3b8d3ffa8dc4cd06618 /xlators/features/quota | |
parent | faa817ea9cb119c7f65fce24f03a172fa4b4ada1 (diff) |
Glusterd: gluster volume set <volume> <option> <value>
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1159 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1159
Diffstat (limited to 'xlators/features/quota')
-rw-r--r-- | xlators/features/quota/src/quota.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 4e9b587c27f..094b62d4a56 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -1042,6 +1042,57 @@ mem_acct_init (xlator_t *this) return ret; } +int +reconfigure (xlator_t *this, dict_t *options) +{ + + struct quota_priv *_private = NULL; + uint64_t disk_usage_limit; + uint32_t min_free_disk_limit; + data_t *data = NULL; + int ret = 0; + + _private = this->private; + + data = dict_get (options, "disk-usage-limit"); + if (data) { + if (gf_string2bytesize (data->data, &disk_usage_limit) != 0) { + gf_log (this->name, GF_LOG_ERROR, + "Reconfigure: Invalid number '%s' " + "for disk-usage limit", data->data); + //return -1; + ret = -1; + goto out; + } + _private->disk_usage_limit = disk_usage_limit; + gf_log (this->name, GF_LOG_TRACE, + "Reconfiguring disk-usage-limit %"PRIu64"", + disk_usage_limit); + + } + + + data = dict_get (options, "min-free-disk-limit"); + if (data) { + if (gf_string2percent (data->data, &min_free_disk_limit) != 0){ + gf_log (this->name, GF_LOG_ERROR, + "Reconfigure : Invalid percent '%s' for" + " min-free-disk-limit", data->data); + ret = -1; + goto out; + } + + _private->min_free_disk_limit = min_free_disk_limit; + gf_log (this->name, GF_LOG_TRACE, + "Reconfiguring min-free-disk-limit %d \%", + min_free_disk_limit); + + } +out: + return ret; + +} + int32_t init (xlator_t *this) { @@ -1106,6 +1157,8 @@ init (xlator_t *this) return ret; } + + void fini (xlator_t *this) { |