From a2b7f11f279b9acc74c1a3b6d893fda7c160683d Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Wed, 16 May 2012 18:22:35 +0530 Subject: common-utils: Simplified mkdir_p interface and put it to use. - Simplified mkdir_p interface. - Removed mkdir_if_missing from codebase - Modified glusterd consumers of mkdir_if_missing to use mkdir_p with allow_symlinks=_gf_true. This implicitly assumes that glusterd is in 'control' of the brick path and glusterd's working dir in the sense that the symlinks (if any) in any of the above mentioned paths are under the 'storage administrator's control. Change-Id: I7383ad5cff11b123e1e0d2fe6da0c81e03c52ed2 BUG: 823132 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.com/3378 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-hooks.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-hooks.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-hooks.c b/xlators/mgmt/glusterd/src/glusterd-hooks.c index ba428b0f359..b0c4c2638f7 100644 --- a/xlators/mgmt/glusterd/src/glusterd-hooks.c +++ b/xlators/mgmt/glusterd/src/glusterd-hooks.c @@ -93,7 +93,7 @@ glusterd_hooks_create_hooks_directory (char *basedir) priv = THIS->private; snprintf (path, sizeof (path), "%s/hooks", basedir); - ret = mkdir_if_missing (path, NULL); + ret = mkdir_p (path, 0777, _gf_true); if (ret) { gf_log (THIS->name, GF_LOG_CRITICAL, "Unable to create %s due" "to %s", path, strerror (errno)); @@ -101,7 +101,7 @@ glusterd_hooks_create_hooks_directory (char *basedir) } GLUSTERD_GET_HOOKS_DIR (version_dir, GLUSTERD_HOOK_VER, priv); - ret = mkdir_if_missing (version_dir, NULL); + ret = mkdir_p (version_dir, 0777, _gf_true); if (ret) { gf_log (THIS->name, GF_LOG_CRITICAL, "Unable to create %s due " "to %s", version_dir, strerror (errno)); @@ -115,7 +115,7 @@ glusterd_hooks_create_hooks_directory (char *basedir) snprintf (path, sizeof (path), "%s/%s", version_dir, cmd_subdir); - ret = mkdir_if_missing (path, NULL); + ret = mkdir_p (path, 0777, _gf_true); if (ret) { gf_log (THIS->name, GF_LOG_CRITICAL, "Unable to create %s due to %s", @@ -127,7 +127,7 @@ glusterd_hooks_create_hooks_directory (char *basedir) type++) { snprintf (path, sizeof (path), "%s/%s/%s", version_dir, cmd_subdir, type_subdir[type]); - ret = mkdir_if_missing (path, NULL); + ret = mkdir_p (path, 0777, _gf_true); if (ret) { gf_log (THIS->name, GF_LOG_CRITICAL, "Unable to create %s due to %s", -- cgit