From b58a15948fb3fc37b6c0b70171482f50ed957f42 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Thu, 15 Jun 2017 15:36:07 +0530 Subject: index: Do not proceed with init if brick is not mounted ..or else when a volume start force is given, we end up creating /brick-path/.glusterfs/indices folder and various subdirs under it and eventually starting the brick process. As a part of this patch, glusterd_get_index_basepath() is added in glusterd, who will then use it to create the basepath during volume-create, add-brick, replace-brick and reset-brick. It also uses this function to set the 'index-base' xlator option for the index translator. Change-Id: Id018cf3cb6f1e2e35b5c4cf438d1e939025cb0fc BUG: 1457202 Signed-off-by: Ravishankar N Reviewed-on: https://review.gluster.org/17426 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Pranith Kumar Karampuri --- xlators/mgmt/glusterd/src/glusterd-utils.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.h') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h index d694a312a41..7a739c85ebd 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-utils.h @@ -861,4 +861,15 @@ glusterd_brick_op_prerequisites (dict_t *dict, int glusterd_get_volinfo_from_brick (char *brick, glusterd_volinfo_t **volinfo); +#define INDEX_BASEPATH ".glusterfs/indices" +static inline void +glusterd_get_index_basepath (glusterd_brickinfo_t *brickinfo, char *buffer, + size_t size) +{ + if (!buffer) + return; + snprintf (buffer, size, "%s/%s", brickinfo->path, INDEX_BASEPATH); + +} + #endif -- cgit