summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-06-21 02:00:23 -0700
committerHarshavardhana <harsha@harshavardhana.net>2014-07-02 17:20:34 -0700
commit1b74cf992986287a510fe3b28a8ee7554e8b0992 (patch)
treea5fad911274080947f5874b4d90cc4f67b6f4473 /xlators/mgmt/glusterd/src/glusterd-snapshot.c
parente4a3566681acbadfe0f7bd879443116885ada4eb (diff)
porting: Port for FreeBSD rebased from Mike Ma's efforts
- Provides a working Gluster Management Daemon, CLI - Provides a working GlusterFS server, GlusterNFS server - Provides a working GlusterFS client - execinfo port from FreeBSD is moved into ./contrib/libexecinfo for ease of portability on NetBSD. (FreeBSD 10 and OSX provide execinfo natively) - More portability cleanups for Darwin, FreeBSD and NetBSD - Provides a new rc script for FreeBSD Change-Id: I8dff336f97479ca5a7f9b8c6b730051c0f8ac46f BUG: 1111774 Original-Author: Mike Ma <mikemandarine@gmail.com> Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8141 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 3095414b88e..c1ddc0849cc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -20,7 +20,7 @@
#include <sys/mount.h>
#include <signal.h>
-#if !defined(__NetBSD__) && !defined(GF_DARWIN_HOST_OS)
+#if defined(GF_LINUX_HOST_OS)
#include <mntent.h>
#else
#include "mntent_compat.h"
@@ -30,7 +30,7 @@
#define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
#endif
-#ifdef GF_DARWIN_HOST_OS
+#if defined(GF_DARWIN_HOST_OS) || defined(__FreeBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
@@ -3743,7 +3743,7 @@ glusterd_snap_brick_create (glusterd_volinfo_t *snap_volinfo,
GF_XATTR_VOL_ID_KEY,
snap_volinfo->volume_id, 16,
XATTR_REPLACE);
- if (ret) {
+ if (ret == -1) {
gf_log (this->name, GF_LOG_ERROR, "Failed to set "
"extended attribute %s on %s. Reason: "
"%s, snap: %s", GF_XATTR_VOL_ID_KEY,
@@ -4043,8 +4043,13 @@ glusterd_update_fs_uuid (glusterd_brickinfo_t *brickinfo)
* file-system which is sharing the UUID with any other
* file-system on the system.
*/
+#ifdef GF_LINUX_HOST_OS
ret = mount (brickinfo->device_path, mount_path,
brickinfo->fstype, 0, "nouuid");
+#else
+ ret = -1;
+#endif
+
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "Failed to mount "
"%s at %s", brickinfo->device_path,