summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2010-10-26 04:00:30 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-10-26 23:56:17 -0700
commita53d14d5f5be431279c5e56963b495bf164cf453 (patch)
tree5980a2c1f7eb12fbe8ff54c262dd05af6a259144 /xlators
parentdb94ed06a688fb596aba4deafdf59a5af2fd6bbe (diff)
volgen: macro cleanup
Signed-off-by: Csaba Henk <csaba@lowlife.hu> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1750 (clean up volgen) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1750
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 16f4b92e514..e27eb56ccb8 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -139,21 +139,6 @@ static struct volopt_map_entry glusterd_volopt_map[] = {
};
-#define VOLGEN_GET_NFS_DIR(path) \
- do { \
- glusterd_conf_t *priv = THIS->private; \
- snprintf (path, PATH_MAX, "%s/nfs", priv->workdir); \
- } while (0); \
-
-#define VOLGEN_GET_VOLUME_DIR(path, volinfo) \
- do { \
- glusterd_conf_t *priv = THIS->private; \
- snprintf (path, PATH_MAX, "%s/vols/%s", priv->workdir, \
- volinfo->volname); \
- } while (0); \
-
-
-
/*********************************************
*
@@ -1326,9 +1311,12 @@ get_brick_filepath (char *filename, glusterd_volinfo_t *volinfo,
{
char path[PATH_MAX] = {0,};
char brick[PATH_MAX] = {0,};
+ glusterd_conf_t *priv = NULL;
+
+ priv = THIS->private;
GLUSTERD_REMOVE_SLASH_FROM_PATH (brickinfo->path, brick);
- VOLGEN_GET_VOLUME_DIR (path, volinfo);
+ GLUSTERD_GET_VOLUME_DIR (path, volinfo, priv);
snprintf (filename, PATH_MAX, "%s/%s.%s.%s.vol",
path, volinfo->volname,
@@ -1386,8 +1374,11 @@ static void
get_client_filepath (char *filename, glusterd_volinfo_t *volinfo)
{
char path[PATH_MAX] = {0,};
+ glusterd_conf_t *priv = NULL;
+
+ priv = THIS->private;
- VOLGEN_GET_VOLUME_DIR (path, volinfo);
+ GLUSTERD_GET_VOLUME_DIR (path, volinfo, priv);
snprintf (filename, PATH_MAX, "%s/%s-fuse.vol",
path, volinfo->volname);
@@ -1455,8 +1446,11 @@ void
glusterd_get_nfs_filepath (char *filename)
{
char path[PATH_MAX] = {0,};
+ glusterd_conf_t *priv = NULL;
+
+ priv = THIS->private;
- VOLGEN_GET_NFS_DIR (path);
+ GLUSTERD_GET_NFS_DIR (path, priv);
snprintf (filename, PATH_MAX, "%s/nfs-server.vol", path);
}