summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-05-03 00:02:03 -0700
committerAnand Avati <avati@redhat.com>2014-05-03 15:30:18 -0700
commitaea76f0ec5ca01fd10810d704e5ad00cb4eba2fc (patch)
tree4d428eb7dab02ee2f781cac0d112b6d1d30662b2 /xlators/mgmt/glusterd/src/glusterd-snapshot.c
parent853d198e8e4e4aa5ef933432480b585ebd836533 (diff)
glusterd/snapshot: umount2 on OSX/NetBSD is unmount
Change-Id: I8de4d47bb2a54b915243ea029cce2585fba34876 BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7651 Reviewed-by: Justin Clift <justin@gluster.org> Tested-by: Justin Clift <justin@gluster.org> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 395bda1dc00..54b61ee66cd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -20,12 +20,23 @@
#include <sys/mount.h>
#include <signal.h>
-
#if !defined(__NetBSD__) && !defined(GF_DARWIN_HOST_OS)
#include <mntent.h>
#else
#include "mntent_compat.h"
#endif
+
+#ifdef __NetBSD__
+#include <perfuse.h>
+#define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
+#endif
+
+#ifdef GF_DARWIN_HOST_OS
+#include <sys/param.h>
+#include <sys/mount.h>
+#define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
+#endif
+
#include <regex.h>
#include "globals.h"
@@ -152,7 +163,8 @@ snap_max_limits_display_commit (dict_t *rsp_dict, char *volname,
soft_limit_value = (active_hard_limit *
conf->snap_max_soft_limit) / 100;
- snprintf (buf, sizeof(buf), "volume%ld-volname", count);
+ snprintf (buf, sizeof(buf), "volume%"PRId64"-volname",
+ count);
ret = dict_set_str (rsp_dict, buf, volinfo->volname);
if (ret) {
snprintf (err_str, PATH_MAX,
@@ -161,7 +173,7 @@ snap_max_limits_display_commit (dict_t *rsp_dict, char *volname,
}
snprintf (buf, sizeof(buf),
- "volume%ld-snap-max-hard-limit", count);
+ "volume%"PRId64"-snap-max-hard-limit", count);
ret = dict_set_uint64 (rsp_dict, buf, snap_max_limit);
if (ret) {
snprintf (err_str, PATH_MAX,
@@ -170,7 +182,7 @@ snap_max_limits_display_commit (dict_t *rsp_dict, char *volname,
}
snprintf (buf, sizeof(buf),
- "volume%ld-active-hard-limit", count);
+ "volume%"PRId64"-active-hard-limit", count);
ret = dict_set_uint64 (rsp_dict, buf,
active_hard_limit);
if (ret) {
@@ -180,7 +192,7 @@ snap_max_limits_display_commit (dict_t *rsp_dict, char *volname,
}
snprintf (buf, sizeof(buf),
- "volume%ld-snap-max-soft-limit", count);
+ "volume%"PRId64"-snap-max-soft-limit", count);
ret = dict_set_uint64 (rsp_dict, buf, soft_limit_value);
if (ret) {
snprintf (err_str, PATH_MAX,
@@ -214,7 +226,7 @@ snap_max_limits_display_commit (dict_t *rsp_dict, char *volname,
soft_limit_value = (active_hard_limit *
conf->snap_max_soft_limit) / 100;
- snprintf (buf, sizeof(buf), "volume%ld-volname", count);
+ snprintf (buf, sizeof(buf), "volume%"PRId64"-volname", count);
ret = dict_set_str (rsp_dict, buf, volinfo->volname);
if (ret) {
snprintf (err_str, PATH_MAX,
@@ -223,7 +235,7 @@ snap_max_limits_display_commit (dict_t *rsp_dict, char *volname,
}
snprintf (buf, sizeof(buf),
- "volume%ld-snap-max-hard-limit", count);
+ "volume%"PRId64"-snap-max-hard-limit", count);
ret = dict_set_uint64 (rsp_dict, buf, snap_max_limit);
if (ret) {
snprintf (err_str, PATH_MAX,
@@ -232,7 +244,7 @@ snap_max_limits_display_commit (dict_t *rsp_dict, char *volname,
}
snprintf (buf, sizeof(buf),
- "volume%ld-active-hard-limit", count);
+ "volume%"PRId64"-active-hard-limit", count);
ret = dict_set_uint64 (rsp_dict, buf, active_hard_limit);
if (ret) {
snprintf (err_str, PATH_MAX,
@@ -241,7 +253,7 @@ snap_max_limits_display_commit (dict_t *rsp_dict, char *volname,
}
snprintf (buf, sizeof(buf),
- "volume%ld-snap-max-soft-limit", count);
+ "volume%"PRId64"-snap-max-soft-limit", count);
ret = dict_set_uint64 (rsp_dict, buf, soft_limit_value);
if (ret) {
snprintf (err_str, PATH_MAX,