summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>1998-09-05 17:33:29 +0000
committerart <art@openbsd.org>1998-09-05 17:33:29 +0000
commitd08dc8d10b04ddd1d83412c9bb2bf3207bf9fe93 (patch)
tree5fdcddc38d74275e7b185ef19a2ab6216b3b5b16
parentWe can now savecore with a gzipped kernel: (diff)
downloadwireguard-openbsd-d08dc8d10b04ddd1d83412c9bb2bf3207bf9fe93.tar.xz
wireguard-openbsd-d08dc8d10b04ddd1d83412c9bb2bf3207bf9fe93.zip
code for mounting xfs
-rw-r--r--sbin/mount_xfs/Makefile11
-rw-r--r--sbin/mount_xfs/mount_xfs.883
-rw-r--r--sbin/mount_xfs/mount_xfs.c116
3 files changed, 210 insertions, 0 deletions
diff --git a/sbin/mount_xfs/Makefile b/sbin/mount_xfs/Makefile
new file mode 100644
index 00000000000..bc5eee745ce
--- /dev/null
+++ b/sbin/mount_xfs/Makefile
@@ -0,0 +1,11 @@
+# $OpenBSD: Makefile,v 1.1 1998/09/05 17:33:30 art Exp $
+
+PROG= mount_xfs
+SRCS= mount_xfs.c getmntopts.c
+MAN= mount_xfs.8
+
+MOUNT= ${.CURDIR}/../mount
+CFLAGS+= -I${.CURDIR}/../../sys -I${MOUNT}
+.PATH: ${MOUNT}
+
+.include <bsd.prog.mk>
diff --git a/sbin/mount_xfs/mount_xfs.8 b/sbin/mount_xfs/mount_xfs.8
new file mode 100644
index 00000000000..00be4003229
--- /dev/null
+++ b/sbin/mount_xfs/mount_xfs.8
@@ -0,0 +1,83 @@
+.\" $OpenBSD: mount_xfs.8,v 1.1 1998/09/05 17:33:29 art Exp $
+.\" $NetBSD: mount_null.8,v 1.4 1996/04/10 20:57:19 thorpej Exp $
+.\"
+.\" Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
+.\" (Royal Institute of Technology, Stockholm, Sweden).
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\"
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the Kungliga Tekniska
+.\" Högskolan and its contributors.
+.\"
+.\" 4. Neither the name of the Institute nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd August 14, 1998
+.Dt MOUNT_XFS 8
+.Os OpenBSD
+.Sh NAME
+.Nm mount_xfs
+.Nd mount the xfs filesystem.
+.Sh SYNOPSIS
+.Nm mount_xfs
+.Op Fl a
+.Op Fl o Ar options
+.Ar char-device
+.Ar mount-point
+.Sh DESCRIPTION
+The
+.Nm mount_xfs
+command mounts one of the xfs character devices. The character device is used
+for comunication with a user-land cachemanager and fileprovider.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
+.It Fl a
+Do not start
+.Xr afsd
+when mounting
+.It Fl o
+Options are specified with a
+.Fl o
+flag followed by a comma separated string of options.
+See the
+.Xr mount 8
+man page for possible options and their meanings.
+.El
+.Pp
+The xfs filesystem was written primarily to make a free, AFS-compatible
+filesystem Arla. But since the xfs interface is pretty simple and generic
+it could be used for other filesystems asweel.
+.\"
+.Sh SEE ALSO
+.Xr mount 8
+.Xr arlad 8
+.Sh HISTORY
+The
+.Nm mount_xfs
+utility first appeared in OpenBSD 2.4.
diff --git a/sbin/mount_xfs/mount_xfs.c b/sbin/mount_xfs/mount_xfs.c
new file mode 100644
index 00000000000..8491a820276
--- /dev/null
+++ b/sbin/mount_xfs/mount_xfs.c
@@ -0,0 +1,116 @@
+/* $OpenBSD: mount_xfs.c,v 1.1 1998/09/05 17:33:29 art Exp $ */
+/*
+ * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the Kungliga Tekniska
+ * Högskolan and its contributors.
+ *
+ * 4. Neither the name of the Institute nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+#include <errno.h>
+#include <err.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <paths.h>
+#include "mntopts.h"
+
+
+extern char *__progname;
+
+static const struct mntopt mopts[] = {
+ MOPT_STDOPTS,
+ MOPT_ASYNC,
+ MOPT_SYNC,
+ MOPT_UPDATE,
+ MOPT_RELOAD,
+ {NULL}
+};
+
+static void
+usage(void)
+{
+ fprintf(stderr, "Usage: %s [-a] [-o options] device path\n",
+ __progname);
+ exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+ extern int optreset;
+ int error;
+ int ch;
+ int mntflags = 0;
+#ifdef not_yet
+ int afsd = 1;
+#endif
+
+ optind = optreset = 1;
+ while ((ch = getopt(argc, argv, "ao:")) != -1)
+ switch (ch) {
+ case 'o':
+ getmntopts(optarg, mopts, &mntflags);
+ break;
+#ifdef not_yey
+ case 'a':
+ afsd = 0;
+ break;
+#endif
+ case '?':
+ default:
+ usage();
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 2)
+ usage();
+
+ error = mount("xfs", argv[1], mntflags, argv[0]);
+
+ if (error != 0)
+ err(1, "mount");
+
+#ifdef not_yet
+ if (afsd) {
+ execl(_PATH_AFSD, "afsd", NULL);
+ err(1, "Error starting afsd:");
+ }
+#endif
+
+ return 0;
+}