From 17e3f617086da785a3678d7cfa8f68ebd1497023 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Sat, 5 May 2018 00:05:09 -0400 Subject: glusterd/ctime: Provide option to enable/disable ctime feature Updates: #208 Change-Id: If6f52b9b1b5b823ad64faeed662e96ceb848c54c Signed-off-by: Kotresh HR --- xlators/storage/posix/src/posix-common.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'xlators/storage/posix/src/posix-common.c') diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c index bcaad2703e9..c17534536d2 100644 --- a/xlators/storage/posix/src/posix-common.c +++ b/xlators/storage/posix/src/posix-common.c @@ -390,6 +390,9 @@ posix_reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("fips-mode-rchecksum", priv->fips_mode_rchecksum, options, bool, out); + + GF_OPTION_RECONF ("ctime", priv->ctime, options, bool, out); + ret = 0; out: return ret; @@ -1082,6 +1085,8 @@ posix_init (xlator_t *this) GF_OPTION_INIT ("fips-mode-rchecksum", _private->fips_mode_rchecksum, bool, out); + + GF_OPTION_INIT ("ctime", _private->ctime, bool, out); out: if (ret) { if (_private) { @@ -1383,5 +1388,16 @@ struct volume_options options[] = { .description = "If enabled, posix_rchecksum uses the FIPS compliant" "SHA256 checksum. MD5 otherwise." }, + { .key = {"ctime"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "off", + .flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC, + .op_version = { GD_OP_VERSION_4_1_0 }, + .tags = { "ctime" }, + .description = "When this option is enabled, time attributes (ctime,mtime,atime) " + "are stored in xattr to keep it consistent across replica and " + "distribute set. The time attributes stored at the backend are " + "not considered " + }, { .key = {NULL} } }; -- cgit