From 8a478e2280a6102caa189cf3b1645e767a305d48 Mon Sep 17 00:00:00 2001 From: karthik-us Date: Thu, 31 Aug 2017 16:00:53 +0530 Subject: 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 --- xlators/features/read-only/src/read-only.c | 3 +++ xlators/features/read-only/src/worm.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'xlators/features/read-only') 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} -- cgit