diff options
author | Kaushal M <kaushal@redhat.com> | 2014-05-12 11:22:36 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2014-05-14 03:14:33 -0700 |
commit | bfde478cedda8267134ee3807c8db5e042115eae (patch) | |
tree | 580fde93def7ad60bfb29017b5bd91ad67db9729 /xlators/mgmt/glusterd/src/glusterd-volume-ops.c | |
parent | 5c65850c99829668ac199a49a0760443db74b581 (diff) |
glusterd: Allow setting volume options by default based on op-version
A new function glusterd_enable_default_options is introduced, which will
set some volume options on a volume based on op-version. This function
is called near the end of the volume create and will allow some options
to be enabled based on op-version on newly created volumes. This will
also be called during volume reset, to reset the options to their
default values if they had changed.
Change-Id: I91057d9e42409b17a884728b43ae3721328d4831
BUG: 1096616
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/7734
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 6cce4a89f08..fd19b78b912 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -25,6 +25,7 @@ #include "glusterd-store.h" #include "glusterd-utils.h" #include "glusterd-volgen.h" +#include "glusterd-messages.h" #include "run.h" #define glusterd_op_start_volume_args_get(dict, volname, flags) \ @@ -1798,6 +1799,14 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr) i++; } + ret = glusterd_enable_default_options (volinfo, NULL); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_FAIL_DEFAULT_OPT_SET, "Failed to set default " + "options on create for volume %s", volinfo->volname); + goto out; + } + gd_update_volume_op_versions (volinfo); volinfo->caps = caps; |