aboutsummaryrefslogtreecommitdiff
path: root/net/glusterfs/files
diff options
context:
space:
mode:
Diffstat (limited to 'net/glusterfs/files')
-rw-r--r--net/glusterfs/files/glusterd.in26
-rw-r--r--net/glusterfs/files/patch-configure.ac53
-rw-r--r--net/glusterfs/files/patch-contrib_fuse-lib_mount.c10
-rw-r--r--net/glusterfs/files/patch-libglusterfs_src_Makefile.am12
-rw-r--r--net/glusterfs/files/patch-libglusterfs_src_common-utils.c34
-rw-r--r--net/glusterfs/files/patch-libglusterfs_src_glusterfs_syscall.h16
-rw-r--r--net/glusterfs/files/patch-libglusterfs_src_libglusterfs.sym11
-rw-r--r--net/glusterfs/files/patch-libglusterfs_src_syscall.c70
-rw-r--r--net/glusterfs/files/patch-mount_glusterfs.in57
-rw-r--r--net/glusterfs/files/patch-xlators_mgmt_glusterd_src_Makefile.am29
-rw-r--r--net/glusterfs/files/patch-xlators_mgmt_glusterd_src_glusterd-utils.c115
11 files changed, 0 insertions, 433 deletions
diff --git a/net/glusterfs/files/glusterd.in b/net/glusterfs/files/glusterd.in
deleted file mode 100644
index a74e8c51ba62..000000000000
--- a/net/glusterfs/files/glusterd.in
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# PROVIDE: glusterd
-# BEFORE: mountlate
-# REQUIRE: NETWORKING
-# KEYWORD: shutdown
-
-. /etc/rc.subr
-
-name="glusterd"
-rcvar="${name}_enable"
-start_precmd="glusterd_prestart"
-
-glusterd_prestart()
-{
-
- mkdir -p /var/db/glusterd /var/log/glusterfs
-}
-
-load_rc_config $name
-: ${glusterd_program:="%%PREFIX%%/sbin/$name"}
-: ${glusterd_pidfile:="/var/run/${name}.pid"}
-pidfile="$glusterd_pidfile"
-glusterd_flags="--pid-file=\"${glusterd_pidfile}\" ${glusterd_flags}"
-
-run_rc_command "$1"
diff --git a/net/glusterfs/files/patch-configure.ac b/net/glusterfs/files/patch-configure.ac
deleted file mode 100644
index 4335283808e1..000000000000
--- a/net/glusterfs/files/patch-configure.ac
+++ /dev/null
@@ -1,53 +0,0 @@
---- configure.ac.orig 2020-07-06 01:22:37 UTC
-+++ configure.ac
-@@ -351,7 +351,14 @@ if test "x$ac_cv_file__etc_centos_release" = "xyes"; t
- fi
-
- dnl On some distributions '-ldl' isn't automatically added to LIBS
--AC_CHECK_LIB([dl], [dlopen], [LIB_DL=-ldl])
-+case $host_os in
-+ *freebsd*)
-+ #do nothing
-+ ;;
-+ *)
-+ AC_CHECK_LIB([dl], [dlopen], [LIB_DL=-ldl])
-+ ;;
-+esac
- AC_SUBST(LIB_DL)
-
- AC_ARG_ENABLE([privport_tracking],
-@@ -731,6 +738,9 @@ AC_ARG_ENABLE([georeplication],
-
- BUILD_SYNCDAEMON=no
- case $host_os in
-+ freebsd*)
-+#do nothing
-+ ;;
- linux*)
- #do nothing
- ;;
-@@ -1207,10 +1217,6 @@ case $host_os in
- ;;
- *freebsd*)
- GF_HOST_OS="GF_BSD_HOST_OS"
-- GF_CFLAGS="${GF_CFLAGS} -O0"
-- GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
-- GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
-- GF_CFLAGS="${GF_CFLAGS} -D_LIBGEN_H_"
- GF_CFLAGS="${GF_CFLAGS} -DO_DSYNC=0"
- GF_CFLAGS="${GF_CFLAGS} -Dxdr_quad_t=xdr_longlong_t"
- GF_CFLAGS="${GF_CFLAGS} -Dxdr_u_quad_t=xdr_u_longlong_t"
-@@ -1508,6 +1514,13 @@ AC_SUBST(AM_LIBTOOLFLAGS)
- AC_SUBST(GF_NO_UNDEFINED)
- AC_SUBST(GF_XLATOR_DEFAULT_LDFLAGS)
- AC_SUBST(GF_XLATOR_LDFLAGS)
-+AC_SUBST(GF_XLATOR_MGNT_LIBADD)
-+
-+case $host_os in
-+ *freebsd*)
-+ GF_XLATOR_MGNT_LIBADD="-lutil -lprocstat"
-+ ;;
-+esac
-
- CONTRIBDIR='$(top_srcdir)/contrib'
- AC_SUBST(CONTRIBDIR)
diff --git a/net/glusterfs/files/patch-contrib_fuse-lib_mount.c b/net/glusterfs/files/patch-contrib_fuse-lib_mount.c
deleted file mode 100644
index ac27edd4a418..000000000000
--- a/net/glusterfs/files/patch-contrib_fuse-lib_mount.c
+++ /dev/null
@@ -1,10 +0,0 @@
---- contrib/fuse-lib/mount.c.orig 2020-07-06 01:22:37 UTC
-+++ contrib/fuse-lib/mount.c
-@@ -390,6 +390,7 @@ fuse_mount_sys (const char *mountpoint, char *fsname,
- build_iovec (&iov, &iovlen, "from", "/dev/fuse", -1);
- build_iovec (&iov, &iovlen, "volname", source, -1);
- build_iovec (&iov, &iovlen, "fd", fdstr, -1);
-+ build_iovec (&iov, &iovlen, "allow_other", NULL, -1);
- ret = nmount (iov, iovlen, mountflags);
- #else
- ret = mount (source, mountpoint, fstype, mountflags,
diff --git a/net/glusterfs/files/patch-libglusterfs_src_Makefile.am b/net/glusterfs/files/patch-libglusterfs_src_Makefile.am
deleted file mode 100644
index 6f0c52dfc98f..000000000000
--- a/net/glusterfs/files/patch-libglusterfs_src_Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
---- libglusterfs/src/Makefile.am.orig 2020-07-06 01:22:37 UTC
-+++ libglusterfs/src/Makefile.am
-@@ -12,7 +12,8 @@ libglusterfs_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE
- -DSBIN_DIR=\"$(sbindir)\" -I$(CONTRIBDIR)/timer-wheel \
- -I$(CONTRIBDIR)/xxhash
-
--libglusterfs_la_LIBADD = $(ZLIB_LIBS) $(MATH_LIB) $(UUID_LIBS)
-+libglusterfs_la_LIBADD = $(ZLIB_LIBS) $(MATH_LIB) $(UUID_LIBS) $(LIB_DL) \
-+ $(URCU_LIBS) $(URCU_CDS_LIBS)
- libglusterfs_la_LDFLAGS = -version-info $(LIBGLUSTERFS_LT_VERSION) $(GF_LDFLAGS) \
- -export-symbols $(top_srcdir)/libglusterfs/src/libglusterfs.sym
-
diff --git a/net/glusterfs/files/patch-libglusterfs_src_common-utils.c b/net/glusterfs/files/patch-libglusterfs_src_common-utils.c
deleted file mode 100644
index 9220c8eb3b7c..000000000000
--- a/net/glusterfs/files/patch-libglusterfs_src_common-utils.c
+++ /dev/null
@@ -1,34 +0,0 @@
---- libglusterfs/src/common-utils.c.orig 2020-07-06 01:22:37 UTC
-+++ libglusterfs/src/common-utils.c
-@@ -3113,7 +3113,7 @@ get_mem_size()
- memsize = page_size * num_pages;
- #endif
-
--#if defined GF_DARWIN_HOST_OS
-+#if defined GF_DARWIN_HOST_OS || defined __FreeBSD__
-
- size_t len = sizeof(memsize);
- int name[] = {CTL_HW, HW_PHYSMEM};
-@@ -4127,6 +4127,14 @@ gf_skip_header_section(int fd, int header_len)
- gf_boolean_t
- gf_is_pid_running(int pid)
- {
-+#ifdef __FreeBSD__
-+ int ret = -1;
-+
-+ ret = sys_kill(pid, 0);
-+ if (ret < 0) {
-+ return _gf_false;
-+ }
-+#else
- char fname[32] = {
- 0,
- };
-@@ -4140,6 +4148,7 @@ gf_is_pid_running(int pid)
- }
-
- sys_close(fd);
-+#endif
- return _gf_true;
- }
-
diff --git a/net/glusterfs/files/patch-libglusterfs_src_glusterfs_syscall.h b/net/glusterfs/files/patch-libglusterfs_src_glusterfs_syscall.h
deleted file mode 100644
index 481cda04338d..000000000000
--- a/net/glusterfs/files/patch-libglusterfs_src_glusterfs_syscall.h
+++ /dev/null
@@ -1,16 +0,0 @@
---- libglusterfs/src/glusterfs/syscall.h.orig 2020-08-04 12:41:32 UTC
-+++ libglusterfs/src/glusterfs/syscall.h
-@@ -266,4 +266,13 @@ ssize_t
- sys_copy_file_range(int fd_in, off64_t *off_in, int fd_out, off64_t *off_out,
- size_t len, unsigned int flags);
-
-+int
-+sys_kill(pid_t pid, int sig);
-+
-+#ifdef __FreeBSD__
-+int
-+sys_sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp,
-+ const void *newp, size_t newlen);
-+#endif
-+
- #endif /* __SYSCALL_H__ */
diff --git a/net/glusterfs/files/patch-libglusterfs_src_libglusterfs.sym b/net/glusterfs/files/patch-libglusterfs_src_libglusterfs.sym
deleted file mode 100644
index 84a38f1a3e7f..000000000000
--- a/net/glusterfs/files/patch-libglusterfs_src_libglusterfs.sym
+++ /dev/null
@@ -1,11 +0,0 @@
---- libglusterfs/src/libglusterfs.sym.orig 2020-08-04 12:41:32 UTC
-+++ libglusterfs/src/libglusterfs.sym
-@@ -1080,6 +1080,8 @@ sys_write
- sys_writev
- sys_socket
- sys_accept
-+sys_kill
-+sys_sysctl
- tbf_init
- tbf_throttle
- timespec_now
diff --git a/net/glusterfs/files/patch-libglusterfs_src_syscall.c b/net/glusterfs/files/patch-libglusterfs_src_syscall.c
deleted file mode 100644
index ad4c70893dbd..000000000000
--- a/net/glusterfs/files/patch-libglusterfs_src_syscall.c
+++ /dev/null
@@ -1,70 +0,0 @@
---- libglusterfs/src/syscall.c.orig 2020-08-04 12:41:32 UTC
-+++ libglusterfs/src/syscall.c
-@@ -13,6 +13,10 @@
- #include "glusterfs/mem-pool.h"
- #include "glusterfs/libglusterfs-messages.h"
-
-+#ifdef __FreeBSD__
-+#include <sys/sysctl.h>
-+#include <signal.h>
-+#endif
- #include <sys/types.h>
- #include <utime.h>
- #include <sys/time.h>
-@@ -506,9 +510,17 @@ sys_lsetxattr(const char *path, const char *name, cons
- #endif
-
- #ifdef GF_BSD_HOST_OS
-- return FS_RET_CHECK0(
-+ ssize_t ret = FS_RET_CHECK(
- extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, value, size),
- errno);
-+ /* On BSD extattr_set_link returns the number of bytes written/read on
-+ * success. Force this to be 0 if it was successful so the result remains
-+ * compatible with other platform expectations.
-+ */
-+ if(ret > 0) {
-+ ret = 0;
-+ }
-+ return ret;
- #endif
-
- #ifdef GF_SOLARIS_HOST_OS
-@@ -624,9 +636,17 @@ sys_fsetxattr(int filedes, const char *name, const voi
- #endif
-
- #ifdef GF_BSD_HOST_OS
-- return FS_RET_CHECK0(
-+ ssize_t ret = FS_RET_CHECK(
- extattr_set_fd(filedes, EXTATTR_NAMESPACE_USER, name, value, size),
- errno);
-+ /* On BSD extattr_set_fd returns the number of bytes written/read on
-+ * success. Force this to be 0 if it was successful so the result remains
-+ * compatible with other platform expectations.
-+ */
-+ if(ret > 0) {
-+ ret = 0;
-+ }
-+ return ret;
- #endif
-
- #ifdef GF_SOLARIS_HOST_OS
-@@ -854,3 +874,18 @@ sys_copy_file_range(int fd_in, off64_t *off_in, int fd
- #endif /* HAVE_COPY_FILE_RANGE_SYS */
- #endif /* HAVE_COPY_FILE_RANGE */
- }
-+
-+#ifdef __FreeBSD__
-+int
-+sys_kill(pid_t pid, int sig)
-+{
-+ return FS_RET_CHECK0(kill(pid, sig), errno);
-+}
-+
-+int
-+sys_sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp,
-+ const void *newp, size_t newlen)
-+{
-+ return FS_RET_CHECK0(sysctl(name, namelen, oldp, oldlenp, newp, newlen), errno);
-+}
-+#endif
diff --git a/net/glusterfs/files/patch-mount_glusterfs.in b/net/glusterfs/files/patch-mount_glusterfs.in
deleted file mode 100644
index c3b7abcaf8a1..000000000000
--- a/net/glusterfs/files/patch-mount_glusterfs.in
+++ /dev/null
@@ -1,57 +0,0 @@
---- xlators/mount/fuse/utils/mount_glusterfs.in.orig 2017-06-28 05:25:12 UTC
-+++ xlators/mount/fuse/utils/mount_glusterfs.in
-@@ -463,50 +463,44 @@ parse_options()
- if [ "$key" = "$value" ]; then
- without_options $pair;
- else
- with_options $key $value;
- fi
- done
- }
-
- main ()
- {
-- ## `mount` on OSX specifies options as first argument
-- echo $1|grep -q -- "-o"
-- if [ $? -eq 0 ]; then
-- volfile_loc=$3
-- mount_point=$4
-- else
-- volfile_loc=$1
-- mount_point=$2
-- fi
--
- while getopts "Vo:h" opt; do
- case "${opt}" in
- o)
- parse_options ${OPTARG};
- ;;
- V)
- ${cmd_line} -V;
- exit 0;
- ;;
- h)
- print_usage;
- exit 0;
- ;;
- ?)
- print_usage;
- exit 0;
- ;;
- esac
- done
-
-+ shift $((OPTIND - 1))
-+ volfile_loc="$1"
-+ mount_point="$2"
-+
- [ -r "$volfile_loc" ] || {
- # '%' included to support ipv6 link local addresses
- server_ip=$(echo "$volfile_loc" | sed -n 's/\([a-zA-Z0-9:%.\-]*\):.*/\1/p');
- volume_str=$(echo "$volfile_loc" | sed -n 's/.*:\([^ ]*\).*/\1/p');
- [ -n "$volume_str" ] && {
- volume_id="$volume_str";
- }
- volfile_loc="";
- }
-
diff --git a/net/glusterfs/files/patch-xlators_mgmt_glusterd_src_Makefile.am b/net/glusterfs/files/patch-xlators_mgmt_glusterd_src_Makefile.am
deleted file mode 100644
index b7237c2cff98..000000000000
--- a/net/glusterfs/files/patch-xlators_mgmt_glusterd_src_Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
---- xlators/mgmt/glusterd/src/Makefile.am.orig 2020-07-16 17:28:50 UTC
-+++ xlators/mgmt/glusterd/src/Makefile.am
-@@ -25,13 +25,14 @@ glusterd_la_SOURCES = glusterd.c glusterd-handler.c gl
- glusterd-conn-helper.c glusterd-snapd-svc.c glusterd-snapd-svc-helper.c \
- glusterd-bitd-svc.c glusterd-scrub-svc.c glusterd-server-quorum.c \
- glusterd-reset-brick.c glusterd-shd-svc.c glusterd-shd-svc-helper.c \
-- glusterd-gfproxyd-svc.c glusterd-gfproxyd-svc-helper.c glusterd-ganesha.c
-+ glusterd-gfproxyd-svc.c glusterd-gfproxyd-svc-helper.c glusterd-ganesha.c \
-+ $(CONTRIBDIR)/mount/mntent.c
-
- glusterd_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
- $(top_builddir)/libglusterd/src/libglusterd.la \
- $(top_builddir)/rpc/xdr/src/libgfxdr.la \
- $(top_builddir)/rpc/rpc-lib/src/libgfrpc.la \
-- $(XML_LIBS) -lcrypto $(URCU_LIBS) $(URCU_CDS_LIBS) $(LIB_DL)
-+ $(XML_LIBS) -lcrypto $(URCU_LIBS) $(URCU_CDS_LIBS) $(LIB_DL) $(GF_XLATOR_MGNT_LIBADD)
-
- noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-op-sm.h \
- glusterd-sm.h glusterd-store.h glusterd-mem-types.h \
-@@ -46,7 +47,8 @@ noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-
- glusterd-scrub-svc.h glusterd-server-quorum.h glusterd-errno.h \
- glusterd-shd-svc.h glusterd-shd-svc-helper.h \
- glusterd-gfproxyd-svc.h glusterd-gfproxyd-svc-helper.h \
-- $(CONTRIBDIR)/userspace-rcu/rculist-extra.h
-+ $(CONTRIBDIR)/userspace-rcu/rculist-extra.h \
-+ $(CONTRIBDIR)/mount/mntent_compat.h
-
- AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
- -I$(top_srcdir)/rpc/xdr/src -I$(top_builddir)/rpc/xdr/src \
diff --git a/net/glusterfs/files/patch-xlators_mgmt_glusterd_src_glusterd-utils.c b/net/glusterfs/files/patch-xlators_mgmt_glusterd_src_glusterd-utils.c
deleted file mode 100644
index 64177ca734f2..000000000000
--- a/net/glusterfs/files/patch-xlators_mgmt_glusterd_src_glusterd-utils.c
+++ /dev/null
@@ -1,115 +0,0 @@
---- xlators/mgmt/glusterd/src/glusterd-utils.c.orig 2020-07-06 01:22:37 UTC
-+++ xlators/mgmt/glusterd/src/glusterd-utils.c
-@@ -79,6 +79,14 @@
- #include <sys/sockio.h>
- #endif
-
-+#ifdef __FreeBSD__
-+#include <sys/sysctl.h>
-+#include <sys/param.h>
-+#include <sys/queue.h>
-+#include <libprocstat.h>
-+#include <libutil.h>
-+#endif
-+
- #define NFS_PROGRAM 100003
- #define NFSV3_VERSION 3
-
-@@ -6270,7 +6278,6 @@ find_compatible_brick(glusterd_conf_t *conf, glusterd_
- int
- glusterd_get_sock_from_brick_pid(int pid, char *sockpath, size_t len)
- {
-- char fname[128] = "";
- char buf[1024] = "";
- char cmdline[2048] = "";
- xlator_t *this = NULL;
-@@ -6285,6 +6292,22 @@ glusterd_get_sock_from_brick_pid(int pid, char *sockpa
- this = THIS;
- GF_ASSERT(this);
-
-+#ifdef __FreeBSD__
-+ blen = sizeof(buf);
-+ int mib[4];
-+
-+ mib[0] = CTL_KERN;
-+ mib[1] = KERN_PROC;
-+ mib[2] = KERN_PROC_ARGS;
-+ mib[3] = pid;
-+
-+ if (sys_sysctl(mib, 4, buf, &blen, NULL, blen) != 0) {
-+ gf_log(this->name, GF_LOG_ERROR, "brick process %d is not running",
-+ pid);
-+ return ret;
-+ }
-+#else
-+ char fname[128] = "";
- snprintf(fname, sizeof(fname), "/proc/%d/cmdline", pid);
-
- if (sys_access(fname, R_OK) != 0) {
-@@ -6301,6 +6324,7 @@ glusterd_get_sock_from_brick_pid(int pid, char *sockpa
- strerror(errno), fname);
- return ret;
- }
-+#endif
-
- /* convert cmdline to single string */
- for (i = 0, j = 0; i < blen; i++) {
-@@ -6349,6 +6373,42 @@ glusterd_get_sock_from_brick_pid(int pid, char *sockpa
- char *
- search_brick_path_from_proc(pid_t brick_pid, char *brickpath)
- {
-+ char *brick_path = NULL;
-+#ifdef __FreeBSD__
-+ struct filestat *fst;
-+ struct procstat *ps;
-+ struct kinfo_proc *kp;
-+ struct filestat_list *head;
-+
-+ ps = procstat_open_sysctl();
-+ if (ps == NULL)
-+ goto out;
-+
-+ kp = kinfo_getproc(brick_pid);
-+ if (kp == NULL)
-+ goto out;
-+
-+ head = procstat_getfiles(ps, (void *)kp, 0);
-+ if (head == NULL)
-+ goto out;
-+
-+ STAILQ_FOREACH(fst, head, next) {
-+ if(fst->fs_fd < 0)
-+ continue;
-+
-+ if (!strcmp(fst->fs_path, brickpath)) {
-+ brick_path = gf_strdup(fst->fs_path);
-+ break;
-+ }
-+ }
-+
-+out:
-+ if (head != NULL)
-+ procstat_freefiles(ps, head);
-+ if (kp != NULL)
-+ free(kp);
-+ procstat_close(ps);
-+#else
- struct dirent *dp = NULL;
- DIR *dirp = NULL;
- size_t len = 0;
-@@ -6359,7 +6419,6 @@ search_brick_path_from_proc(pid_t brick_pid, char *bri
- 0,
- },
- };
-- char *brick_path = NULL;
-
- if (!brickpath)
- goto out;
-@@ -6396,6 +6455,7 @@ search_brick_path_from_proc(pid_t brick_pid, char *bri
- }
- out:
- sys_closedir(dirp);
-+#endif
- return brick_path;
- }
-