summaryrefslogtreecommitdiffstats
path: root/contrib/fuse-lib/mount-gluster-compat.h
diff options
context:
space:
mode:
authorCsaba Henk <csaba@redhat.com>2012-05-15 13:41:57 +0530
committerAnand Avati <avati@redhat.com>2012-05-21 13:47:41 -0700
commit6012dfe6b9c4d69914078cc0b716bf11aac5e957 (patch)
treeb98aad92cc2fdaca12d72c5d05f1250ce6a6743a /contrib/fuse-lib/mount-gluster-compat.h
parent439d0426dd60ef6c1f4af13fcbbe73f1d206acc6 (diff)
fuse: reorganize mounting code
Macro-driven conditional compilation was a chaos. New scheme is: contrib/fuse-lib/mount-common.c: libfuse routines used both by glusterfs and fusermount contrib/fuse-lib/mount.c: libfuse-derived but customized mounting code for glusterfs contrib/fuse-util/mount_util.c: libfuse routines used only by fusermount Change-Id: I3e0ba7f74e36556b78244cd7676eb4d379939602 BUG: 762389 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3342 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'contrib/fuse-lib/mount-gluster-compat.h')
-rw-r--r--contrib/fuse-lib/mount-gluster-compat.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/fuse-lib/mount-gluster-compat.h b/contrib/fuse-lib/mount-gluster-compat.h
new file mode 100644
index 000000000..17c11e789
--- /dev/null
+++ b/contrib/fuse-lib/mount-gluster-compat.h
@@ -0,0 +1,55 @@
+/*
+ FUSE: Filesystem in Userspace
+ Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
+ Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com>
+
+ This program can be distributed under the terms of the GNU LGPLv2.
+ See the file COPYING.LIB.
+*/
+
+#ifndef _CONFIG_H
+#define _CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stddef.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <dirent.h>
+#include <signal.h>
+#ifndef __NetBSD__
+#include <mntent.h>
+#endif /* __NetBSD__ */
+#include <sys/stat.h>
+#include <sys/poll.h>
+#include <sys/un.h>
+#include <sys/wait.h>
+#include <sys/mount.h>
+
+#ifdef __NetBSD__
+#include <perfuse.h>
+#define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
+#endif
+
+#ifdef linux
+#define _PATH_MOUNT "/bin/mount"
+#else /* NetBSD, MacOS X */
+#define _PATH_MOUNT "/sbin/mount"
+#endif
+
+#ifdef FUSE_UTIL
+#define MALLOC(size) malloc (size)
+#define FREE(ptr) free (ptr)
+#define GFFUSE_LOGERR(...) fprintf (stderr, ## __VA_ARGS__)
+#else /* FUSE_UTIL */
+#include "glusterfs.h"
+#include "logging.h"
+#include "common-utils.h"
+
+#define GFFUSE_LOGERR(...) \
+ gf_log ("glusterfs-fuse", GF_LOG_ERROR, ## __VA_ARGS__)
+#endif /* !FUSE_UTIL */