diff options
author | karthik-us <ksubrahm@redhat.com> | 2017-08-31 16:00:53 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2017-11-27 10:58:42 +0000 |
commit | 8a478e2280a6102caa189cf3b1645e767a305d48 (patch) | |
tree | 6357178a774efed14f9c583af56c7f548915d614 | |
parent | 7df8ba088c68e10905b613de95f9f6df40d14825 (diff) |
features/read-only: Redefine the options for read-only and worm
With https://review.gluster.org/18059 introducing new fields into the
volume_option structure, this change takes care of the changes required
at the read-only and worm side.
Updates #302
Change-Id: Ie9d38eed6739a8ef229c462448532354e275af7c
Signed-off-by: karthik-us <ksubrahm@redhat.com>
-rw-r--r-- | xlators/features/read-only/src/read-only.c | 3 | ||||
-rw-r--r-- | xlators/features/read-only/src/worm.c | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/xlators/features/read-only/src/read-only.c b/xlators/features/read-only/src/read-only.c index aae7d0c5989..d72b2c8fd2b 100644 --- a/xlators/features/read-only/src/read-only.c +++ b/xlators/features/read-only/src/read-only.c @@ -125,6 +125,9 @@ struct volume_options options[] = { { .key = {"read-only"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "off", + /*.validate_fn = validate_boolean,*/ + .op_version = {1}, + .flags = OPT_FLAG_SETTABLE, .description = "When \"on\", makes a volume read-only. It is turned " "\"off\" by default." }, diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c index cbe7df8e798..d37a930c1fc 100644 --- a/xlators/features/read-only/src/worm.c +++ b/xlators/features/read-only/src/worm.c @@ -627,35 +627,53 @@ struct volume_options options[] = { { .key = {"worm"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "off", + /*.validate_fn = validate_boolean,*/ + .op_version = {2}, + .flags = OPT_FLAG_SETTABLE, .description = "When \"on\", makes a volume get write once read many " " feature. It is turned \"off\" by default." }, { .key = {"worm-file-level"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "off", + /*.validate_fn = validate_boolean,*/ + .op_version = {GD_OP_VERSION_3_8_0}, + .flags = OPT_FLAG_SETTABLE, .description = "When \"on\", activates the file level worm. " "It is turned \"off\" by default." }, { .key = {"worm-files-deletable"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "on", + /*.validate_fn = validate_boolean,*/ + .op_version = {GD_OP_VERSION_3_13_0}, + .flags = OPT_FLAG_SETTABLE, .description = "When \"off\", doesn't allow the Worm files" "to be deleted. It is turned \"on\" by default." }, { .key = {"default-retention-period"}, .type = GF_OPTION_TYPE_TIME, .default_value = "120", + /*.validate_fn = validate_worm_period,*/ + .op_version = {GD_OP_VERSION_3_8_0}, + .flags = OPT_FLAG_SETTABLE, .description = "The default retention period for the files." }, { .key = {"retention-mode"}, .type = GF_OPTION_TYPE_STR, .default_value = "relax", + /*.validate_fn = validate_reten_mode,*/ + .op_version = {GD_OP_VERSION_3_8_0}, + .flags = OPT_FLAG_SETTABLE, .description = "The mode of retention (relax/enterprise). " "It is relax by default." }, { .key = {"auto-commit-period"}, .type = GF_OPTION_TYPE_TIME, .default_value = "180", + /*.validate_fn = validate_worm_period,*/ + .op_version = {GD_OP_VERSION_3_8_0}, + .flags = OPT_FLAG_SETTABLE, .description = "Auto commit period for the files." }, { .key = {NULL} |