diff options
author | Amar Tumballi <amarts@redhat.com> | 2017-08-31 15:23:56 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-12-20 15:43:02 +0000 |
commit | 7d81a49a0479b4b98a639b5e50ec2ea4fa8a1314 (patch) | |
tree | 134cf8eca7a0dc197ae1f83421e54414a37bd52c | |
parent | 4fdcf4cccd467c9678bd23a613f43e1f1ac24c07 (diff) |
stripe, quiesce: volume option fixes
Updates: #302
Change-Id: I8f84260ba007f2afc7fe3b7c15c06069942ad6d1
Signed-off-by: Amar Tumballi <amarts@redhat.com>
-rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 17 | ||||
-rw-r--r-- | xlators/features/quiesce/src/quiesce.c | 13 | ||||
-rw-r--r-- | xlators/features/quiesce/src/quiesce.h | 1 |
3 files changed, 25 insertions, 6 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 0a3f716dd19..5a8bf1a9275 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -5756,18 +5756,27 @@ struct volume_options options[] = { .default_value = "128KB", .min = STRIPE_MIN_BLOCK_SIZE, .description = "Size of the stripe unit that would be read " - "from or written to the striped servers." + "from or written to the striped servers.", + .op_version = { 1 }, + .tags = { "stripe" }, + .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE, }, { .key = {"use-xattr"}, .type = GF_OPTION_TYPE_BOOL, - .default_value = "true" + .default_value = "true", + .description = "handle the stripe without the xattr", + .tags = { "stripe", "dev-only" }, + .flags = OPT_FLAG_CLIENT_OPT, }, { .key = {"coalesce"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "true", .description = "Enable/Disable coalesce mode to flatten striped " - "files as stored on the server (i.e., eliminate holes " - "caused by the traditional format)." + "files as stored on the server (i.e., eliminate holes " + "caused by the traditional format).", + .op_version = { 1 }, + .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE, + .tags = { "stripe" }, }, { .key = {NULL} }, }; diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c index f8217810756..c78cabb31f3 100644 --- a/xlators/features/quiesce/src/quiesce.c +++ b/xlators/features/quiesce/src/quiesce.c @@ -123,7 +123,7 @@ gf_quiesce_enqueue (xlator_t *this, call_stub_t *stub) UNLOCK (&priv->lock); if (!priv->timer) { - timeout.tv_sec = 20; + timeout.tv_sec = priv->timeout; timeout.tv_nsec = 0; priv->timer = gf_timer_call_after (this->ctx, @@ -2451,6 +2451,8 @@ init (xlator_t *this) if (!priv) goto out; + GF_OPTION_INIT ("timeout", priv->timeout, time, out); + priv->local_pool = mem_pool_new (quiesce_local_t, GF_FOPS_EXPECTED_IN_PARALLEL); @@ -2520,7 +2522,7 @@ notify (xlator_t *this, int event, void *data, ...) if (priv->timer) break; - timeout.tv_sec = 20; + timeout.tv_sec = priv->timeout; timeout.tv_nsec = 0; priv->timer = gf_timer_call_after (this->ctx, @@ -2602,5 +2604,12 @@ struct xlator_cbks cbks; struct volume_options options[] = { + { .key = {"timeout"}, + .type = GF_OPTION_TYPE_TIME, + .default_value = "20s", + .description = "timeout for ignoring all the quiesced calls", + .tags = {"debug", "dev-only"}, + .op_version = { GD_OP_VERSION_4_0_0 }, + }, { .key = {NULL} }, }; diff --git a/xlators/features/quiesce/src/quiesce.h b/xlators/features/quiesce/src/quiesce.h index 878ed77e928..a5fb43ccdc8 100644 --- a/xlators/features/quiesce/src/quiesce.h +++ b/xlators/features/quiesce/src/quiesce.h @@ -25,6 +25,7 @@ typedef struct { int queue_size; pthread_t thr; struct mem_pool *local_pool; + uint32_t timeout; } quiesce_priv_t; typedef struct { |