diff options
author | 2005-11-24 12:08:15 +0000 | |
---|---|---|
committer | 2005-11-24 12:08:15 +0000 | |
commit | ec91663771e824427013ca9734cf65f831007ca5 (patch) | |
tree | 280df8653dbae641624b4abdeaf6ce18ce24b49e | |
parent | ike has used hmac sha1/md5 since ever. So call 'em hmac-sha1/md5. (diff) | |
download | wireguard-openbsd-ec91663771e824427013ca9734cf65f831007ca5.tar.xz wireguard-openbsd-ec91663771e824427013ca9734cf65f831007ca5.zip |
Remove kernfs, okay deraadt@.
31 files changed, 30 insertions, 2389 deletions
diff --git a/etc/daily b/etc/daily index 07a6d5a58f1..cb650fca2ed 100644 --- a/etc/daily +++ b/etc/daily @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: daily,v 1.51 2005/09/29 00:31:08 deraadt Exp $ +# $OpenBSD: daily,v 1.52 2005/11/24 12:08:15 pedro Exp $ # From: @(#)daily 8.2 (Berkeley) 1/25/94 # PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin @@ -57,7 +57,7 @@ if [ -d /var/rwho -a ! -L /var/rwho ] ; then fi #find / \( ! -fstype local -o -fstype rdonly -o -fstype fdesc \ -# -o -fstype kernfs -o -fstype procfs \) -a -prune -o \ +# -o -fstype procfs \) -a -prune -o \ # -name 'lost+found' -a -prune -o \ # -name '*.core' -a -print -o \ # \( -name '[#,]*' -o -name '.#*' -o -name a.out \ diff --git a/etc/security b/etc/security index a69227ccca9..8d4471b083c 100644 --- a/etc/security +++ b/etc/security @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: security,v 1.72 2005/11/11 18:15:07 deraadt Exp $ +# $OpenBSD: security,v 1.73 2005/11/24 12:08:15 pedro Exp $ # from: @(#)security 8.1 (Berkeley) 6/9/93 # @@ -457,7 +457,7 @@ fi # Display any changes in setuid/setgid files and devices. pending="\nChecking setuid/setgid files and devices:\n" -(find / \( ! -fstype local -o -fstype fdesc -o -fstype kernfs \ +(find / \( ! -fstype local -o -fstype fdesc \ -o -fstype procfs -o -fstype afs -o -fstype xfs \) -a -prune -o \ -type f -a \( -perm -u+s -o -perm -g+s \) -print0 -o \ ! -type d -a ! -type f -a ! -type l -a ! -type s -a ! -type p \ diff --git a/sbin/Makefile b/sbin/Makefile index cef1c65a335..b032d093ca4 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.74 2005/05/26 01:29:02 pedro Exp $ +# $OpenBSD: Makefile,v 1.75 2005/11/24 12:08:15 pedro Exp $ # Not ported: XNSrouted enpload scsiformat startslip # Missing: icheck @@ -15,7 +15,6 @@ SUBDIR+= mount_ados SUBDIR+= mount_cd9660 SUBDIR+= mount_fdesc SUBDIR+= mount_ffs newfs fsck_ffs fsdb dumpfs dump restore clri tunefs fsirand -SUBDIR+= mount_kernfs # mount_mfs -> newfs SUBDIR+= mount_msdos newfs_msdos fsck_msdos SUBDIR+= mount_nfs diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8 index e065ac972a1..48ecfa9df93 100644 --- a/sbin/mount/mount.8 +++ b/sbin/mount/mount.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mount.8,v 1.52 2005/06/27 08:55:39 jmc Exp $ +.\" $OpenBSD: mount.8,v 1.53 2005/11/24 12:08:15 pedro Exp $ .\" $NetBSD: mount.8,v 1.11 1995/07/12 06:23:21 cgd Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 @@ -359,7 +359,6 @@ with option .Xr mount_ext2fs 8 , .Xr mount_fdesc 8 , .Xr mount_ffs 8 , -.Xr mount_kernfs 8 , .Xr mount_mfs 8 , .Xr mount_msdos 8 , .Xr mount_nfs 8 , diff --git a/sbin/mount_kernfs/Makefile b/sbin/mount_kernfs/Makefile deleted file mode 100644 index 9ba6afd1602..00000000000 --- a/sbin/mount_kernfs/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $OpenBSD: Makefile,v 1.3 1997/09/21 11:37:16 deraadt Exp $ - -PROG= mount_kernfs -SRCS= mount_kernfs.c getmntopts.c -MAN= mount_kernfs.8 - -MOUNT= ${.CURDIR}/../mount -CFLAGS+= -I${MOUNT} -.PATH: ${MOUNT} - -.include <bsd.prog.mk> diff --git a/sbin/mount_kernfs/mount_kernfs.8 b/sbin/mount_kernfs/mount_kernfs.8 deleted file mode 100644 index cb8078c5dab..00000000000 --- a/sbin/mount_kernfs/mount_kernfs.8 +++ /dev/null @@ -1,187 +0,0 @@ -.\" $OpenBSD: mount_kernfs.8,v 1.23 2005/04/28 17:32:35 biorn Exp $ -.\" $NetBSD: mount_kernfs.8,v 1.6 1995/03/18 14:57:24 cgd Exp $ -.\" -.\" Copyright (c) 1992, 1993, 1994 -.\" The Regents of the University of California. All rights reserved. -.\" All rights reserved. -.\" -.\" This code is derived from software donated to Berkeley by -.\" Jan-Simon Pendry. -.\" -.\" 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. -.\" -.\" @(#)mount_kernfs.8 8.2 (Berkeley) 3/27/94 -.\" -.Dd March 27, 1994 -.Dt MOUNT_KERNFS 8 -.Os -.Sh NAME -.Nm mount_kernfs -.Nd mount the /kern file system -.Sh SYNOPSIS -.Nm mount_kernfs -.Op Fl o Ar options -.Ar /kern -.Ar mount_point -.Sh DESCRIPTION -The -.Nm -command attaches an instance of the kernel parameter -namespace to the global filesystem namespace. -The conventional mount point is -.Pa /kern . -This command is invoked by -.Xr mount 8 -when using the syntax -.Bd -ragged -offset 4n -.Nm mount Op options --t kernfs -.Ar /kern -.Ar mount_point -.Ed -.Pp -This command is normally executed by -.Xr mount 8 -at boot time. -.Pp -The filesystem includes several regular files which can be read, -some of which can also be written. -The contents of the files are in a machine-independent format, -either a string, or an integer in decimal ASCII. -Where numbers are returned, a trailing newline character is also added. -.Pp -The options are as follows: -.Bl -tag -width Ds -.It Fl o Ar options -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 -Statistics reported by -.Xr df 1 -on the -.Pa /kern -filesystem will indicate the amount of -unwired/physical memory instead of -.Sq disk space , -and the number of vnodes -used/allocated instead of -.Sq inodes . -The filesystem's block size is the system's page size. -.Sh FILES -.Bl -tag -width domainname -compact -.It Pa boottime -Time at which the system was last booted (decimal ASCII). -.It Pa byteorder -_BYTE_ORDER for this kernel. -.It Pa copyright -Kernel copyright message. -.It Pa domainname -The domainname, with a trailing newline. -Behaves like a hostname. -.It Pa hostname -The hostname, with a trailing newline. -The hostname can be changed by writing to this file. -A trailing newline will be stripped from the hostname being written. -.It Pa hz -Frequency of the system clock (decimal ASCII). -.It Pa ipsec -The currently configured IPsec Security Associations. -.It Pa loadavg -The 1, 5 and 15 minute load average in kernel fixed-point format. -The final integer is the fix-point scaling factor. -All numbers are in decimal ASCII. -.It Pa machine -Architecture this kernel was compiled for. -.It Pa model -Model of the processor this machine is running on. -.It Pa msgbuf -Kernel message buffer, also read by -.Xr syslogd 8 , -through the -.Pa log -device, and by -.Xr dmesg 8 . -.It Pa ncpu -Number of CPUs in this machine. -.It Pa osrelease -OS release number. -.It Pa osrev -OS revision number (BSD from -.Aq Pa sys/param.h ) . -.It Pa ostype -OS type for this kernel ("OpenBSD"). -.It Pa pagesize -Machine pagesize (decimal ASCII). -.It Pa physmem -Number of pages of physical memory in the machine (decimal ASCII). -.\" .It Pa root -.\" the system root directory. -.\" In a chroot'ed environment, -.\" .Nm -.\" can be used to create a new -.\" .Pa /kern -.\" mount point. -.\" .Pa /kern/root -.\" will then refer to the system global root, not the current process root. -.It Pa posix -_POSIX_VERSION for this kernel. -.It Pa rootdev -Root device. -.It Pa rrootdev -Raw root device. -.It Pa time -Second and microsecond value of the system clock. -Both numbers are in decimal ASCII. -.It Pa usermem -Number of pages of physical memory available for user processes. -.It Pa version -Kernel version string. -The head line for -.Pa /etc/motd -can be generated by running: -.Dq Ic "sed 1q /kern/version" . -.El -.Sh SEE ALSO -.Xr mount 2 , -.Xr fstab 5 , -.Xr dmesg 8 , -.Xr mount 8 , -.Xr syslogd 8 , -.Xr umount 8 -.Sh HISTORY -The -.Nm -utility first appeared in -.Bx 4.4 . -.Sh CAVEATS -This filesystem may not be NFS-exported. -.Pp -Due to non-atomic operations and the potential for race conditions, -programs should not depend on information obtained from this filesystem. diff --git a/sbin/mount_kernfs/mount_kernfs.c b/sbin/mount_kernfs/mount_kernfs.c deleted file mode 100644 index 9a8bec1eb69..00000000000 --- a/sbin/mount_kernfs/mount_kernfs.c +++ /dev/null @@ -1,111 +0,0 @@ -/* $OpenBSD: mount_kernfs.c,v 1.12 2005/04/08 20:09:37 jaredy Exp $ */ -/* $NetBSD: mount_kernfs.c,v 1.8 1996/04/13 05:35:39 cgd Exp $ */ - -/* - * Copyright (c) 1990, 1992 Jan-Simon Pendry - * Copyright (c) 1992, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Jan-Simon Pendry. - * - * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. - */ - -#ifndef lint -char copyright[] = -"@(#) Copyright (c) 1992, 1993, 1994\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)mount_kernfs.c 8.2 (Berkeley) 3/27/94"; -#else -static char rcsid[] = "$OpenBSD: mount_kernfs.c,v 1.12 2005/04/08 20:09:37 jaredy Exp $"; -#endif -#endif /* not lint */ - -#include <sys/param.h> -#include <sys/mount.h> - -#include <err.h> -#include <errno.h> -#include <unistd.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "mntopts.h" - -const struct mntopt mopts[] = { - MOPT_STDOPTS, - { NULL } -}; - -void usage(void); - -int -main(int argc, char *argv[]) -{ - int ch, mntflags; - char path[MAXPATHLEN]; - - mntflags = 0; - while ((ch = getopt(argc, argv, "o:")) != -1) - switch (ch) { - case 'o': - getmntopts(optarg, mopts, &mntflags); - break; - case '?': - default: - usage(); - } - argc -= optind; - argv += optind; - - if (argc != 2) - usage(); - - if (realpath(argv[1], path) == NULL) - err(1, "realpath %s", argv[1]); - - if (mount(MOUNT_KERNFS, path, mntflags, NULL)) { - if (errno == EOPNOTSUPP) - errx(1, "Filesystem not supported by kernel"); - else - err(1, NULL); - } - - return 0; -} - -void -usage(void) -{ - (void)fprintf(stderr, - "usage: mount_kernfs [-o options] /kern mount_point\n"); - exit(1); -} diff --git a/share/lkm/Makefile b/share/lkm/Makefile index 2c53281dc74..d727fe73ec2 100644 --- a/share/lkm/Makefile +++ b/share/lkm/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.3 2005/09/27 16:27:23 deraadt Exp $ +# $OpenBSD: Makefile,v 1.4 2005/11/24 12:08:15 pedro Exp $ # # -FILES= README syscall vfs misc +FILES= README syscall misc NOOBJ= noobj all clean cleandir depend lint tags: diff --git a/share/lkm/vfs/Makefile b/share/lkm/vfs/Makefile deleted file mode 100644 index cd651ba0e17..00000000000 --- a/share/lkm/vfs/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2000/03/02 14:46:39 todd Exp $ -# -# Makefile for sample loadable file system -# -# 25 May 93 Terry Lambert Original -# -# Copyright (c) 1993 Terrence R. Lambert. -# 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 Terrence R. Lambert. -# 4. The name Terrence R. Lambert may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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. -# -# - -SUBDIR= module - -load: _SUBDIRUSE - -unload: _SUBDIRUSE - -.include <bsd.subdir.mk> - -# -# EOF -- This file has not been truncated. -# diff --git a/share/lkm/vfs/README b/share/lkm/vfs/README deleted file mode 100644 index f39e4e14dc3..00000000000 --- a/share/lkm/vfs/README +++ /dev/null @@ -1,98 +0,0 @@ -# $OpenBSD: README,v 1.2 2000/03/02 14:46:39 todd Exp $ -# -# Copyright (c) 1993 Terrence R. Lambert. -# 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 Terrence R. Lambert. -# 4. The name Terrence R. Lambert may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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. -# -# - -1.0 Overview - - This is the README file for the sample loaded file system. - - -2.0 Preparation - - To use this module, you must have a kernel the does *NOT* - have an existing "kernfs" file system in it. To determine - if your system has the "kernfs" file system in it, check - the build file for your kernel (usually this file is named - "/sys/i386/conf/GENERICISA") for the following: - - options KERNFS - - By default, NetBSD has this file system compiled as part - of the kernel; if you wish to use this example with NetBSD - you will have to remove this "options" line and rebuild - your kernel. - - -3.0 Directions - - To test the module, do the following: - - cd module - make load - - A load message (the copyright) will be printed on the console. - - You must then add the following line to the "/etc/fstab" file: - - kernfs /kern kernfs rw 1 1 - - At the root prompt, type the following: - - mkdir /kern - - Ignore the following error if it occurs: - - mkdir: /kern: File exists - - Again at the root prompt, type the following command: - - mount /kern - cd /kern - cat version - - This will verify that the module is working correctly. - - -4.0 Recovering resources - - The file system consumes 8 pages of memory when loaded; it - can be freed up by unloading it. To unload it, type the - following from the directory this file is in: - - cd module - make unload - - The file system will be unloaded by name. - - -5.0 END OF DOCUMENT diff --git a/share/lkm/vfs/module/Makefile b/share/lkm/vfs/module/Makefile deleted file mode 100644 index ad71e65b057..00000000000 --- a/share/lkm/vfs/module/Makefile +++ /dev/null @@ -1,74 +0,0 @@ -# $OpenBSD: Makefile,v 1.7 2001/06/27 06:16:47 art Exp $ -# -# Makefile for newsyscall -# -# 05 Jun 93 Terry Lambert Original -# -# Copyright (c) 1993 Terrence R. Lambert. -# 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 Terrence R. Lambert. -# 4. The name Terrence R. Lambert may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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. -# -# - -SRCS=kernfsmod.c -OBJS=$(SRCS:.c=.o) - -KSRCS=/sys/miscfs/kernfs/kernfs_vfsops.c /sys/miscfs/kernfs/kernfs_vnops.c -KOBJS=kernfs_vfsops.o kernfs_vnops.o - -MODOBJ=combined.o - -KMOD=kernfsmod -CFLAGS+= -D_KERNEL -I/sys -I. - -all: $(MODOBJ) - -clean: - rm -f $(OBJS) $(KOBJS) $(MODOBJ) $(KMOD) - -load: - modload -o $(KMOD) -e$(KMOD) $(MODOBJ) - -unload: - modunload -n $(KMOD) - -kernfs_vfsops.o: /sys/miscfs/kernfs/kernfs_vfsops.c - $(CC) $(CFLAGS) -c -o $@ $< - -kernfs_vnops.o: /sys/miscfs/kernfs/kernfs_vnops.c - $(CC) $(CFLAGS) -c -o $@ $< - -$(MODOBJ): $(OBJS) $(KOBJS) - $(LD) -r -o $(MODOBJ) $(OBJS) $(KOBJS) - -.include <bsd.own.mk> - -# -# EOF -- This file has not been truncated. -# diff --git a/share/lkm/vfs/module/kernfsmod.c b/share/lkm/vfs/module/kernfsmod.c deleted file mode 100644 index 94acff63be5..00000000000 --- a/share/lkm/vfs/module/kernfsmod.c +++ /dev/null @@ -1,109 +0,0 @@ -/* $OpenBSD: kernfsmod.c,v 1.4 2004/04/05 07:19:26 deraadt Exp $ */ -/* - * kernfsmod.c - * - * 05 Jun 93 Terry Lambert Original - * - * Copyright (c) 1993 Terrence R. Lambert. - * 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 Terrence R. Lambert. - * 4. The name Terrence R. Lambert may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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 <sys/param.h> -#include <sys/ioctl.h> -#include <sys/systm.h> -#include <sys/conf.h> -#include <sys/mount.h> -#include <sys/exec.h> -#include <sys/lkm.h> -#include <sys/file.h> -#include <sys/errno.h> - -/* - * This is the vfsops table from /sys/miscfs/kernfs/kernfs_vfsops.c - */ -extern struct vfsops kernfs_vfsops; -extern struct vnodeopv_desc kernfs_vnodeop_opv_desc; - -struct vfsconf kernfs_vfsconf = { - &kernfs_vfsops, MOUNT_KERNFS, 11, 0, 0, NULL, NULL -}; - -/* - * XXX THE FOLLOWING COMMENT IS PROBABLY BOGUS... - cgd, 12/24/94 - * Currently, the mount system call is broken in the way it operates - * and the vfssw[] table does not have a character string identifier - * for the file system type; therefore, to remount a file system after - * it has been mounted in the first place, the offset into the table - * must be the same; this will be corrected in future patches, but - * not right now. At the same time the fstab format will need to - * change to allow definition without mount of file systems. - * - * The flags field is a parameter to the init; this could be used to - * change the file system operation: for instance, in ISOFS, this - * could be used to enable/disable Rockridge extensions. - */ -MOD_VFS("kernfsmod", -1, &kernfs_vfsconf) - -/* - * External entry point; should generally match name of .o file. The - * arguments are always the same for all loaded modules. The "load", - * "unload", and "stat" functions in "DISPATCH" will be called under - * their respective circumstances. If no function is desired, lkm_nofunc() - * should be supplied. They are called with the same arguments (cmd is - * included to allow the use of a single function, ver is included for - * version matching between modules and the kernel loader for the modules). - * - * Since we expect to link in the kernel and add external symbols to - * the kernel symbol name space in a future version, generally all - * functions used in the implementation of a particular module should - * be static unless they are expected to be seen in other modules or - * to resolve unresolved symbols already existing in the kernel (the - * second case is not likely to ever occur). - * - * The entry point should return 0 unless it is refusing load (in which - * case it should return an errno from errno.h). - */ -int -kernfsmod(lkmtp, cmd, ver) - struct lkm_table *lkmtp; - int cmd; - int ver; -{ - - /* - * This is normally done automatically at boot time if the - * opv_desc is listed in vfs_opv_descs[] in vfs_conf.c. For - * loaded modules, we have to do it manually. - */ - vfs_opv_init_explicit(&kernfs_vnodeop_opv_desc); - vfs_opv_init_default(&kernfs_vnodeop_opv_desc); - - DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc) -} diff --git a/share/man/man4/ipsec.4 b/share/man/man4/ipsec.4 index 96a19b986dc..9b293f8fd4d 100644 --- a/share/man/man4/ipsec.4 +++ b/share/man/man4/ipsec.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ipsec.4,v 1.65 2005/08/19 15:45:47 jmc Exp $ +.\" $OpenBSD: ipsec.4,v 1.66 2005/11/24 12:08:16 pedro Exp $ .\" .\" Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> .\" All rights reserved. @@ -350,12 +350,6 @@ The system does guarantee that it will succeed at establishing the required security associations. In any case a properly configured key management daemon is required which listens to messages from the kernel. -.Pp -A list of all security associations in the kernel tables can be -obtained via the kernfs file -.Aq Pa ipsec , -typically in -.Aq Pa /kern/ipsec . .Sh DIAGNOSTICS A socket operation may fail with one of the following errors returned: .Bl -tag -width [EINVAL] diff --git a/share/man/man4/options.4 b/share/man/man4/options.4 index 69d18ea7097..d1584057a38 100644 --- a/share/man/man4/options.4 +++ b/share/man/man4/options.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: options.4,v 1.170 2005/11/13 03:27:41 krw Exp $ +.\" $OpenBSD: options.4,v 1.171 2005/11/24 12:08:16 pedro Exp $ .\" $NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $ .\" .\" Copyright (c) 1998 Theo de Raadt @@ -445,15 +445,6 @@ and on .Pa /dev/stdout , and .Pa /dev/stderr . -.It Cd option KERNFS -Includes code which permits the mounting of a special file system -(normally mounted on -.Pa /kern ) -in which files representing various kernel variables and parameters -may be found. -See -.Xr mount_kernfs 8 -for details. .It Cd option PORTAL Includes the (experimental) portal filesystem. This permits interesting tricks like opening TCP sockets by opening files in @@ -1106,7 +1097,6 @@ is zero, the hardware realtime clock device is not in Daylight Saving Time. .Xr init 8 , .Xr mount_cd9660 8 , .Xr mount_fdesc 8 , -.Xr mount_kernfs 8 , .Xr mount_mfs 8 , .Xr mount_msdos 8 , .Xr mount_nfs 8 , diff --git a/share/man/man5/fstab.5 b/share/man/man5/fstab.5 index 7001f68ecbc..07062f45945 100644 --- a/share/man/man5/fstab.5 +++ b/share/man/man5/fstab.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: fstab.5,v 1.31 2005/10/03 10:57:16 jmc Exp $ +.\" $OpenBSD: fstab.5,v 1.32 2005/11/24 12:08:16 pedro Exp $ .\" $NetBSD: fstab.5,v 1.5.2.1 1995/11/16 20:11:11 pk Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 @@ -109,8 +109,6 @@ filesystem. .It ext2fs A local Linux compatible ext2fs filesystem. -.It kernfs -Various and sundry kernel statistics. .It mfs A local memory-based .Ux diff --git a/share/man/man9/getdevvp.9 b/share/man/man9/getdevvp.9 index f3975677f69..a796c9c5b5c 100644 --- a/share/man/man9/getdevvp.9 +++ b/share/man/man9/getdevvp.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getdevvp.9,v 1.5 2004/08/21 00:02:25 jmc Exp $ +.\" $OpenBSD: getdevvp.9,v 1.6 2005/11/24 12:08:16 pedro Exp $ .\" .\" Copyright (C) 2002 Peter A. Werner. All rights reserved. .\" @@ -77,8 +77,7 @@ use getdevvp internally, specifying the third argument. will create a vnode for a block device, and is used for the root file system and swap areas, among other things. .Fn cdevvp -will create a vnode for a character device and is used in kernfs and in some -console handling. +will create a vnode for a character device and is used in console handling. .Sh RETURN VALUES All functions return 0 on success. If an error occurs, vpp will point to a NULLVP. diff --git a/sys/arch/macppc/macppc/locore.S b/sys/arch/macppc/macppc/locore.S index 2ea6a8b89bb..86ec4b20989 100644 --- a/sys/arch/macppc/macppc/locore.S +++ b/sys/arch/macppc/macppc/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.27 2005/10/20 12:52:13 kettenis Exp $ */ +/* $OpenBSD: locore.S,v 1.28 2005/11/24 12:08:16 pedro Exp $ */ /* $NetBSD: locore.S,v 1.2 1996/10/16 19:33:09 ws Exp $ */ /* @@ -97,7 +97,7 @@ start: lis %r3, fwargsave@ha lwz %r6, fwargsave@l(%r3) lwz %r7, fwargsave@l+4(%r3) -#if defined(DDB) || defined(KERNFS) +#if defined(DDB) cmpwi %r6, 0 beq 1f add %r9,%r6,%r7 diff --git a/sys/arch/mvmeppc/mvmeppc/locore.S b/sys/arch/mvmeppc/mvmeppc/locore.S index 22e43fbeed5..e14ff02af86 100644 --- a/sys/arch/mvmeppc/mvmeppc/locore.S +++ b/sys/arch/mvmeppc/mvmeppc/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.11 2005/08/02 21:27:58 drahn Exp $ */ +/* $OpenBSD: locore.S,v 1.12 2005/11/24 12:08:16 pedro Exp $ */ /* $NetBSD: locore.S,v 1.2 1996/10/16 19:33:09 ws Exp $ */ /* @@ -82,7 +82,7 @@ start: stw %r4, _C_LABEL(bootdev)@l(%r9) /* compute end of kernel memory */ -#if defined(DDB) || defined(KERNFS) +#if defined(DDB) lis %r9,_C_LABEL(esym)@ha stw %r8,_C_LABEL(esym)@l(%r9) /* save for symbol handling */ #else diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC index 0578234fdc4..89969dba868 100644 --- a/sys/conf/GENERIC +++ b/sys/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.120 2005/10/05 17:32:22 norby Exp $ +# $OpenBSD: GENERIC,v 1.121 2005/11/24 12:08:16 pedro Exp $ # # Machine-independent option; used by all architectures for their # GENERIC kernel @@ -54,7 +54,6 @@ option UDF # UDF (DVD) file system option MSDOSFS # MS-DOS file system option FDESC # /dev/fd option FIFO # FIFOs; RECOMMENDED -#option KERNFS # /kern option PORTAL # dynamically created filesystem objects option PROCFS # /proc diff --git a/sys/conf/files b/sys/conf/files index 096d9ce6700..6ac07749c50 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,4 @@ -# $OpenBSD: files,v 1.354 2005/11/10 08:10:16 dlg Exp $ +# $OpenBSD: files,v 1.355 2005/11/24 12:08:16 pedro Exp $ # $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 @@ -663,8 +663,6 @@ file miscfs/deadfs/dead_vnops.c file miscfs/fdesc/fdesc_vfsops.c fdesc file miscfs/fdesc/fdesc_vnops.c fdesc file miscfs/fifofs/fifo_vnops.c fifo -file miscfs/kernfs/kernfs_vfsops.c kernfs -file miscfs/kernfs/kernfs_vnops.c kernfs file miscfs/portal/portal_vfsops.c portal file miscfs/portal/portal_vnops.c portal file miscfs/procfs/procfs_cmdline.c procfs diff --git a/sys/kern/Makefile b/sys/kern/Makefile index b6049283caa..ca0864a49f5 100644 --- a/sys/kern/Makefile +++ b/sys/kern/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2005/07/14 02:09:46 uwe Exp $ +# $OpenBSD: Makefile,v 1.14 2005/11/24 12:08:16 pedro Exp $ # Makefile for kernel tags files, init_sysent, etc. @@ -39,7 +39,7 @@ DGEN= adosfs \ isofs isofs/cd9660 \ kern \ lib libkern \ - miscfs miscfs/deadfs miscfs/fdesc miscfs/fifofs miscfs/kernfs \ + miscfs miscfs/deadfs miscfs/fdesc miscfs/fifofs \ miscfs/portal miscfs/procfs miscfs/specfs \ msdosfs \ net netinet \ diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 057617e8ec0..90b33ba92cf 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_conf.c,v 1.27 2005/05/27 00:58:24 pedro Exp $ */ +/* $OpenBSD: vfs_conf.c,v 1.28 2005/11/24 12:08:16 pedro Exp $ */ /* $NetBSD: vfs_conf.c,v 1.21.4.1 1995/11/01 00:06:26 jtc Exp $ */ /* @@ -108,10 +108,6 @@ extern const struct vfsops fdesc_vfsops; extern const struct vfsops portal_vfsops; #endif -#ifdef KERNFS -extern const struct vfsops kernfs_vfsops; -#endif - #ifdef PROCFS extern const struct vfsops procfs_vfsops; #endif @@ -203,11 +199,6 @@ static struct vfsconf vfsconflist[] = { { &fdesc_vfsops, MOUNT_FDESC, 7, 0, 0, NULL, NULL }, #endif - /* Kernel Information Filesystem */ -#ifdef KERNFS - { &kernfs_vfsops, MOUNT_KERNFS, 11, 0, 0, NULL, NULL }, -#endif - /* NTFS Filesystem */ #ifdef NTFS { &ntfs_vfsops, MOUNT_NTFS, 6, 0, MNT_LOCAL, NULL, NULL }, @@ -250,7 +241,6 @@ extern struct vnodeopv_desc spec_nfsv2nodeop_opv_desc; extern struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc; extern struct vnodeopv_desc fdesc_vnodeop_opv_desc; extern struct vnodeopv_desc portal_vnodeop_opv_desc; -extern struct vnodeopv_desc kernfs_vnodeop_opv_desc; extern struct vnodeopv_desc procfs_vnodeop_opv_desc; extern struct vnodeopv_desc cd9660_vnodeop_opv_desc; extern struct vnodeopv_desc cd9660_specop_opv_desc; @@ -301,9 +291,6 @@ struct vnodeopv_desc *vfs_opv_descs[] = { #ifdef PORTAL &portal_vnodeop_opv_desc, #endif -#ifdef KERNFS - &kernfs_vnodeop_opv_desc, -#endif #ifdef PROCFS &procfs_vnodeop_opv_desc, #endif diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a520ec759e2..4c32a075a16 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.119 2005/11/19 02:18:01 pedro Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.120 2005/11/24 12:08:16 pedro Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -492,7 +492,7 @@ bdevvp(dev_t dev, struct vnode **vpp) /* * Create a vnode for a character device. - * Used for kernfs and some console handling. + * Used for console handling. */ int cdevvp(dev_t dev, struct vnode **vpp) @@ -503,7 +503,7 @@ cdevvp(dev_t dev, struct vnode **vpp) /* * Create a vnode for a device. * Used by bdevvp (block device) for root file system etc., - * and by cdevvp (character device) for console and kernfs. + * and by cdevvp (character device) for console. */ int getdevvp(dev_t dev, struct vnode **vpp, enum vtype type) diff --git a/sys/miscfs/kernfs/kernfs.h b/sys/miscfs/kernfs/kernfs.h deleted file mode 100644 index 8feda932cdb..00000000000 --- a/sys/miscfs/kernfs/kernfs.h +++ /dev/null @@ -1,103 +0,0 @@ -/* $OpenBSD: kernfs.h,v 1.14 2003/09/23 16:51:13 millert Exp $ */ -/* $NetBSD: kernfs.h,v 1.10 1996/02/09 22:40:21 christos Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software donated to Berkeley by - * Jan-Simon Pendry. - * - * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)kernfs.h 8.5 (Berkeley) 6/15/94 - */ - -#define _PATH_KERNFS "/kern" /* Default mountpoint */ - -#ifdef _KERNEL - -struct kern_target { - u_char kt_type; - u_char kt_namlen; - char *kt_name; - void *kt_data; -#define KTT_NULL 1 -#define KTT_TIME 5 -#define KTT_INT 17 -#define KTT_STRING 31 -#define KTT_HOSTNAME 47 -#define KTT_AVENRUN 53 -#define KTT_DEVICE 71 -#define KTT_MSGBUF 89 -#define KTT_USERMEM 91 -#define KTT_DOMAIN 95 -#define KTT_PHYSMEM 99 -#ifdef IPSEC -#define KTT_IPSECSPI 107 -#endif - u_char kt_tag; - u_char kt_vtype; - mode_t kt_mode; -}; - -struct kernfs_node { - TAILQ_ENTRY(kernfs_node) list; - const struct kern_target *kf_kt; - struct vnode *kf_vnode; -#define kf_type kf_kt->kt_type -#define kf_namlen kf_kt->kt_namlen -#define kf_name kf_kt->kt_name -#define kf_data kf_kt->kt_data -#define kf_vtype kf_kt->kt_vtype -#define kf_mode kf_kt->kt_mode -#define kf_tag kf_kt->kt_tag -}; - -#define KERNTOV(kn) ((struct vnode *)(kn)->kf_vnode) -#define VTOKERN(vp) ((struct kernfs_node *)(vp)->v_data) - -#define kernfs_fhtovp ((int (*)(struct mount *, struct fid *, \ - struct vnode **))eopnotsupp) -#define kernfs_quotactl ((int (*)(struct mount *, int, uid_t, caddr_t, \ - struct proc *))eopnotsupp) -#define kernfs_sysctl ((int (*)(int *, u_int, void *, size_t *, void *, \ - size_t, struct proc *))eopnotsupp) -#define kernfs_vget ((int (*)(struct mount *, ino_t, struct vnode **)) \ - eopnotsupp) -#define kernfs_vptofh ((int (*)(struct vnode *, struct fid *))eopnotsupp) -#define kernfs_sync ((int (*)(struct mount *, int, struct ucred *, \ - struct proc *))nullop) -#define kernfs_checkexp ((int (*)(struct mount *, struct mbuf *, \ - int *, struct ucred **))eopnotsupp) - -int kernfs_init(struct vfsconf *); -int kernfs_poll(void *); -int kernfs_allocvp(const struct kern_target *, struct mount *, struct vnode **); -const struct kern_target *kernfs_findtarget(char *, int); -extern int (**kernfs_vnodeop_p)(void *); -extern const struct vfsops kernfs_vfsops; -extern dev_t rrootdev; -#endif /* _KERNEL */ diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c deleted file mode 100644 index 995d37e4d11..00000000000 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ /dev/null @@ -1,226 +0,0 @@ -/* $OpenBSD: kernfs_vfsops.c,v 1.25 2003/08/14 07:46:39 mickey Exp $ */ -/* $NetBSD: kernfs_vfsops.c,v 1.26 1996/04/22 01:42:27 christos Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software donated to Berkeley by - * Jan-Simon Pendry. - * - * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)kernfs_vfsops.c 8.5 (Berkeley) 6/15/94 - */ - -/* - * Kernel params Filesystem - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/conf.h> -#include <sys/types.h> -#include <sys/proc.h> -#include <sys/vnode.h> -#include <sys/mount.h> -#include <sys/namei.h> -#include <sys/malloc.h> - -#include <uvm/uvm_extern.h> /* for uvmexp */ - -#include <miscfs/specfs/specdev.h> -#include <miscfs/kernfs/kernfs.h> - -dev_t rrootdev = NODEV; - -void kernfs_get_rrootdev(void); -int kernfs_mount(struct mount *, const char *, void *, struct nameidata *, - struct proc *); -int kernfs_start(struct mount *, int, struct proc *); -int kernfs_unmount(struct mount *, int, struct proc *); -int kernfs_root(struct mount *, struct vnode **); -int kernfs_statfs(struct mount *, struct statfs *, struct proc *); - -void -kernfs_get_rrootdev() -{ - static int tried = 0; - int cmaj; - - if (tried) { - /* Already did it once. */ - return; - } - tried = 1; - - if (rootdev == NODEV) - return; - for (cmaj = 0; cmaj < nchrdev; cmaj++) { - rrootdev = makedev(cmaj, minor(rootdev)); - if (chrtoblk(rrootdev) == rootdev) - return; - } - rrootdev = NODEV; - printf("kernfs_get_rrootdev: no raw root device\n"); -} - -/* - * Mount the Kernel params filesystem - */ -int -kernfs_mount(mp, path, data, ndp, p) - struct mount *mp; - const char *path; - void *data; - struct nameidata *ndp; - struct proc *p; -{ - size_t size; - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_mount(mp = %p)\n", mp); -#endif - - /* - * Update is a no-op - */ - if (mp->mnt_flag & MNT_UPDATE) - return (EOPNOTSUPP); - - mp->mnt_flag |= MNT_LOCAL; - vfs_getnewfsid(mp); - - (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); - bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); - bzero(mp->mnt_stat.f_mntfromname, MNAMELEN); - bcopy("kernfs", mp->mnt_stat.f_mntfromname, sizeof("kernfs")); -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_mount: at %s\n", mp->mnt_stat.f_mntonname); -#endif - - kernfs_get_rrootdev(); - return (0); -} - -int -kernfs_start(mp, flags, p) - struct mount *mp; - int flags; - struct proc *p; -{ - return (0); -} - -int -kernfs_unmount(mp, mntflags, p) - struct mount *mp; - int mntflags; - struct proc *p; -{ - int error; - int flags = 0; - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_unmount(mp = %p)\n", mp); -#endif - - if (mntflags & MNT_FORCE) { - flags |= FORCECLOSE; - } - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_unmount: calling vflush\n"); -#endif - if ((error = vflush(mp, 0, flags)) != 0) - return (error); - - return (0); -} - -int -kernfs_root(mp, vpp) - struct mount *mp; - struct vnode **vpp; -{ - const struct kern_target *kt; - int error; - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_root(mp = %p)\n", mp); -#endif - kt = kernfs_findtarget(".", 1); - error = kernfs_allocvp(kt, mp, vpp); - if (error) - return (error); - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curproc); - - return (0); -} - -int -kernfs_statfs(mp, sbp, p) - struct mount *mp; - struct statfs *sbp; - struct proc *p; -{ - extern long numvnodes; /* XXX */ - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_statfs(mp = %p)\n", mp); -#endif - - sbp->f_flags = 0; - sbp->f_bsize = uvmexp.pagesize; - sbp->f_iosize = uvmexp.pagesize; - sbp->f_bfree = physmem - uvmexp.wired; - sbp->f_blocks = physmem; - sbp->f_bavail = 0; - sbp->f_files = desiredvnodes; - sbp->f_ffree = desiredvnodes - numvnodes; - if (sbp != &mp->mnt_stat) { - bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid)); - bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN); - bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN); - } - strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN); - return (0); -} - -const struct vfsops kernfs_vfsops = { - kernfs_mount, - kernfs_start, - kernfs_unmount, - kernfs_root, - kernfs_quotactl, - kernfs_statfs, - kernfs_sync, - kernfs_vget, - kernfs_fhtovp, - kernfs_vptofh, - kernfs_init, - kernfs_sysctl, - kernfs_checkexp -}; diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c deleted file mode 100644 index ae31af46dfc..00000000000 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ /dev/null @@ -1,971 +0,0 @@ -/* $OpenBSD: kernfs_vnops.c,v 1.43 2005/11/19 02:18:01 pedro Exp $ */ -/* $NetBSD: kernfs_vnops.c,v 1.43 1996/03/16 23:52:47 christos Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software donated to Berkeley by - * Jan-Simon Pendry. - * - * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)kernfs_vnops.c 8.9 (Berkeley) 6/15/94 - */ - -/* - * Kernel parameter filesystem (/kern) - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/types.h> -#include <sys/time.h> -#include <sys/proc.h> -#include <sys/vnode.h> -#include <sys/malloc.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <sys/mount.h> -#include <sys/namei.h> -#include <sys/buf.h> -#include <sys/dirent.h> -#include <sys/msgbuf.h> -#include <sys/poll.h> -#include <miscfs/kernfs/kernfs.h> - -#include <uvm/uvm_extern.h> - -#define KSTRING 256 /* Largest I/O available via this filesystem */ -#define UIO_MX 32 - -#define READ_MODE (S_IRUSR|S_IRGRP|S_IROTH) -#define WRITE_MODE (S_IWUSR|READ_MODE) -#define DIR_MODE (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) - -static int byteorder = BYTE_ORDER; -static int posix = _POSIX_VERSION; -static int osrev = OpenBSD; -extern int ncpus; -extern char machine[], cpu_model[]; - -#ifdef IPSEC -extern int ipsp_kern(int, char **, int); -#endif - -const struct kern_target kern_targets[] = { -/* NOTE: The name must be less than UIO_MX-16 chars in length */ -#define N(s) sizeof(s)-1, s - /* name data tag type ro/rw */ - { DT_DIR, N("."), 0, KTT_NULL, VDIR, DIR_MODE }, - { DT_DIR, N(".."), 0, KTT_NULL, VDIR, DIR_MODE }, - { DT_REG, N("boottime"), &boottime.tv_sec, KTT_INT, VREG, READ_MODE }, - { DT_REG, N("byteorder"), &byteorder, KTT_INT, VREG, READ_MODE }, - { DT_REG, N("copyright"), (void*)copyright,KTT_STRING, VREG, READ_MODE }, - { DT_REG, N("hostname"), 0, KTT_HOSTNAME, VREG, WRITE_MODE }, - { DT_REG, N("domainname"),0, KTT_DOMAIN, VREG, WRITE_MODE }, - { DT_REG, N("hz"), &hz, KTT_INT, VREG, READ_MODE }, - { DT_REG, N("loadavg"), 0, KTT_AVENRUN, VREG, READ_MODE }, - { DT_REG, N("machine"), machine, KTT_STRING, VREG, READ_MODE }, - { DT_REG, N("model"), cpu_model, KTT_STRING, VREG, READ_MODE }, - { DT_REG, N("msgbuf"), 0, KTT_MSGBUF, VREG, READ_MODE }, - { DT_REG, N("ncpu"), &ncpus, KTT_INT, VREG, READ_MODE }, - { DT_REG, N("ostype"), (void*)&ostype,KTT_STRING, VREG, READ_MODE }, - { DT_REG, N("osrelease"), (void*)&osrelease,KTT_STRING,VREG, READ_MODE }, - { DT_REG, N("osrev"), &osrev, KTT_INT, VREG, READ_MODE }, - { DT_REG, N("pagesize"), &uvmexp.pagesize, KTT_INT, VREG, READ_MODE }, - { DT_REG, N("physmem"), &physmem, KTT_PHYSMEM, VREG, READ_MODE }, - { DT_REG, N("posix"), &posix, KTT_INT, VREG, READ_MODE }, -#if 0 - { DT_DIR, N("root"), 0, KTT_NULL, VDIR, DIR_MODE }, -#endif - { DT_BLK, N("rootdev"), &rootdev, KTT_DEVICE, VBLK, READ_MODE }, - { DT_CHR, N("rrootdev"), &rrootdev, KTT_DEVICE, VCHR, READ_MODE }, - { DT_REG, N("time"), 0, KTT_TIME, VREG, READ_MODE }, - { DT_REG, N("usermem"), 0, KTT_USERMEM, VREG, READ_MODE }, - { DT_REG, N("version"), (void*)version,KTT_STRING, VREG, READ_MODE }, -#ifdef IPSEC - { DT_REG, N("ipsec"), 0, KTT_IPSECSPI, VREG, READ_MODE }, -#endif -#undef N -}; -static const int nkern_targets = sizeof(kern_targets) / sizeof(kern_targets[0]); - -int kernfs_badop(void *); - -int kernfs_lookup(void *); -#define kernfs_create eopnotsupp -#define kernfs_mknod eopnotsupp -int kernfs_open(void *); -#define kernfs_close nullop -int kernfs_access(void *); -int kernfs_getattr(void *); -int kernfs_setattr(void *); -int kernfs_read(void *); -int kernfs_write(void *); -#define kernfs_ioctl (int (*)(void *))enoioctl -#define kernfs_mmap eopnotsupp -#define kernfs_fsync nullop -#define kernfs_seek nullop -#define kernfs_remove eopnotsupp -int kernfs_link(void *); -#define kernfs_rename eopnotsupp -#define kernfs_revoke vop_generic_revoke -#define kernfs_mkdir eopnotsupp -#define kernfs_rmdir eopnotsupp -int kernfs_symlink(void *); -int kernfs_readdir(void *); -#define kernfs_readlink eopnotsupp -int kernfs_inactive(void *); -int kernfs_reclaim(void *); -#define kernfs_lock vop_generic_lock -#define kernfs_unlock vop_generic_unlock -#define kernfs_bmap kernfs_badop -#define kernfs_strategy kernfs_badop -int kernfs_print(void *); -#define kernfs_islocked vop_generic_islocked -int kernfs_pathconf(void *); -#define kernfs_advlock eopnotsupp -#define kernfs_blkatoff eopnotsupp -#define kernfs_valloc eopnotsupp -int kernfs_vfree(void *); -#define kernfs_truncate eopnotsupp -#define kernfs_update eopnotsupp -#define kernfs_bwrite eopnotsupp - -int kernfs_xread(const struct kern_target *, int, char **, int); -int kernfs_xwrite(const struct kern_target *, char *, int); -int kernfs_freevp(struct vnode *, struct proc *); - -int (**kernfs_vnodeop_p)(void *); -struct vnodeopv_entry_desc kernfs_vnodeop_entries[] = { - { &vop_default_desc, vn_default_error }, - { &vop_lookup_desc, kernfs_lookup }, /* lookup */ - { &vop_create_desc, kernfs_create }, /* create */ - { &vop_mknod_desc, kernfs_mknod }, /* mknod */ - { &vop_open_desc, kernfs_open }, /* open */ - { &vop_close_desc, kernfs_close }, /* close */ - { &vop_access_desc, kernfs_access }, /* access */ - { &vop_getattr_desc, kernfs_getattr }, /* getattr */ - { &vop_setattr_desc, kernfs_setattr }, /* setattr */ - { &vop_read_desc, kernfs_read }, /* read */ - { &vop_write_desc, kernfs_write }, /* write */ - { &vop_ioctl_desc, kernfs_ioctl }, /* ioctl */ - { &vop_poll_desc, kernfs_poll }, /* poll */ - { &vop_revoke_desc, kernfs_revoke }, /* revoke */ - { &vop_fsync_desc, kernfs_fsync }, /* fsync */ - { &vop_remove_desc, kernfs_remove }, /* remove */ - { &vop_link_desc, kernfs_link }, /* link */ - { &vop_rename_desc, kernfs_rename }, /* rename */ - { &vop_mkdir_desc, kernfs_mkdir }, /* mkdir */ - { &vop_rmdir_desc, kernfs_rmdir }, /* rmdir */ - { &vop_symlink_desc, kernfs_symlink }, /* symlink */ - { &vop_readdir_desc, kernfs_readdir }, /* readdir */ - { &vop_readlink_desc, kernfs_readlink },/* readlink */ - { &vop_abortop_desc, vop_generic_abortop }, /* abortop */ - { &vop_inactive_desc, kernfs_inactive },/* inactive */ - { &vop_reclaim_desc, kernfs_reclaim }, /* reclaim */ - { &vop_lock_desc, kernfs_lock }, /* lock */ - { &vop_unlock_desc, kernfs_unlock }, /* unlock */ - { &vop_bmap_desc, kernfs_bmap }, /* bmap */ - { &vop_strategy_desc, kernfs_strategy },/* strategy */ - { &vop_print_desc, kernfs_print }, /* print */ - { &vop_islocked_desc, kernfs_islocked },/* islocked */ - { &vop_pathconf_desc, kernfs_pathconf },/* pathconf */ - { &vop_advlock_desc, kernfs_advlock }, /* advlock */ - { &vop_bwrite_desc, kernfs_bwrite }, /* bwrite */ - { NULL, NULL } -}; -struct vnodeopv_desc kernfs_vnodeop_opv_desc = - { &kernfs_vnodeop_p, kernfs_vnodeop_entries }; - -TAILQ_HEAD(, kernfs_node) kfshead; -static struct lock kfscache_lock; - -int -kernfs_init(vfsp) - struct vfsconf *vfsp; -{ - lockinit(&kfscache_lock, PVFS, "kfs", 0, 0); - TAILQ_INIT(&kfshead); - return(0); -} - -int -kernfs_allocvp(kt, mp, vpp) - const struct kern_target *kt; - struct mount *mp; - struct vnode **vpp; -{ - struct proc *p = curproc; - struct kernfs_node *kf; - struct vnode *vp; - int error = 0; - -#ifdef KERNFS_DIAGNOSTIC - /* this should never happen */ - if (kt == NULL) - panic("kernfs_allocvp passed NULL kt, mp %p, vpp %p!", mp, vpp); - - printf("kernfs_allocvp: looking for %s\n", kt->kt_name); -#endif - if ((error = lockmgr(&kfscache_lock, LK_EXCLUSIVE, NULL)) != 0) - return(error); - -loop: - for (kf = TAILQ_FIRST(&kfshead); kf != NULL; kf = TAILQ_NEXT(kf, list)) { - vp = KERNTOV(kf); - if (vp->v_mount == mp && kt->kt_namlen == kf->kf_namlen && - bcmp(kf->kf_name, kt->kt_name, kt->kt_namlen) == 0) { -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_allocvp: hit %s\n", kt->kt_name); -#endif - if (vget(vp, 0, p)) - goto loop; - *vpp = vp; - goto out; - } - } - - MALLOC(kf, void *, sizeof(struct kernfs_node), M_TEMP, M_WAITOK); - error = getnewvnode(VT_KERNFS, mp, kernfs_vnodeop_p, vpp); - if (error) { - FREE(kf, M_TEMP); - goto out; - } - vp = *vpp; - kf->kf_kt = kt; - kf->kf_vnode = vp; - vp->v_type = kf->kf_vtype; - vp->v_data = kf; - if (kf->kf_namlen == 1 && bcmp(kf->kf_name, ".", 1) == 0) - vp->v_flag |= VROOT; - - TAILQ_INSERT_TAIL(&kfshead, kf, list); -out: - lockmgr(&kfscache_lock, LK_RELEASE, NULL); - -#ifdef KERNFS_DIAGNOSTIC - if (error) - printf("kernfs_allocvp: error %d\n", error); -#endif - return(error); -} - -int -kernfs_freevp(vp, p) - struct vnode *vp; - struct proc *p; -{ - struct kernfs_node *kf = VTOKERN(vp); - - TAILQ_REMOVE(&kfshead, kf, list); - FREE(vp->v_data, M_TEMP); - vp->v_data = 0; - return(0); -} - -const struct kern_target * -kernfs_findtarget(name, namlen) - char *name; - int namlen; -{ - const struct kern_target *kt = NULL; - int i; - - for (i = 0; i < nkern_targets; i++) { - if (kern_targets[i].kt_namlen == namlen && - bcmp(kern_targets[i].kt_name, name, namlen) == 0) { - kt = &kern_targets[i]; - break; - } - } - -#ifdef KERNFS_DIAGNOSTIC - if (i == nkern_targets || kt == NULL) - printf("kernfs_findtarget: no match for %s\n", name); -#endif - return(kt); -} - - -int -kernfs_xread(kt, off, bufp, len) - const struct kern_target *kt; - int off; - char **bufp; - int len; -{ - - switch (kt->kt_tag) { - case KTT_TIME: { - struct timeval tv; - - microtime(&tv); - snprintf(*bufp, len, "%ld %ld\n", tv.tv_sec, tv.tv_usec); - break; - } - - case KTT_INT: { - int *ip = kt->kt_data; - - snprintf(*bufp, len, "%d\n", *ip); - break; - } - - case KTT_STRING: { - char *cp = kt->kt_data; - size_t end = strlen(cp); - - if (end && cp[end - 1] != '\n') { - strlcpy(*bufp, cp, len - 1); - strlcat(*bufp, "\n", len); - } else - *bufp = cp; - - break; - } - - case KTT_MSGBUF: { - extern struct msgbuf *msgbufp; - long n; - - if (msgbufp == NULL || msgbufp->msg_magic != MSG_MAGIC) - return (ENXIO); - - /* - * Note that reads of /kern/msgbuf won't necessarily yield - * consistent results, if the message buffer is modified - * while the read is in progress. The worst that can happen - * is that incorrect data will be read. There's no way - * that this can crash the system unless the values in the - * message buffer header are corrupted, but that'll cause - * the system to die anyway. - */ - if (msgbufp->msg_bufl < msgbufp->msg_bufs) { - if (off >= msgbufp->msg_bufx) - return (0); - n = off; - len = msgbufp->msg_bufx - n; - } else { - if (off >= msgbufp->msg_bufs) - return (0); - n = msgbufp->msg_bufx + off; - if (n >= msgbufp->msg_bufs) - n -= msgbufp->msg_bufs; - len = min(msgbufp->msg_bufs - n, msgbufp->msg_bufs - off); - } - *bufp = msgbufp->msg_bufc + n; - return (len); - } - - case KTT_HOSTNAME: { - char *cp = hostname; - int xlen = hostnamelen; - - if (xlen >= (len-2)) - return (EINVAL); - - bcopy(cp, *bufp, xlen); - (*bufp)[xlen] = '\n'; - (*bufp)[xlen+1] = '\0'; - break; - } - - case KTT_DOMAIN: { - char *cp = domainname; - int xlen = domainnamelen; - - if (xlen >= (len-2)) - return (EINVAL); - - bcopy(cp, *bufp, xlen); - (*bufp)[xlen] = '\n'; - (*bufp)[xlen+1] = '\0'; - break; - } - - case KTT_AVENRUN: - averunnable.fscale = FSCALE; - snprintf(*bufp, len, "%d %d %d %ld\n", - averunnable.ldavg[0], averunnable.ldavg[1], - averunnable.ldavg[2], averunnable.fscale); - break; - - case KTT_USERMEM: - snprintf(*bufp, len, "%u\n", ctob(physmem - uvmexp.wired)); - break; - - case KTT_PHYSMEM: - snprintf(*bufp, len, "%u\n", ctob(physmem)); - break; - -#ifdef IPSEC - case KTT_IPSECSPI: - return(ipsp_kern(off, bufp, len)); -#endif - default: - return (0); - } - - len = strlen(*bufp); - if (len <= off) - return (0); - *bufp += off; - return (len - off); -} - -int -kernfs_xwrite(kt, buf, len) - const struct kern_target *kt; - char *buf; - int len; -{ - - switch (kt->kt_tag) { - case KTT_DOMAIN: - if (buf[len-1] == '\n') - --len; - bcopy(buf, domainname, len); - domainname[len] = '\0'; - domainnamelen = len; - return (0); - - case KTT_HOSTNAME: - if (buf[len-1] == '\n') - --len; - bcopy(buf, hostname, len); - hostname[len] = '\0'; - hostnamelen = len; - return (0); - - default: - return (EIO); - } -} - - -/* - * vp is the current namei directory - * ndp is the name to locate in that directory... - */ -int -kernfs_lookup(v) - void *v; -{ - struct vop_lookup_args /* { - struct vnode * a_dvp; - struct vnode ** a_vpp; - struct componentname * a_cnp; - } */ *ap = v; - struct componentname *cnp = ap->a_cnp; - struct vnode **vpp = ap->a_vpp; - struct vnode *dvp = ap->a_dvp; - char *pname = cnp->cn_nameptr; - struct proc *p = cnp->cn_proc; - const struct kern_target *kt; - struct vnode *vp; - int error, wantpunlock; - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_lookup(%p)\n", ap); - printf("kernfs_lookup(dp = %p, vpp = %p, cnp = %p)\n", dvp, vpp, ap->a_cnp); - printf("kernfs_lookup(%s)\n", pname); -#endif - - *vpp = NULLVP; - cnp->cn_flags &= ~PDIRUNLOCK; - - if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) - return (EROFS); - - if (cnp->cn_namelen == 1 && *pname == '.') { - *vpp = dvp; - VREF(dvp); - return (0); - } - - wantpunlock = (~cnp->cn_flags & (LOCKPARENT | ISLASTCN)); - - kt = kernfs_findtarget(pname, cnp->cn_namelen); - if (kt == NULL) { - /* not found */ - return(cnp->cn_nameiop == LOOKUP ? ENOENT : EROFS); - } - - if (kt->kt_tag == KTT_DEVICE) { - dev_t *dp = kt->kt_data; - - loop: - if (*dp == NODEV || !vfinddev(*dp, kt->kt_vtype, &vp)) - return(ENOENT); - - *vpp = vp; - if (vget(vp, LK_EXCLUSIVE, p)) - goto loop; - if (wantpunlock) { - VOP_UNLOCK(dvp, 0, p); - cnp->cn_flags |= PDIRUNLOCK; - } - return(0); - } - - - if ((error = kernfs_allocvp(kt, dvp->v_mount, vpp)) != 0) { - return(error); - } - - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, p); - - if (wantpunlock) { - VOP_UNLOCK(dvp, 0, p); - cnp->cn_flags |= PDIRUNLOCK; - } - return (0); -} - -/*ARGSUSED*/ -int -kernfs_open(v) - void *v; -{ - /* Only need to check access permissions. */ - return (0); -} - -int -kernfs_access(v) - void *v; -{ - struct vop_access_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap = v; - struct vnode *vp = ap->a_vp; - - mode_t fmode = (vp->v_flag & VROOT) ? DIR_MODE : VTOKERN(vp)->kf_mode; - - return (vaccess(fmode, (uid_t)0, (gid_t)0, ap->a_mode, ap->a_cred)); -} - -int -kernfs_getattr(v) - void *v; -{ - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap = v; - struct vnode *vp = ap->a_vp; - struct vattr *vap = ap->a_vap; - int error = 0; - char strbuf[KSTRING], *buf; - - - bzero(vap, sizeof(*vap)); - vattr_null(vap); - vap->va_uid = 0; - vap->va_gid = 0; - vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; - vap->va_size = 0; - vap->va_blocksize = DEV_BSIZE; - getnanotime(&vap->va_atime); - vap->va_mtime = vap->va_atime; - vap->va_ctime = vap->va_atime; - vap->va_gen = 0; - vap->va_flags = 0; - vap->va_rdev = 0; - vap->va_bytes = 0; - - if (vp->v_flag & VROOT) { -#ifdef KERNFS_DIAGNOSTIC - struct kern_target *kt = VTOKERN(vp)->kf_kt; - printf("kernfs_getattr: stat rootdir (%s)\n", kt->kt_name); -#endif - vap->va_type = VDIR; - vap->va_mode = DIR_MODE; - vap->va_nlink = 2; - vap->va_fileid = 2; - vap->va_size = DEV_BSIZE; - } else { - const struct kern_target *kt = VTOKERN(vp)->kf_kt; - int nbytes, total; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_getattr: stat target %s\n", kt->kt_name); -#endif - if (kt == &kern_targets[2]) { - /* set boottime times to boottime */ - TIMEVAL_TO_TIMESPEC(&boottime, &vap->va_atime); - vap->va_mtime = vap->va_atime; - vap->va_ctime = vap->va_atime; - } - vap->va_type = kt->kt_vtype; - vap->va_mode = kt->kt_mode; - vap->va_nlink = 1; - vap->va_fileid = 3 + (kt - kern_targets); - total = 0; - while (buf = strbuf, - nbytes = kernfs_xread(kt, total, &buf, sizeof(strbuf))) { - if (total <= INT_MAX - nbytes) - break; /* XXX - should use quad */ - total += nbytes; - } - vap->va_size = total; - } - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_getattr: return error %d\n", error); -#endif - return (error); -} - -/*ARGSUSED*/ -int -kernfs_setattr(v) - void *v; -{ - struct vop_setattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap = v; - - if (ap->a_vap->va_flags != VNOVAL) - return (EOPNOTSUPP); - - /* - * Silently ignore attribute changes. - * This allows for open with truncate to have no - * effect until some data is written. I want to - * do it this way because all writes are atomic. - */ - return (0); -} - -int -kernfs_read(v) - void *v; -{ - struct vop_read_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap = v; - struct vnode *vp = ap->a_vp; - struct uio *uio = ap->a_uio; - const struct kern_target *kt; - char strbuf[KSTRING], *buf; - int off, len; - int error; - - if (vp->v_type == VDIR) - return (EOPNOTSUPP); - - kt = VTOKERN(vp)->kf_kt; - -#ifdef KERNFS_DIAGNOSTIC - printf("kern_read %s\n", kt->kt_name); -#endif - - if (uio->uio_offset < 0) - return (EINVAL); - off = uio->uio_offset; -#if 0 - while (buf = strbuf, -#else - if (buf = strbuf, -#endif - len = kernfs_xread(kt, off, &buf, sizeof(strbuf))) { - if ((error = uiomove(buf, len, uio)) != 0) - return (error); - } - return (0); -} - -int -kernfs_write(v) - void *v; -{ - struct vop_write_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap = v; - struct vnode *vp = ap->a_vp; - struct uio *uio = ap->a_uio; - const struct kern_target *kt; - int error, xlen; - char strbuf[KSTRING]; - - if (vp->v_type == VDIR) - return (EOPNOTSUPP); - - kt = VTOKERN(vp)->kf_kt; - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_write %s\n", kt->kt_name); -#endif - - if (uio->uio_offset != 0) - return (EINVAL); - - xlen = min(uio->uio_resid, KSTRING-1); - if ((error = uiomove(strbuf, xlen, uio)) != 0) - return (error); - - if (uio->uio_resid != 0) - return (EIO); - - strbuf[xlen] = '\0'; - xlen = strlen(strbuf); - return (kernfs_xwrite(kt, strbuf, xlen)); -} - -int -kernfs_readdir(v) - void *v; -{ - struct vop_readdir_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - int *a_eofflag; - u_long *a_cookies; - int a_ncookies; - } */ *ap = v; - int error, i; - struct uio *uio = ap->a_uio; - struct dirent d; - const struct kern_target *kt; - - if (ap->a_vp->v_type != VDIR) - return (ENOTDIR); - - if (uio->uio_resid < UIO_MX) - return (EINVAL); - if (uio->uio_offset < 0) - return (EINVAL); - - error = 0; - i = uio->uio_offset; - bzero(&d, UIO_MX); - d.d_reclen = UIO_MX; - - for (kt = &kern_targets[i]; - uio->uio_resid >= UIO_MX && i < nkern_targets; kt++, i++) { -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_readdir: i = %d\n", i); -#endif - - if (kt->kt_tag == KTT_DEVICE) { - dev_t *dp = kt->kt_data; - struct vnode *fvp; - - if (*dp == NODEV || !vfinddev(*dp, kt->kt_vtype, &fvp)) - continue; - } - - d.d_fileno = i + 3; - d.d_namlen = kt->kt_namlen; - bcopy(kt->kt_name, d.d_name, kt->kt_namlen + 1); - d.d_type = kt->kt_type; - - if ((error = uiomove(&d, UIO_MX, uio)) != 0) - break; - } - - uio->uio_offset = i; - return (error); -} - -int -kernfs_inactive(v) - void *v; -{ - struct vop_inactive_args /* { - struct vnode *a_vp; - struct proc *a_p; - } */ *ap = v; - struct vnode *vp = ap->a_vp; -#ifdef KERNFS_DIAGNOSTIC - struct kernfs_node *kf; - - kf = VTOKERN(vp); - - printf("kernfs_inactive(%p) %s\n", vp, kf->kf_name); -#endif - VOP_UNLOCK(vp, 0, ap->a_p); - return (0); -} - -int -kernfs_reclaim(v) - void *v; -{ - struct vop_reclaim_args /* { - struct vnode *a_vp; - } */ *ap = v; - struct vnode *vp = ap->a_vp; - struct proc *p = curproc; -#ifdef KERNFS_DIAGNOSTIC - struct kernfs_node *kf; - - kf = VTOKERN(vp); - - printf("kernfs_reclaim(%p) %s\n", vp, kf->kf_name); -#endif - return(kernfs_freevp(vp, p)); -} - -/* - * Return POSIX pathconf information applicable to special devices. - */ -int -kernfs_pathconf(v) - void *v; -{ - struct vop_pathconf_args /* { - struct vnode *a_vp; - int a_name; - register_t *a_retval; - } */ *ap = v; - - switch (ap->a_name) { - case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; - return (0); - case _PC_MAX_CANON: - *ap->a_retval = MAX_CANON; - return (0); - case _PC_MAX_INPUT: - *ap->a_retval = MAX_INPUT; - return (0); - case _PC_PIPE_BUF: - *ap->a_retval = PIPE_BUF; - return (0); - case _PC_CHOWN_RESTRICTED: - *ap->a_retval = 1; - return (0); - case _PC_VDISABLE: - *ap->a_retval = _POSIX_VDISABLE; - return (0); - default: - return (EINVAL); - } - /* NOTREACHED */ -} - -/* - * Print out some details of a kernfs vnode. - */ -/* ARGSUSED */ -int -kernfs_print(v) - void *v; -{ - struct vop_print_args /* - struct vnode *a_vp; - } */ *ap = v; - struct kernfs_node *kf = VTOKERN(ap->a_vp); - - printf("tag VT_KERNFS, kernfs vnode: name %s, vp %p, tag %d\n", - kf->kf_name, kf->kf_vnode, kf->kf_tag); - - return (0); -} - -/*ARGSUSED*/ -int -kernfs_vfree(v) - void *v; -{ - return (0); -} - -int -kernfs_link(v) - void *v; -{ - struct vop_link_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap = v; - - VOP_ABORTOP(ap->a_dvp, ap->a_cnp); - vput(ap->a_dvp); - return (EROFS); -} - -int -kernfs_symlink(v) - void *v; -{ - struct vop_symlink_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - char *a_target; - } */ *ap = v; - - VOP_ABORTOP(ap->a_dvp, ap->a_cnp); - vput(ap->a_dvp); - return (EROFS); -} - -/* - * kernfs "should never get here" operation - */ -/*ARGSUSED*/ -int -kernfs_badop(v) - void *v; -{ - - panic("kernfs: bad op"); - return 0; -} - -int -kernfs_poll(v) - void *v; -{ - struct vop_poll_args /* { - struct vnode *a_vp; - int a_events; - struct proc *a_p; - } */ *ap = v; - - return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); -} diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 3bd169e6014..ac04c52ce6f 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.163 2005/05/28 15:10:07 ho Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.164 2005/11/24 12:08:16 pedro Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -92,7 +92,6 @@ extern int ipsec_ipcomp_default_level; extern int encdebug; int ipsec_in_use = 0; u_int64_t ipsec_last_added = 0; -u_int32_t kernfs_epoch = 0; struct ipsec_policy_head ipsec_policy_head = TAILQ_HEAD_INITIALIZER(ipsec_policy_head); @@ -781,7 +780,6 @@ tdb_alloc(void) /* Record establishment time. */ tdbp->tdb_established = time_second; - tdbp->tdb_epoch = kernfs_epoch - 1; /* Initialize timeouts. */ timeout_set(&tdbp->tdb_timer_tmo, tdb_timeout, tdbp); @@ -894,382 +892,6 @@ tdb_init(struct tdb *tdbp, u_int16_t alg, struct ipsecinit *ii) return EINVAL; } -#ifdef KERNFS -/* - * Print TDB information on a buffer. - */ -int -ipsp_print_tdb(struct tdb *tdb, char *buffer, size_t buflen) -{ - struct ctlname ipspflags[] = { - { "unique", TDBF_UNIQUE }, - { "invalid", TDBF_INVALID }, - { "halfiv", TDBF_HALFIV }, - { "pfs", TDBF_PFS }, - { "tunneling", TDBF_TUNNELING }, - { "noreplay", TDBF_NOREPLAY }, - { "random padding", TDBF_RANDOMPADDING }, - { "skipcrypto", TDBF_SKIPCRYPTO }, - { "usedtunnel", TDBF_USEDTUNNEL }, - { "udpencap", TDBF_UDPENCAP }, - }; - int l, i, k, n; - - if (buflen == 0) - return 0; - - n = snprintf(buffer, buflen, - "SPI = %08x, Destination = %s, Sproto = %u\n" - "\tEstablished %d seconds ago\n" - "\tSource = %s", - ntohl(tdb->tdb_spi), ipsp_address(tdb->tdb_dst), tdb->tdb_sproto, - time_second - tdb->tdb_established, - ipsp_address(tdb->tdb_src)); - if (n < 0 || n >= buflen) - return 0; - l = n; - - if (tdb->tdb_proxy.sa.sa_family) { - n = snprintf(buffer + l, buflen - l, - ", Proxy = %s", ipsp_address(tdb->tdb_proxy)); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - n = snprintf(buffer + l, buflen - l, "\n"); - if (n < 0 || n >= buflen - l) - return l; - l += n; - - if (tdb->tdb_mtu && tdb->tdb_mtutimeout > time_second) { - n = snprintf(buffer + l, buflen - l, - "\tMTU: %d, expires in %llu seconds\n", - tdb->tdb_mtu, tdb->tdb_mtutimeout - time_second); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - if (tdb->tdb_local_cred) { - n = snprintf(buffer + l, buflen - l, - "\tLocal credential type %d\n", - ((struct ipsec_ref *) tdb->tdb_local_cred)->ref_type); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - if (tdb->tdb_remote_cred) { - n = snprintf(buffer + l, buflen - l, - "\tRemote credential type %d\n", - ((struct ipsec_ref *) tdb->tdb_remote_cred)->ref_type); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - if (tdb->tdb_local_auth) { - n = snprintf(buffer + l, buflen - l, - "\tLocal auth type %d\n", - ((struct ipsec_ref *) tdb->tdb_local_auth)->ref_type); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - if (tdb->tdb_remote_auth) { - n = snprintf(buffer + l, buflen - l, - "\tRemote auth type %d\n", - ((struct ipsec_ref *) tdb->tdb_remote_auth)->ref_type); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - n = snprintf(buffer + l, buflen - l, - "\tFlags (%08x) = <", tdb->tdb_flags); - if (n < 0 || n >= buflen - l) - return l; - l += n; - - if ((tdb->tdb_flags & ~(TDBF_TIMER | TDBF_BYTES | TDBF_ALLOCATIONS | - TDBF_FIRSTUSE | TDBF_SOFT_TIMER | TDBF_SOFT_BYTES | - TDBF_SOFT_FIRSTUSE | TDBF_SOFT_ALLOCATIONS)) == 0) { - n = snprintf(buffer + l, buflen - l, "none>\n"); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } else { - for (k = 0, i = 0; - k < sizeof(ipspflags) / sizeof(struct ctlname); k++) { - if (tdb->tdb_flags & ipspflags[k].ctl_type) { - n = snprintf(buffer + l, buflen - l, - "%s,", ipspflags[k].ctl_name); - if (n < 0 || n >= buflen - l) - return l; - l += n; - i = 1; - } - } - - /* If we added flags, remove trailing comma. */ - if (i) - l--; - n = snprintf(buffer + l, buflen - l, ">\n"); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - n = snprintf(buffer + l, buflen - l, - "\tCrypto ID: %llu\n", tdb->tdb_cryptoid); - if (n < 0 || n >= buflen - l) - return l; - l += n; - - if (tdb->tdb_udpencap_port) { - n = snprintf(buffer + l, buflen - l, - "\tudpencap_port = <%u>\n", ntohs(tdb->tdb_udpencap_port)); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - if (tdb->tdb_xform) { - n = snprintf(buffer + l, buflen - l, - "\txform = <%s>\n", - tdb->tdb_xform->xf_name); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - if (tdb->tdb_encalgxform) { - n = snprintf(buffer + l, buflen - l, - "\t\tEncryption = <%s>\n", - tdb->tdb_encalgxform->name); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_authalgxform) { - n = snprintf(buffer + l, buflen - l, - "\t\tAuthentication = <%s>\n", - tdb->tdb_authalgxform->name); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_compalgxform) { - n = snprintf(buffer + l, buflen - l, - "\t\tCompression = <%s>\n", - tdb->tdb_compalgxform->name); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_onext) { - n = snprintf(buffer + l, buflen - l, - "\tNext SA: SPI = %08x, Destination = %s, Sproto = %u\n", - ntohl(tdb->tdb_onext->tdb_spi), - ipsp_address(tdb->tdb_onext->tdb_dst), - tdb->tdb_onext->tdb_sproto); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_inext) { - n = snprintf(buffer + l, buflen - l, - "\tPrevious SA: SPI = %08x, " - "Destination = %s, Sproto = %u\n", - ntohl(tdb->tdb_inext->tdb_spi), - ipsp_address(tdb->tdb_inext->tdb_dst), - tdb->tdb_inext->tdb_sproto); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - n = snprintf(buffer + l, buflen - l, - "\t%llu bytes processed by this SA\n", - tdb->tdb_cur_bytes); - if (n < 0 || n >= buflen - l) - return l; - l += n; - - if (tdb->tdb_last_used) { - n = snprintf(buffer + l, buflen - l, - "\tLast used %llu seconds ago\n", - time_second - tdb->tdb_last_used); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - if (tdb->tdb_last_marked) { - n = snprintf(buffer + l, buflen - l, - "\tLast marked/unmarked %llu seconds ago\n", - time_second - tdb->tdb_last_marked); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - - n = snprintf(buffer + l, buflen - l, - "\tExpirations:\n"); - if (n < 0 || n >= buflen - l) - return l; - l += n; - - if (tdb->tdb_flags & TDBF_TIMER) { - n = snprintf(buffer + l, buflen - l, - "\t\tHard expiration(1) in %llu seconds\n", - tdb->tdb_established + tdb->tdb_exp_timeout - time_second); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_flags & TDBF_SOFT_TIMER) { - n = snprintf(buffer + l, buflen - l, - "\t\tSoft expiration(1) in %llu seconds\n", - tdb->tdb_established + tdb->tdb_soft_timeout - - time_second); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_flags & TDBF_BYTES) { - n = snprintf(buffer + l, buflen - l, - "\t\tHard expiration after %llu bytes\n", - tdb->tdb_exp_bytes); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_flags & TDBF_SOFT_BYTES) { - n = snprintf(buffer + l, buflen - l, - "\t\tSoft expiration after %llu bytes\n", - tdb->tdb_soft_bytes); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_flags & TDBF_ALLOCATIONS) { - n = snprintf(buffer + l, buflen - l, - "\t\tHard expiration after %u flows\n", - tdb->tdb_exp_allocations); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_flags & TDBF_SOFT_ALLOCATIONS) { - n = snprintf(buffer + l, buflen - l, - "\t\tSoft expiration after %u flows\n", - tdb->tdb_soft_allocations); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - if (tdb->tdb_flags & TDBF_FIRSTUSE) { - if (tdb->tdb_first_use) { - n = snprintf(buffer + l, buflen - l, - "\t\tHard expiration(2) in %llu seconds\n", - (tdb->tdb_first_use + tdb->tdb_exp_first_use) - - time_second); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } else { - n = snprintf(buffer + l, buflen - l, - "\t\tHard expiration in %llu seconds " - "after first use\n", - tdb->tdb_exp_first_use); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - } - - if (tdb->tdb_flags & TDBF_SOFT_FIRSTUSE) { - if (tdb->tdb_first_use) { - n = snprintf(buffer + l, buflen - l, - "\t\tSoft expiration(2) in %llu seconds\n", - (tdb->tdb_first_use + tdb->tdb_soft_first_use) - - time_second); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } else { - n = snprintf(buffer + l, buflen - l, - "\t\tSoft expiration in %llu seconds " - "after first use\n", tdb->tdb_soft_first_use); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - } - - if (!(tdb->tdb_flags & - (TDBF_TIMER | TDBF_SOFT_TIMER | TDBF_BYTES | - TDBF_SOFT_ALLOCATIONS | TDBF_ALLOCATIONS | - TDBF_SOFT_BYTES | TDBF_FIRSTUSE | TDBF_SOFT_FIRSTUSE))) { - n = snprintf(buffer + l, buflen - l, "\t\t(none)\n"); - if (n < 0 || n >= buflen - l) - return l; - l += n; - } - n = snprintf(buffer + l, buflen - l, "\n"); - if (n < 0 || n >= buflen - l) - return l; - l += n; - - return l; -} - -/* - * Used by kernfs. - */ -int -ipsp_kern(int off, char **bufp, int len) -{ - static char buffer[IPSEC_KERNFS_BUFSIZE]; - struct tdb *tdb; - int i, s, l; - - if (bufp == NULL) - return 0; - - bzero(buffer, IPSEC_KERNFS_BUFSIZE); - *bufp = buffer; - - if (off == 0) { - kernfs_epoch++; - l = snprintf(buffer, sizeof buffer, - "Hashmask: %d, policy entries: %d\n", - tdb_hashmask, ipsec_in_use); - if (l < 0 || l >= sizeof buffer) - return 0; - return l; - } - - if (tdbh == NULL) - return 0; - - for (i = 0; i <= tdb_hashmask; i++) { - s = spltdb(); - for (tdb = tdbh[i]; tdb; tdb = tdb->tdb_hnext) { - if (tdb->tdb_epoch != kernfs_epoch) { - tdb->tdb_epoch = kernfs_epoch; - l = ipsp_print_tdb(tdb, buffer, sizeof buffer); - splx(s); - return l; - } - } - splx(s); - } - return 0; -} -#endif /* KERNFS */ - /* * Check which transformations are required. */ diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h index a68c8186ae0..9772a5bd9de 100644 --- a/sys/netinet/ip_ipsp.h +++ b/sys/netinet/ip_ipsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.h,v 1.130 2005/05/28 15:10:07 ho Exp $ */ +/* $OpenBSD: ip_ipsp.h,v 1.131 2005/11/24 12:08:16 pedro Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -353,7 +353,6 @@ struct tdb { /* tunnel descriptor block */ u_int32_t tdb_rpl; /* Replay counter */ u_int32_t tdb_bitmap; /* Used for replay sliding window */ - u_int32_t tdb_epoch; /* Used by the kernfs interface */ u_int8_t tdb_iv[4]; /* Used for HALF-IV ESP */ struct ipsec_ref *tdb_local_cred; @@ -414,7 +413,6 @@ struct ipsecinit { #define XFT_COMP 0x1000 #define IPSEC_ZEROES_SIZE 256 /* Larger than an IP6 extension hdr. */ -#define IPSEC_KERNFS_BUFSIZE 4096 #if BYTE_ORDER == LITTLE_ENDIAN static __inline u_int64_t diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 259d24f1f71..e28e1e6e180 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.h,v 1.63 2005/10/25 18:03:29 pedro Exp $ */ +/* $OpenBSD: mount.h,v 1.64 2005/11/24 12:08:16 pedro Exp $ */ /* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */ /* @@ -347,7 +347,6 @@ struct ostatfs { #define MOUNT_LFS "lfs" /* Log-based Filesystem */ #define MOUNT_FDESC "fdesc" /* File Descriptor Filesystem */ #define MOUNT_PORTAL "portal" /* Portal Filesystem */ -#define MOUNT_KERNFS "kernfs" /* Kernel Information Filesystem */ #define MOUNT_PROCFS "procfs" /* /proc Filesystem */ #define MOUNT_AFS "afs" /* Andrew Filesystem */ #define MOUNT_CD9660 "cd9660" /* ISO9660 (aka CDROM) Filesystem */ diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1 index 62fb27de04c..1ab854a24e9 100644 --- a/usr.bin/man/man.1 +++ b/usr.bin/man/man.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: man.1,v 1.23 2005/05/26 04:29:54 fgsch Exp $ +.\" $OpenBSD: man.1,v 1.24 2005/11/24 12:08:16 pedro Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -119,7 +119,6 @@ mount_cd9660 (8) \- mount an ISO-9660 filesystem mount_ext2fs (8) \- mount a ext2fs file system mount_fdesc (8) \- mount the file-descriptor file system mount_ffs, mount_ufs (8) \- mount a Berkeley Fast File System -mount_kernfs (8) \- mount the /kern file system mount_procfs (8) \- mount the process file system mount_xfs (8) \- mount the xfs filesystem mountd (8) \- service remote NFS mount requests diff --git a/usr.sbin/procmap/procmap.c b/usr.sbin/procmap/procmap.c index 249a8448330..57c40d1115e 100644 --- a/usr.sbin/procmap/procmap.c +++ b/usr.sbin/procmap/procmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procmap.c,v 1.20 2005/05/26 05:22:15 pedro Exp $ */ +/* $OpenBSD: procmap.c,v 1.21 2005/11/24 12:08:17 pedro Exp $ */ /* $NetBSD: pmap.c,v 1.1 2002/09/01 20:32:44 atatat Exp $ */ /* @@ -639,7 +639,6 @@ dump_vm_map_entry(kvm_t *kd, struct kbit *vmspace, case VT_LOFS: case VT_FDESC: case VT_PORTAL: - case VT_KERNFS: case VT_PROCFS: case VT_AFS: case VT_ADOSFS: |