From 75937b83d6b36f00a20688f1348aa6db30171784 Mon Sep 17 00:00:00 2001 From: Varun Shastry Date: Fri, 23 Aug 2013 15:56:47 +0530 Subject: features/quota: Read the time option in its native format Change-Id: Ibe7de155bb5be21ab2da2beed75eec86e9a2f001 Signed-off-by: Varun Shastry --- libglusterfs/src/options.h | 1 + xlators/features/quota/src/quota.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libglusterfs/src/options.h b/libglusterfs/src/options.h index 71a11c06..62f4ee92 100644 --- a/libglusterfs/src/options.h +++ b/libglusterfs/src/options.h @@ -195,6 +195,7 @@ DECLARE_RECONF_OPT(gf_boolean_t, bool); DECLARE_RECONF_OPT(xlator_t *, xlator); DECLARE_RECONF_OPT(char *, path); DECLARE_RECONF_OPT(double, double); +DECLARE_RECONF_OPT(uint32_t, time); #define DEFINE_RECONF_OPT(type_t, type, conv) \ diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index eb89a132..1c48ca1b 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -3456,9 +3456,9 @@ init (xlator_t *this) GF_OPTION_INIT ("server-quota", priv->is_quota_on, bool, err); GF_OPTION_INIT ("default-soft-limit", priv->default_soft_lim, percent, err); - GF_OPTION_INIT ("soft-timeout", priv->soft_timeout, uint32, err); - GF_OPTION_INIT ("hard-timeout", priv->hard_timeout, uint32, err); - GF_OPTION_INIT ("alert-time", priv->log_timeout, uint32, err); + GF_OPTION_INIT ("soft-timeout", priv->soft_timeout, time, err); + GF_OPTION_INIT ("hard-timeout", priv->hard_timeout, time, err); + GF_OPTION_INIT ("alert-time", priv->log_timeout, time, err); GF_OPTION_INIT ("volume-uuid", priv->volume_uuid, str, err); this->local_pool = mem_pool_new (quota_local_t, 64); @@ -3496,11 +3496,11 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("default-soft-limit", priv->default_soft_lim, options, percent, out); GF_OPTION_RECONF ("alert-time", priv->log_timeout, options, - uint32, out); + time, out); GF_OPTION_RECONF ("soft-timeout", priv->soft_timeout, options, - uint32, out); + time, out); GF_OPTION_RECONF ("hard-timeout", priv->hard_timeout, options, - uint32, out); + time, out); ret = 0; @@ -3606,7 +3606,7 @@ struct volume_options options[] = { .max = LONG_MAX, }, {.key = {"soft-timeout"}, - .type = GF_OPTION_TYPE_INT, + .type = GF_OPTION_TYPE_TIME, .min = 0, .max = 1800, .default_value = "60", @@ -3615,7 +3615,7 @@ struct volume_options options[] = { " cache before soft-limit has been crossed." }, {.key = {"hard-timeout"}, - .type = GF_OPTION_TYPE_INT, + .type = GF_OPTION_TYPE_TIME, .min = 0, .max = 60, .default_value = "5", -- cgit