summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-12-06 20:18:58 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-12-06 20:18:58 +0000
commit4e376184e91e776fb4cba753cd78b3a10bd3658f (patch)
treeac4b0703bd855d3efaf6d28000ef4e98c4977792
parent51007cbcbcf55ded13128f1a9ec227007f716a21 (diff)
Remove fdescfs
-rw-r--r--etc/MAKEDEV.common4
-rw-r--r--etc/daily4
-rw-r--r--etc/security4
-rw-r--r--regress/sys/Makefile4
-rw-r--r--sbin/Makefile3
-rw-r--r--sbin/mount/mount.83
-rw-r--r--sbin/mount_fdesc/Makefile11
-rw-r--r--sbin/mount_fdesc/mount_fdesc.8162
-rw-r--r--sbin/mount_fdesc/mount_fdesc.c111
-rw-r--r--share/man/man4/options.425
-rw-r--r--share/man/man5/fstab.55
-rw-r--r--sys/arch/hppa/conf/RAMDISK3
-rw-r--r--sys/arch/hppa64/conf/RAMDISK3
-rw-r--r--sys/arch/sparc/conf/RAMDISK3
-rw-r--r--sys/conf/GENERIC3
-rw-r--r--sys/conf/files4
-rw-r--r--sys/kern/Makefile4
-rw-r--r--sys/kern/vfs_conf.c15
-rw-r--r--sys/miscfs/fdesc/fdesc.h75
-rw-r--r--sys/miscfs/fdesc/fdesc_vfsops.c236
-rw-r--r--sys/miscfs/fdesc/fdesc_vnops.c981
-rw-r--r--sys/sys/mount.h3
-rw-r--r--usr.bin/man/man.13
-rw-r--r--usr.sbin/procmap/procmap.c3
24 files changed, 23 insertions, 1649 deletions
diff --git a/etc/MAKEDEV.common b/etc/MAKEDEV.common
index aa562624d2f..348d1d792d6 100644
--- a/etc/MAKEDEV.common
+++ b/etc/MAKEDEV.common
@@ -1,4 +1,4 @@
-vers(a, {-$OpenBSD: MAKEDEV.common,v 1.21 2005/10/06 06:43:19 otto Exp $-})dnl
+vers(a, {-$OpenBSD: MAKEDEV.common,v 1.22 2005/12/06 20:18:56 pedro Exp $-})dnl
divert(1)dnl
dnl
dnl Common device definitions.
@@ -466,7 +466,7 @@ _mkdev(music, music*, {-M music$U c major_music_c $U
__devitem(radio, radio*, FM tuner devices)dnl
_mkdev(radio, radio*, {-M radio$U c major_radio_c $U
MKlist[${#MKlist[*]}]=";[ -e radio ] || ln -s radio$U radio"-})dnl
-__devitem(fdesc, fd, fd/* nodes for fdescfs,mount_fdesc 8)dnl
+__devitem(fdesc, fd, fd/* nodes for the file descriptor pseudo-device)dnl
_mkdev(fdesc, fd, {-RMlist[${#RMlist[*]}]=";mkdir -p fd;rm -f" n=0
while [ $n -lt 64 ];do M fd/$n c major_fdesc_c $n;n=Add($n, 1);done
MKlist[${#MKlist[*]}]=";chmod 555 fd"-})dnl
diff --git a/etc/daily b/etc/daily
index cb650fca2ed..d5a832b8070 100644
--- a/etc/daily
+++ b/etc/daily
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: daily,v 1.52 2005/11/24 12:08:15 pedro Exp $
+# $OpenBSD: daily,v 1.53 2005/12/06 20:18:56 pedro Exp $
# From: @(#)daily 8.2 (Berkeley) 1/25/94
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
@@ -56,7 +56,7 @@ if [ -d /var/rwho -a ! -L /var/rwho ] ; then
find . ! -name . -mtime +7 -execdir rm -f -- {} \; ; }
fi
-#find / \( ! -fstype local -o -fstype rdonly -o -fstype fdesc \
+#find / \( ! -fstype local -o -fstype rdonly \
# -o -fstype procfs \) -a -prune -o \
# -name 'lost+found' -a -prune -o \
# -name '*.core' -a -print -o \
diff --git a/etc/security b/etc/security
index 8d4471b083c..f7a6ab083a4 100644
--- a/etc/security
+++ b/etc/security
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: security,v 1.73 2005/11/24 12:08:15 pedro Exp $
+# $OpenBSD: security,v 1.74 2005/12/06 20:18:56 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 \
+(find / \( ! -fstype local \
-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/regress/sys/Makefile b/regress/sys/Makefile
index 8cd4d4aa051..6ee123441a6 100644
--- a/regress/sys/Makefile
+++ b/regress/sys/Makefile
@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile,v 1.16 2005/02/24 06:58:36 otto Exp $
+# $OpenBSD: Makefile,v 1.17 2005/12/06 20:18:56 pedro Exp $
# $NetBSD: Makefile,v 1.4 1995/04/20 22:41:08 cgd Exp $
-SUBDIR+= copy crypto ddb fdescfs fifofs kern ptrace sys uvm dev
+SUBDIR+= copy crypto ddb fifofs kern ptrace sys uvm dev
.if exists(arch/${MACHINE})
SUBDIR+= arch/${MACHINE}
.endif
diff --git a/sbin/Makefile b/sbin/Makefile
index b032d093ca4..6182c29d64c 100644
--- a/sbin/Makefile
+++ b/sbin/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.75 2005/11/24 12:08:15 pedro Exp $
+# $OpenBSD: Makefile,v 1.76 2005/12/06 20:18:57 pedro Exp $
# Not ported: XNSrouted enpload scsiformat startslip
# Missing: icheck
@@ -13,7 +13,6 @@ SUBDIR= atactl badsect bioctl brconfig ccdconfig disklabel dmesg dhclient \
# support for various file systems
SUBDIR+= mount_ados
SUBDIR+= mount_cd9660
-SUBDIR+= mount_fdesc
SUBDIR+= mount_ffs newfs fsck_ffs fsdb dumpfs dump restore clri tunefs fsirand
# mount_mfs -> newfs
SUBDIR+= mount_msdos newfs_msdos fsck_msdos
diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8
index 48ecfa9df93..83c5a2d1468 100644
--- a/sbin/mount/mount.8
+++ b/sbin/mount/mount.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mount.8,v 1.53 2005/11/24 12:08:15 pedro Exp $
+.\" $OpenBSD: mount.8,v 1.54 2005/12/06 20:18:57 pedro Exp $
.\" $NetBSD: mount.8,v 1.11 1995/07/12 06:23:21 cgd Exp $
.\"
.\" Copyright (c) 1980, 1989, 1991, 1993
@@ -357,7 +357,6 @@ with option
.Xr mount_ados 8 ,
.Xr mount_cd9660 8 ,
.Xr mount_ext2fs 8 ,
-.Xr mount_fdesc 8 ,
.Xr mount_ffs 8 ,
.Xr mount_mfs 8 ,
.Xr mount_msdos 8 ,
diff --git a/sbin/mount_fdesc/Makefile b/sbin/mount_fdesc/Makefile
deleted file mode 100644
index 47d2f84c7a0..00000000000
--- a/sbin/mount_fdesc/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# $OpenBSD: Makefile,v 1.3 1997/09/21 11:37:11 deraadt Exp $
-
-PROG= mount_fdesc
-SRCS= mount_fdesc.c getmntopts.c
-MAN= mount_fdesc.8
-
-MOUNT= ${.CURDIR}/../mount
-CFLAGS+= -I${MOUNT}
-.PATH: ${MOUNT}
-
-.include <bsd.prog.mk>
diff --git a/sbin/mount_fdesc/mount_fdesc.8 b/sbin/mount_fdesc/mount_fdesc.8
deleted file mode 100644
index 2da897b5951..00000000000
--- a/sbin/mount_fdesc/mount_fdesc.8
+++ /dev/null
@@ -1,162 +0,0 @@
-.\" $OpenBSD: mount_fdesc.8,v 1.16 2003/06/02 20:06:15 millert Exp $
-.\" $NetBSD: mount_fdesc.8,v 1.6 1995/12/17 18:50:19 ghudson Exp $
-.\"
-.\" Copyright (c) 1992, 1993, 1994
-.\" 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.
-.\"
-.\" @(#)mount_fdesc.8 8.2 (Berkeley) 3/27/94
-.\"
-.Dd March 27, 1994
-.Dt MOUNT_FDESC 8
-.Os
-.Sh NAME
-.Nm mount_fdesc
-.Nd mount the file-descriptor file system
-.Sh SYNOPSIS
-.Nm mount_fdesc
-.Op Fl o Ar options
-.Ar fdesc
-.Ar mount_point
-.Sh DESCRIPTION
-The
-.Nm
-command attaches an instance of the per-process file descriptor
-namespace to the global filesystem namespace.
-The conventional mount point is
-.Pa /dev
-and the filesystem should be union mounted in order to augment,
-rather than replace, the existing entries in
-.Pa /dev .
-This command is invoked by
-.Xr mount 8
-when using the syntax
-.Bd -ragged -offset 4n
-.Nm mount Op options
--t fdesc
-.Ar fdesc Ar mount_point
-.Ed
-.Pp
-This command is normally executed by
-.Xr mount 8
-at boot time.
-.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
-The contents of the mount point are
-.Pa fd ,
-.Pa stderr ,
-.Pa stdin ,
-.Pa stdout
-and
-.Pa tty .
-.Pp
-.Pa fd
-is a directory whose contents
-appear as a list of numbered files
-which correspond to the open files of the process reading the
-directory.
-The files
-.Pa /dev/fd/0
-through
-.Pa /dev/fd/#
-refer to file descriptors which can be accessed through the file
-system.
-If the file descriptor is open and the mode the file is being opened
-with is a subset of the mode of the existing descriptor, the call:
-.Bd -literal -offset indent
-fd = open("/dev/fd/0", mode);
-.Ed
-.Pp
-and the call:
-.Bd -literal -offset indent
-fd = fcntl(0, F_DUPFD, 0);
-.Ed
-.Pp
-are equivalent.
-.Pp
-The files
-.Pa /dev/stdin ,
-.Pa /dev/stdout
-and
-.Pa /dev/stderr
-appear as symlinks to the relevant entry in the
-.Pa /dev/fd
-sub-directory.
-Opening them is equivalent to the following calls:
-.Bd -literal -offset indent
-fd = fcntl(STDIN_FILENO, F_DUPFD, 0);
-fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
-fd = fcntl(STDERR_FILENO, F_DUPFD, 0);
-.Ed
-.Pp
-Flags to the
-.Xr open 2
-call other than
-.Dv O_RDONLY ,
-.Dv O_WRONLY
-and
-.Dv O_RDWR
-are ignored.
-.Pp
-The
-.Pa /dev/tty
-entry is an indirect reference to the current process's controlling terminal.
-It appears as a named pipe (FIFO) but behaves in exactly the same way as
-the real controlling terminal device.
-.Sh FILES
-.Bl -tag -width /dev/stderr -compact
-.It Pa /dev/fd/#
-.It Pa /dev/stdin
-.It Pa /dev/stdout
-.It Pa /dev/stderr
-.It Pa /dev/tty
-.El
-.Sh SEE ALSO
-.Xr mount 2 ,
-.Xr tty 4 ,
-.Xr fstab 5 ,
-.Xr mount 8 ,
-.Xr umount 8
-.Sh HISTORY
-The
-.Nm
-utility first appeared in
-.Bx 4.4 .
-.Sh CAVEATS
-This filesystem may not be NFS-exported.
diff --git a/sbin/mount_fdesc/mount_fdesc.c b/sbin/mount_fdesc/mount_fdesc.c
deleted file mode 100644
index 7a102a9c801..00000000000
--- a/sbin/mount_fdesc/mount_fdesc.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* $OpenBSD: mount_fdesc.c,v 1.11 2005/04/08 20:09:36 jaredy Exp $ */
-/* $NetBSD: mount_fdesc.c,v 1.7 1996/04/13 01:31:15 jtc 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_fdesc.c 8.2 (Berkeley) 3/27/94";
-#else
-static char rcsid[] = "$OpenBSD: mount_fdesc.c,v 1.11 2005/04/08 20:09:36 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_FDESC, path, mntflags, NULL)) {
- if (errno == EOPNOTSUPP)
- errx(1, "%s: Filesystem not supported by kernel",
- argv[1]);
- else
- err(1, "%s", argv[1]);
- }
- exit(0);
-}
-
-void
-usage(void)
-{
- (void)fprintf(stderr,
- "usage: mount_fdesc [-o options] fdesc mount_point\n");
- exit(1);
-}
diff --git a/share/man/man4/options.4 b/share/man/man4/options.4
index b0271a330ec..453ea828a4c 100644
--- a/share/man/man4/options.4
+++ b/share/man/man4/options.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: options.4,v 1.172 2005/11/30 11:18:27 jmc Exp $
+.\" $OpenBSD: options.4,v 1.173 2005/12/06 20:18:57 pedro Exp $
.\" $NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $
.\"
.\" Copyright (c) 1998 Theo de Raadt
@@ -423,28 +423,6 @@ Experimental and read only.
See
.Xr mount_ntfs 8
for details.
-.It Cd option FDESC
-Includes code for a file system which can be mounted on
-.Pa /dev/fd .
-This filesystem permits access to the per-process file descriptor
-space via special files in the file system.
-See
-.Xr mount_fdesc 8
-for details.
-Note that this facility is redundant, and thus unneeded on most
-.Ox
-systems, since the
-.Xr fd 4
-pseudo-device driver already provides identical functionality.
-On most systems, instances of
-.Xr fd 4
-are mknoded under
-.Pa /dev/fd/
-and on
-.Pa /dev/stdin ,
-.Pa /dev/stdout ,
-and
-.Pa /dev/stderr .
.It Cd option PORTAL
Includes the (experimental) portal filesystem.
This permits interesting tricks like opening TCP sockets by opening files in
@@ -1096,7 +1074,6 @@ is zero, the hardware realtime clock device is not in Daylight Saving Time.
.Xr edquota 8 ,
.Xr init 8 ,
.Xr mount_cd9660 8 ,
-.Xr mount_fdesc 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 153771a544a..c02c8c06dde 100644
--- a/share/man/man5/fstab.5
+++ b/share/man/man5/fstab.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: fstab.5,v 1.33 2005/11/27 13:11:59 jmc Exp $
+.\" $OpenBSD: fstab.5,v 1.34 2005/12/06 20:18:57 pedro Exp $
.\" $NetBSD: fstab.5,v 1.5.2.1 1995/11/16 20:11:11 pk Exp $
.\"
.\" Copyright (c) 1980, 1989, 1991, 1993
@@ -99,9 +99,6 @@ An
filesystem.
.It cd9660
An ISO 9660 CD-ROM filesystem.
-.It fdesc
-An implementation of
-.Pa /dev/fd .
.It ffs
A local
.Ux
diff --git a/sys/arch/hppa/conf/RAMDISK b/sys/arch/hppa/conf/RAMDISK
index 57d8d305cac..045f63d05f7 100644
--- a/sys/arch/hppa/conf/RAMDISK
+++ b/sys/arch/hppa/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.53 2005/08/28 05:30:43 deraadt Exp $
+# $OpenBSD: RAMDISK,v 1.54 2005/12/06 20:18:57 pedro Exp $
#
# Diskless kernel config
#
@@ -14,7 +14,6 @@ option NFSCLIENT # Network File System client
option CD9660 # ISO 9660 + Rock Ridge file system
option UDF # UDF (DVD) file system
option MSDOSFS # MS-DOS file system
-option FDESC # /dev/fd
option FIFO # FIFOs; RECOMMENDED
option INET # IP + ICMP + TCP + UDP
option INET6 # IPv6 (needs INET)
diff --git a/sys/arch/hppa64/conf/RAMDISK b/sys/arch/hppa64/conf/RAMDISK
index 719b420abfa..45c47101b5c 100644
--- a/sys/arch/hppa64/conf/RAMDISK
+++ b/sys/arch/hppa64/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.3 2005/05/27 15:54:59 drahn Exp $
+# $OpenBSD: RAMDISK,v 1.4 2005/12/06 20:18:57 pedro Exp $
#
# Diskless kernel config
#
@@ -12,7 +12,6 @@ option DIAGNOSTIC # internal consistency checks
option FFS # UFS
option NFSCLIENT # Network File System client
option CD9660 # ISO 9660 + Rock Ridge file system
-option FDESC # /dev/fd
option FIFO # FIFOs; RECOMMENDED
option INET # IP + ICMP + TCP + UDP
option INET6 # IPv6 (needs INET)
diff --git a/sys/arch/sparc/conf/RAMDISK b/sys/arch/sparc/conf/RAMDISK
index 10667ced5b8..992e12cd78a 100644
--- a/sys/arch/sparc/conf/RAMDISK
+++ b/sys/arch/sparc/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.56 2005/07/08 12:36:36 miod Exp $
+# $OpenBSD: RAMDISK,v 1.57 2005/12/06 20:18:57 pedro Exp $
# $NetBSD: GENERIC,v 1.28.2.1 1996/07/02 23:55:22 jtc Exp $
# Machine architecture; required by config(8)
@@ -22,7 +22,6 @@ option DIAGNOSTIC # internal consistency checks
option FFS # UFS
#option NFSCLIENT # Network File System client
option CD9660 # ISO 9660 + Rock Ridge file system
-#option FDESC # /dev/fd
#option FIFO # FIFOs; RECOMMENDED
option INET # IP + ICMP + TCP + UDP
#option INET6 # IPv6 (needs INET)
diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC
index 89969dba868..b2a823a6191 100644
--- a/sys/conf/GENERIC
+++ b/sys/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.121 2005/11/24 12:08:16 pedro Exp $
+# $OpenBSD: GENERIC,v 1.122 2005/12/06 20:18:57 pedro Exp $
#
# Machine-independent option; used by all architectures for their
# GENERIC kernel
@@ -52,7 +52,6 @@ option NFSSERVER # Network File System server
option CD9660 # ISO 9660 + Rock Ridge file system
option UDF # UDF (DVD) file system
option MSDOSFS # MS-DOS file system
-option FDESC # /dev/fd
option FIFO # FIFOs; RECOMMENDED
option PORTAL # dynamically created filesystem objects
option PROCFS # /proc
diff --git a/sys/conf/files b/sys/conf/files
index 6ac07749c50..ee51fc26e5b 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.355 2005/11/24 12:08:16 pedro Exp $
+# $OpenBSD: files,v 1.356 2005/12/06 20:18:57 pedro Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -660,8 +660,6 @@ file kern/vfs_syscalls.c
file kern/vfs_vnops.c
file kern/vnode_if.c
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/portal/portal_vfsops.c portal
file miscfs/portal/portal_vnops.c portal
diff --git a/sys/kern/Makefile b/sys/kern/Makefile
index ca0864a49f5..1f20d88e6a0 100644
--- a/sys/kern/Makefile
+++ b/sys/kern/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.14 2005/11/24 12:08:16 pedro Exp $
+# $OpenBSD: Makefile,v 1.15 2005/12/06 20:18:57 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 miscfs/deadfs 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 90b33ba92cf..3dfd0bbb179 100644
--- a/sys/kern/vfs_conf.c
+++ b/sys/kern/vfs_conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_conf.c,v 1.28 2005/11/24 12:08:16 pedro Exp $ */
+/* $OpenBSD: vfs_conf.c,v 1.29 2005/12/06 20:18:57 pedro Exp $ */
/* $NetBSD: vfs_conf.c,v 1.21.4.1 1995/11/01 00:06:26 jtc Exp $ */
/*
@@ -100,10 +100,6 @@ extern const struct vfsops msdosfs_vfsops;
extern const struct vfsops nfs_vfsops;
#endif
-#ifdef FDESC
-extern const struct vfsops fdesc_vfsops;
-#endif
-
#ifdef PORTAL
extern const struct vfsops portal_vfsops;
#endif
@@ -194,11 +190,6 @@ static struct vfsconf vfsconflist[] = {
{ &portal_vfsops, MOUNT_PORTAL, 8, 0, 0, NULL, NULL },
#endif
- /* File Descriptor Filesystem */
-#ifdef FDESC
- { &fdesc_vfsops, MOUNT_FDESC, 7, 0, 0, NULL, NULL },
-#endif
-
/* NTFS Filesystem */
#ifdef NTFS
{ &ntfs_vfsops, MOUNT_NTFS, 6, 0, MNT_LOCAL, NULL, NULL },
@@ -239,7 +230,6 @@ extern struct vnodeopv_desc spec_vnodeop_opv_desc;
extern struct vnodeopv_desc nfsv2_vnodeop_opv_desc;
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 procfs_vnodeop_opv_desc;
extern struct vnodeopv_desc cd9660_vnodeop_opv_desc;
@@ -285,9 +275,6 @@ struct vnodeopv_desc *vfs_opv_descs[] = {
&fifo_nfsv2nodeop_opv_desc,
#endif
#endif
-#ifdef FDESC
- &fdesc_vnodeop_opv_desc,
-#endif
#ifdef PORTAL
&portal_vnodeop_opv_desc,
#endif
diff --git a/sys/miscfs/fdesc/fdesc.h b/sys/miscfs/fdesc/fdesc.h
deleted file mode 100644
index f3353be6ace..00000000000
--- a/sys/miscfs/fdesc/fdesc.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* $OpenBSD: fdesc.h,v 1.9 2003/08/14 07:46:39 mickey Exp $ */
-/* $NetBSD: fdesc.h,v 1.9 1996/02/09 22:40:03 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.
- *
- * @(#)fdesc.h 8.6 (Berkeley) 8/20/94
- *
- * #Id: fdesc.h,v 1.8 1993/04/06 15:28:33 jsp Exp #
- */
-
-#ifdef _KERNEL
-#define FD_ROOT 2
-#define FD_DEVFD 3
-#define FD_STDIN 4
-#define FD_STDOUT 5
-#define FD_STDERR 6
-#define FD_CTTY 7
-#define FD_DESC 8
-#define FD_MAX 12
-
-typedef enum {
- Froot,
- Fdevfd,
- Fdesc,
- Flink,
- Fctty
-} fdntype;
-
-struct fdescnode {
- LIST_ENTRY(fdescnode) fd_hash; /* Hash list */
- struct vnode *fd_vnode; /* Back ptr to vnode */
- fdntype fd_type; /* Type of this node */
- unsigned fd_fd; /* Fd to be dup'ed */
- char *fd_link; /* Link to fd/n */
- int fd_ix; /* filesystem index */
-};
-
-#define VTOFDESC(vp) ((struct fdescnode *)(vp)->v_data)
-
-extern dev_t devctty;
-extern int fdesc_init(struct vfsconf *);
-extern int fdesc_root(struct mount *, struct vnode **);
-extern int fdesc_allocvp(fdntype, int, struct mount *, struct vnode **);
-extern int (**fdesc_vnodeop_p)(void *);
-extern const struct vfsops fdesc_vfsops;
-#endif /* _KERNEL */
diff --git a/sys/miscfs/fdesc/fdesc_vfsops.c b/sys/miscfs/fdesc/fdesc_vfsops.c
deleted file mode 100644
index 75772a024b7..00000000000
--- a/sys/miscfs/fdesc/fdesc_vfsops.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* $OpenBSD: fdesc_vfsops.c,v 1.13 2003/08/14 07:46:39 mickey Exp $ */
-/* $NetBSD: fdesc_vfsops.c,v 1.21 1996/02/09 22:40:07 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.
- *
- * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94
- *
- * #Id: fdesc_vfsops.c,v 1.9 1993/04/06 15:28:33 jsp Exp #
- */
-
-/*
- * /dev/fd Filesystem
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/proc.h>
-#include <sys/resourcevar.h>
-#include <sys/filedesc.h>
-#include <sys/vnode.h>
-#include <sys/mount.h>
-#include <sys/namei.h>
-#include <sys/malloc.h>
-#include <miscfs/fdesc/fdesc.h>
-
-int fdesc_mount(struct mount *, const char *, void *,
- struct nameidata *, struct proc *);
-int fdesc_start(struct mount *, int, struct proc *);
-int fdesc_unmount(struct mount *, int, struct proc *);
-int fdesc_root(struct mount *, struct vnode **);
-int fdesc_quotactl(struct mount *, int, uid_t, caddr_t,
- struct proc *);
-int fdesc_statfs(struct mount *, struct statfs *, struct proc *);
-int fdesc_sync(struct mount *, int, struct ucred *, struct proc *);
-int fdesc_vget(struct mount *, ino_t, struct vnode **);
-int fdesc_fhtovp(struct mount *, struct fid *, struct vnode **);
-int fdesc_vptofh(struct vnode *, struct fid *);
-
-/*
- * Mount the per-process file descriptors (/dev/fd)
- */
-int
-fdesc_mount(mp, path, data, ndp, p)
- struct mount *mp;
- const char *path;
- void *data;
- struct nameidata *ndp;
- struct proc *p;
-{
- size_t size;
-
- /*
- * 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("fdesc", mp->mnt_stat.f_mntfromname, sizeof("fdesc"));
- return (0);
-}
-
-int
-fdesc_start(mp, flags, p)
- struct mount *mp;
- int flags;
- struct proc *p;
-{
- return (0);
-}
-
-int
-fdesc_unmount(mp, mntflags, p)
- struct mount *mp;
- int mntflags;
- struct proc *p;
-{
- int flags = 0;
- int error;
-
- if (mntflags & MNT_FORCE)
- flags |= FORCECLOSE;
-
- /*
- * Flush out our vnodes.
- */
- if ((error = vflush(mp, NULL, flags)) != 0)
- return (error);
-
- return (0);
-}
-
-int
-fdesc_root(mp, vpp)
- struct mount *mp;
- struct vnode **vpp;
-{
- struct vnode *vp;
- int error;
- /*
- * Return locked reference to root.
- */
- error = fdesc_allocvp(Froot, FD_ROOT, mp, &vp);
- if (error)
- return (error);
- vp->v_type = VDIR;
- vp->v_flag |= VROOT;
- *vpp = vp;
- return (0);
-}
-
-int
-fdesc_statfs(mp, sbp, p)
- struct mount *mp;
- struct statfs *sbp;
- struct proc *p;
-{
- struct filedesc *fdp;
- int lim;
- int i;
- int last;
- int freefd;
-
- /*
- * Compute number of free file descriptors.
- * [ Strange results will ensue if the open file
- * limit is ever reduced below the current number
- * of open files... ]
- */
- lim = p->p_rlimit[RLIMIT_NOFILE].rlim_cur;
- fdp = p->p_fd;
- last = min(fdp->fd_nfiles, lim);
- freefd = 0;
- for (i = fdp->fd_freefile; i < last; i++)
- if (fdp->fd_ofiles[i] == NULL)
- freefd++;
-
- /*
- * Adjust for the fact that the fdesc array may not
- * have been fully allocated yet.
- */
- if (fdp->fd_nfiles < lim)
- freefd += (lim - fdp->fd_nfiles);
-
- sbp->f_bsize = DEV_BSIZE;
- sbp->f_iosize = DEV_BSIZE;
- sbp->f_blocks = 2; /* 1K to keep df happy */
- sbp->f_bfree = 0;
- sbp->f_bavail = 0;
- sbp->f_files = lim + 1; /* Allow for "." */
- sbp->f_ffree = freefd; /* See comments above */
- 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);
-}
-
-/*ARGSUSED*/
-int
-fdesc_sync(mp, waitfor, uc, p)
- struct mount *mp;
- int waitfor;
- struct ucred *uc;
- struct proc *p;
-{
-
- return (0);
-}
-
-#define fdesc_fhtovp ((int (*)(struct mount *, struct fid *, \
- struct vnode **))eopnotsupp)
-#define fdesc_quotactl ((int (*)(struct mount *, int, uid_t, caddr_t, \
- struct proc *))eopnotsupp)
-#define fdesc_sysctl ((int (*)(int *, u_int, void *, size_t *, void *, \
- size_t, struct proc *))eopnotsupp)
-#define fdesc_vget ((int (*)(struct mount *, ino_t, struct vnode **)) \
- eopnotsupp)
-#define fdesc_vptofh ((int (*)(struct vnode *, struct fid *))eopnotsupp)
-
-#define fdesc_checkexp ((int (*)(struct mount *, struct mbuf *, \
- int *, struct ucred **))eopnotsupp)
-
-const struct vfsops fdesc_vfsops = {
- fdesc_mount,
- fdesc_start,
- fdesc_unmount,
- fdesc_root,
- fdesc_quotactl,
- fdesc_statfs,
- fdesc_sync,
- fdesc_vget,
- fdesc_fhtovp,
- fdesc_vptofh,
- fdesc_init,
- fdesc_sysctl,
- fdesc_checkexp
-};
diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c
deleted file mode 100644
index 09895f70ba2..00000000000
--- a/sys/miscfs/fdesc/fdesc_vnops.c
+++ /dev/null
@@ -1,981 +0,0 @@
-/* $OpenBSD: fdesc_vnops.c,v 1.38 2005/11/19 02:18:01 pedro Exp $ */
-/* $NetBSD: fdesc_vnops.c,v 1.32 1996/04/11 11:24:29 mrg 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.
- *
- * @(#)fdesc_vnops.c 8.12 (Berkeley) 8/20/94
- *
- * #Id: fdesc_vnops.c,v 1.12 1993/04/06 16:17:17 jsp Exp #
- */
-
-/*
- * /dev/fd Filesystem
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/kernel.h> /* boottime */
-#include <sys/resourcevar.h>
-#include <sys/socketvar.h>
-#include <sys/filedesc.h>
-#include <sys/vnode.h>
-#include <sys/malloc.h>
-#include <sys/conf.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/tty.h>
-#include <sys/poll.h>
-
-#include <miscfs/fdesc/fdesc.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <sys/pipe.h>
-
-#define cttyvp(p) ((p)->p_flag & P_CONTROLT ? (p)->p_session->s_ttyvp : NULL)
-
-static struct lock fdcache_lock;
-
-dev_t devctty;
-
-#if (FD_STDIN != FD_STDOUT-1) || (FD_STDOUT != FD_STDERR-1)
-FD_STDIN, FD_STDOUT, FD_STDERR must be a sequence n, n+1, n+2
-#endif
-
-#define NFDCACHE 4
-
-#define FD_NHASH(ix) \
- (&fdhashtbl[(ix) & fdhash])
-LIST_HEAD(fdhashhead, fdescnode) *fdhashtbl;
-static u_long fdhash;
-
-int fdesc_badop(void *);
-
-int fdesc_lookup(void *);
-#define fdesc_create eopnotsupp
-#define fdesc_mknod eopnotsupp
-int fdesc_open(void *);
-#define fdesc_close nullop
-#define fdesc_access nullop
-int fdesc_getattr(void *);
-int fdesc_setattr(void *);
-int fdesc_read(void *);
-int fdesc_write(void *);
-int fdesc_ioctl(void *);
-int fdesc_poll(void *);
-#define fdesc_fsync nullop
-#define fdesc_remove eopnotsupp
-#define fdesc_revoke vop_generic_revoke
-int fdesc_link(void *);
-#define fdesc_rename eopnotsupp
-#define fdesc_mkdir eopnotsupp
-#define fdesc_rmdir eopnotsupp
-int fdesc_symlink(void *);
-int fdesc_readdir(void *);
-int fdesc_readlink(void *);
-int fdesc_inactive(void *);
-int fdesc_reclaim(void *);
-#define fdesc_lock vop_generic_lock
-#define fdesc_unlock vop_generic_unlock
-#define fdesc_bmap fdesc_badop
-#define fdesc_strategy fdesc_badop
-int fdesc_print(void *);
-int fdesc_pathconf(void *);
-#define fdesc_islocked vop_generic_islocked
-#define fdesc_advlock eopnotsupp
-#define fdesc_bwrite eopnotsupp
-
-int (**fdesc_vnodeop_p)(void *);
-struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = {
- { &vop_default_desc, vn_default_error },
- { &vop_lookup_desc, fdesc_lookup }, /* lookup */
- { &vop_create_desc, fdesc_create }, /* create */
- { &vop_mknod_desc, fdesc_mknod }, /* mknod */
- { &vop_open_desc, fdesc_open }, /* open */
- { &vop_close_desc, fdesc_close }, /* close */
- { &vop_access_desc, fdesc_access }, /* access */
- { &vop_getattr_desc, fdesc_getattr }, /* getattr */
- { &vop_setattr_desc, fdesc_setattr }, /* setattr */
- { &vop_read_desc, fdesc_read }, /* read */
- { &vop_write_desc, fdesc_write }, /* write */
- { &vop_ioctl_desc, fdesc_ioctl }, /* ioctl */
- { &vop_revoke_desc, fdesc_revoke }, /* revoke */
- { &vop_poll_desc, fdesc_poll }, /* poll */
- { &vop_fsync_desc, fdesc_fsync }, /* fsync */
- { &vop_remove_desc, fdesc_remove }, /* remove */
- { &vop_link_desc, fdesc_link }, /* link */
- { &vop_rename_desc, fdesc_rename }, /* rename */
- { &vop_mkdir_desc, fdesc_mkdir }, /* mkdir */
- { &vop_rmdir_desc, fdesc_rmdir }, /* rmdir */
- { &vop_symlink_desc, fdesc_symlink }, /* symlink */
- { &vop_readdir_desc, fdesc_readdir }, /* readdir */
- { &vop_readlink_desc, fdesc_readlink }, /* readlink */
- { &vop_abortop_desc, vop_generic_abortop }, /* abortop */
- { &vop_inactive_desc, fdesc_inactive }, /* inactive */
- { &vop_reclaim_desc, fdesc_reclaim }, /* reclaim */
- { &vop_lock_desc, fdesc_lock }, /* lock */
- { &vop_unlock_desc, fdesc_unlock }, /* unlock */
- { &vop_bmap_desc, fdesc_bmap }, /* bmap */
- { &vop_strategy_desc, fdesc_strategy }, /* strategy */
- { &vop_print_desc, fdesc_print }, /* print */
- { &vop_islocked_desc, fdesc_islocked }, /* islocked */
- { &vop_pathconf_desc, fdesc_pathconf }, /* pathconf */
- { &vop_advlock_desc, fdesc_advlock }, /* advlock */
- { &vop_bwrite_desc, fdesc_bwrite }, /* bwrite */
- { (struct vnodeop_desc*)NULL, (int(*)(void *))NULL }
-};
-
-struct vnodeopv_desc fdesc_vnodeop_opv_desc =
- { &fdesc_vnodeop_p, fdesc_vnodeop_entries };
-
-/*
- * Initialise cache headers
- */
-int
-fdesc_init(vfsp)
- struct vfsconf *vfsp;
-{
- int cttymajor;
-
- /* locate the major number */
- for (cttymajor = 0; cttymajor < nchrdev; cttymajor++)
- if (cdevsw[cttymajor].d_open == cttyopen)
- break;
- devctty = makedev(cttymajor, 0);
- fdhashtbl = hashinit(NFDCACHE, M_CACHE, M_WAITOK, &fdhash);
- lockinit(&fdcache_lock, PVFS, "fdfs", 0, 0);
- return (0);
-}
-
-int
-fdesc_allocvp(ftype, ix, mp, vpp)
- fdntype ftype;
- int ix;
- struct mount *mp;
- struct vnode **vpp;
-{
- struct proc *p = curproc;
- struct fdhashhead *fc;
- struct fdescnode *fd;
- int error = 0;
-
- if ((error = lockmgr(&fdcache_lock, LK_EXCLUSIVE, NULL)) != 0)
- return error;
-
- fc = FD_NHASH(ix);
-loop:
- LIST_FOREACH(fd, fc, fd_hash) {
- if (fd->fd_ix == ix && fd->fd_vnode->v_mount == mp) {
- if (vget(fd->fd_vnode, 0, p))
- goto loop;
- *vpp = fd->fd_vnode;
- goto out;
- }
- }
-
- error = getnewvnode(VT_FDESC, mp, fdesc_vnodeop_p, vpp);
- if (error)
- goto out;
- MALLOC(fd, void *, sizeof(struct fdescnode), M_TEMP, M_WAITOK);
- (*vpp)->v_data = fd;
- fd->fd_vnode = *vpp;
- fd->fd_type = ftype;
- fd->fd_fd = -1;
- fd->fd_link = 0;
- fd->fd_ix = ix;
- LIST_INSERT_HEAD(fc, fd, fd_hash);
-
-out:
- lockmgr(&fdcache_lock, LK_RELEASE, NULL);
-
- return (error);
-}
-
-/*
- * vp is the current namei directory
- * ndp is the name to locate in that directory...
- */
-int
-fdesc_lookup(v)
- void *v;
-{
- struct vop_lookup_args /* {
- struct vnode * a_dvp;
- struct vnode ** a_vpp;
- struct componentname * a_cnp;
- } */ *ap = v;
- struct vnode **vpp = ap->a_vpp;
- struct vnode *dvp = ap->a_dvp;
- struct componentname *cnp = ap->a_cnp;
- char *pname = cnp->cn_nameptr;
- struct proc *p = cnp->cn_proc;
- int nfiles = p->p_fd->fd_nfiles;
- unsigned fd = 0;
- int error;
- struct vnode *fvp;
- char *ln;
-
- if (cnp->cn_namelen == 1 && *pname == '.') {
- *vpp = dvp;
- VREF(dvp);
- return (0);
- }
-
- switch (VTOFDESC(dvp)->fd_type) {
- default:
- case Flink:
- case Fdesc:
- case Fctty:
- error = ENOTDIR;
- goto bad;
-
- case Froot:
- if (cnp->cn_namelen == 2 && bcmp(pname, "fd", 2) == 0) {
- error = fdesc_allocvp(Fdevfd, FD_DEVFD, dvp->v_mount, &fvp);
- if (error)
- goto bad;
- *vpp = fvp;
- fvp->v_type = VDIR;
- goto good;
- }
-
- if (cnp->cn_namelen == 3 && bcmp(pname, "tty", 3) == 0) {
- struct vnode *ttyvp = cttyvp(p);
- if (ttyvp == NULL) {
- error = ENXIO;
- goto bad;
- }
- error = fdesc_allocvp(Fctty, FD_CTTY, dvp->v_mount, &fvp);
- if (error)
- goto bad;
- *vpp = fvp;
- fvp->v_type = VCHR;
- goto good;
- }
-
- ln = 0;
- switch (cnp->cn_namelen) {
- case 5:
- if (bcmp(pname, "stdin", 5) == 0) {
- ln = "fd/0";
- fd = FD_STDIN;
- }
- break;
- case 6:
- if (bcmp(pname, "stdout", 6) == 0) {
- ln = "fd/1";
- fd = FD_STDOUT;
- } else
- if (bcmp(pname, "stderr", 6) == 0) {
- ln = "fd/2";
- fd = FD_STDERR;
- }
- break;
- }
-
- if (ln) {
- error = fdesc_allocvp(Flink, fd, dvp->v_mount, &fvp);
- if (error)
- goto bad;
- VTOFDESC(fvp)->fd_link = ln;
- *vpp = fvp;
- fvp->v_type = VLNK;
- goto good;
- } else {
- error = ENOENT;
- goto bad;
- }
-
- /* FALL THROUGH */
-
- case Fdevfd:
- if (cnp->cn_namelen == 2 && bcmp(pname, "..", 2) == 0) {
- VOP_UNLOCK(dvp, 0, p);
- cnp->cn_flags |= PDIRUNLOCK;
- error = fdesc_root(dvp->v_mount, vpp);
- if (error)
- goto bad;
- /* If we're at the last component and need the
- * parent locked, undo the unlock above.
- */
- if (((~cnp->cn_flags & (ISLASTCN | LOCKPARENT)) == 0) &&
- ((error = vn_lock(dvp, LK_EXCLUSIVE, p)) == 0))
- cnp->cn_flags &= ~PDIRUNLOCK;
- return (error);
- }
-
- fd = 0;
- while (*pname >= '0' && *pname <= '9') {
- fd = 10 * fd + *pname++ - '0';
- if (fd >= nfiles)
- break;
- }
-
- if (*pname != '\0') {
- error = ENOENT;
- goto bad;
- }
-
- if (fd_getfile(p->p_fd, fd) == NULL) {
- error = EBADF;
- goto bad;
- }
-
- error = fdesc_allocvp(Fdesc, FD_DESC+fd, dvp->v_mount, &fvp);
- if (error)
- goto bad;
- VTOFDESC(fvp)->fd_fd = fd;
- *vpp = fvp;
- goto good;
- }
-
-bad:
- *vpp = NULL;
- return (error);
-
-good:
- /*
- * As "." was special cased above, we now unlock the parent if we're
- * supposed to. We're only supposed to not unlock if this is the
- * last component, and the caller requested LOCKPARENT. So if either
- * condition is false, unlock.
- */
- if (((~cnp->cn_flags) & (ISLASTCN | LOCKPARENT)) != 0) {
- VOP_UNLOCK(dvp, 0, p);
- cnp->cn_flags |= PDIRUNLOCK;
- }
- return (0);
-}
-
-int
-fdesc_open(v)
- void *v;
-{
- struct vop_open_args /* {
- struct vnode *a_vp;
- int a_mode;
- struct ucred *a_cred;
- struct proc *a_p;
- } */ *ap = v;
- struct vnode *vp = ap->a_vp;
-
- switch (VTOFDESC(vp)->fd_type) {
- case Fdesc:
- /*
- * XXX Kludge: set p->p_dupfd to contain the value of the
- * the file descriptor being sought for duplication. The error
- * return ensures that the vnode for this device will be
- * released by vn_open. Open will detect this special error and
- * take the actions in dupfdopen. Other callers of vn_open or
- * VOP_OPEN will simply report the error.
- */
- ap->a_p->p_dupfd = VTOFDESC(vp)->fd_fd; /* XXX */
- return (ENODEV);
-
- case Fctty:
- return (cttyopen(devctty, ap->a_mode, 0, ap->a_p));
- case Froot:
- case Fdevfd:
- case Flink:
- break;
- }
-
- return (0);
-}
-
-int
-fdesc_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;
- unsigned int fd;
- struct stat stb;
- struct filedesc *fdp;
- struct file *fp;
- int error = 0;
-
- switch (VTOFDESC(vp)->fd_type) {
- case Froot:
- case Fdevfd:
- case Flink:
- case Fctty:
- bzero(vap, sizeof(*vap));
- vattr_null(vap);
- vap->va_fileid = VTOFDESC(vp)->fd_ix;
-
-#define R_ALL (S_IRUSR|S_IRGRP|S_IROTH)
-#define W_ALL (S_IWUSR|S_IWGRP|S_IWOTH)
-#define X_ALL (S_IXUSR|S_IXGRP|S_IXOTH)
-
- switch (VTOFDESC(vp)->fd_type) {
- case Flink:
- vap->va_mode = R_ALL|X_ALL;
- vap->va_type = VLNK;
- vap->va_rdev = 0;
- vap->va_nlink = 1;
- vap->va_size = strlen(VTOFDESC(vp)->fd_link);
- break;
-
- case Fctty:
- vap->va_mode = R_ALL|W_ALL;
- vap->va_type = VCHR;
- vap->va_rdev = devctty;
- vap->va_nlink = 1;
- vap->va_size = 0;
- break;
-
- default:
- vap->va_mode = R_ALL|X_ALL;
- vap->va_type = VDIR;
- vap->va_rdev = 0;
- vap->va_nlink = 2;
- vap->va_size = DEV_BSIZE;
- break;
- }
- vap->va_uid = 0;
- vap->va_gid = 0;
- vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
- vap->va_blocksize = DEV_BSIZE;
- vap->va_atime.tv_sec = boottime.tv_sec;
- vap->va_atime.tv_nsec = 0;
- vap->va_mtime = vap->va_atime;
- vap->va_ctime = vap->va_mtime;
- vap->va_gen = 0;
- vap->va_flags = 0;
- vap->va_bytes = 0;
- break;
-
- case Fdesc:
- fd = VTOFDESC(vp)->fd_fd;
- fdp = ap->a_p->p_fd;
- if ((fp = fd_getfile(fdp, fd)) == NULL)
- return (EBADF);
- memset(&stb, 0, sizeof(stb));
- FREF(fp);
- error = (*fp->f_ops->fo_stat)(fp, &stb, ap->a_p);
- FRELE(fp);
- if (error != 0)
- break;
- vattr_null(vap);
- vap->va_type = IFTOVT(stb.st_mode);
- vap->va_mode = stb.st_mode;
- /*
- * directories can cause loops in the namespace,
- * so turn off the 'x' bits to avoid trouble.
- */
- if (vap->va_type == VDIR)
- vap->va_mode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
- vap->va_nlink = stb.st_nlink;
- vap->va_uid = stb.st_uid;
- vap->va_gid = stb.st_gid;
- vap->va_fsid = stb.st_dev;
- vap->va_fileid = stb.st_ino;
- vap->va_size = stb.st_size;
- vap->va_blocksize = stb.st_blksize;
- vap->va_atime = stb.st_atimespec;
- vap->va_mtime = stb.st_mtimespec;
- vap->va_ctime = stb.st_ctimespec;
- vap->va_gen = stb.st_gen;
- vap->va_flags = stb.st_flags;
- vap->va_rdev = stb.st_rdev;
- vap->va_bytes = stb.st_blocks * stb.st_blksize;
- break;
-
- default:
- panic("fdesc_getattr");
- break;
- }
-
- if (error == 0)
- vp->v_type = vap->va_type;
-
- return (error);
-}
-
-int
-fdesc_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;
- struct vattr *vap = ap->a_vap;
- struct proc *p = ap->a_p;
- struct vnode *vp;
- struct file *fp;
- int error;
-
- /*
- * Can't mess with the root vnode
- */
- switch (VTOFDESC(ap->a_vp)->fd_type) {
- case Fdesc:
- break;
-
- case Fctty:
- if (vap->va_flags != VNOVAL)
- return (EOPNOTSUPP);
- return (0);
-
- default:
- return (EACCES);
- }
-
- if ((error = getvnode(p->p_fd, VTOFDESC(ap->a_vp)->fd_fd, &fp)) != 0) {
- /*
- * getvnode returns EINVAL if the file is not a vnode.
- * We siltently drop all changes except chflags when that
- * happens.
- */
- if (error == EINVAL) {
- if (vap->va_flags == VNOVAL)
- error = 0;
- else
- error = EOPNOTSUPP;
- }
- return (error);
- }
- vp = (struct vnode *)fp->f_data;
- if (vp->v_mount->mnt_flag & MNT_RDONLY) {
- error = EROFS;
- goto out;
- }
- /*
- * Directories can cause deadlocks.
- */
- if (vp->v_type == VDIR) {
- error = EOPNOTSUPP;
- goto out;
- }
- vn_lock(vp, LK_EXCLUSIVE|LK_RETRY, p);
- error = VOP_SETATTR(vp, vap, ap->a_cred, p);
- VOP_UNLOCK(vp, 0, p);
-out:
- FRELE(fp);
- return (error);
-}
-
-#define UIO_MX 32
-
-struct fdesc_target {
- ino_t ft_fileno;
- u_char ft_type;
- u_char ft_namlen;
- char *ft_name;
-} fdesc_targets[] = {
-/* NOTE: The name must be less than UIO_MX-16 chars in length */
-#define N(s) sizeof(s)-1, s
- { FD_DEVFD, DT_DIR, N("fd") },
- { FD_STDIN, DT_LNK, N("stdin") },
- { FD_STDOUT, DT_LNK, N("stdout") },
- { FD_STDERR, DT_LNK, N("stderr") },
- { FD_CTTY, DT_UNKNOWN, N("tty") },
-#undef N
-};
-static int nfdesc_targets = sizeof(fdesc_targets) / sizeof(fdesc_targets[0]);
-
-int
-fdesc_readdir(v)
- void *v;
-{
- struct vop_readdir_args /* {
- struct vnode *a_vp;
- struct uio *a_uio;
- struct ucred *a_cred;
- int *a_eofflag;
- int *a_ncookies;
- u_long **a_cookies;
- } */ *ap = v;
- struct uio *uio = ap->a_uio;
- struct dirent d;
- struct filedesc *fdp;
- int i;
- int error;
-
- switch (VTOFDESC(ap->a_vp)->fd_type) {
- case Fctty:
- return (0);
-
- case Fdesc:
- return (ENOTDIR);
-
- default:
- break;
- }
-
- fdp = uio->uio_procp->p_fd;
-
- if (uio->uio_resid < UIO_MX)
- return (EINVAL);
-
- error = 0;
- i = uio->uio_offset;
- if (i < 0)
- return (EINVAL);
- bzero(&d, UIO_MX);
- d.d_reclen = UIO_MX;
-
- if (VTOFDESC(ap->a_vp)->fd_type == Froot) {
- struct fdesc_target *ft;
-
- for (ft = &fdesc_targets[i];
- uio->uio_resid >= UIO_MX && i < nfdesc_targets; ft++, i++) {
- switch (ft->ft_fileno) {
- case FD_CTTY:
- if (cttyvp(uio->uio_procp) == NULL)
- continue;
- break;
-
- case FD_STDIN:
- case FD_STDOUT:
- case FD_STDERR:
- if ((ft->ft_fileno - FD_STDIN) >= fdp->fd_nfiles)
- continue;
- if (fd_getfile(fdp, ft->ft_fileno - FD_STDIN) == NULL)
- continue;
- break;
- }
-
- d.d_fileno = ft->ft_fileno;
- d.d_namlen = ft->ft_namlen;
- bcopy(ft->ft_name, d.d_name, ft->ft_namlen + 1);
- d.d_type = ft->ft_type;
-
- if ((error = uiomove(&d, UIO_MX, uio)) != 0)
- break;
- }
- } else {
- for (; i - 2 < fdp->fd_nfiles && uio->uio_resid >= UIO_MX;
- i++) {
- switch (i) {
- case 0:
- case 1:
- d.d_fileno = FD_ROOT; /* XXX */
- d.d_namlen = i + 1;
- bcopy("..", d.d_name, d.d_namlen);
- d.d_name[i + 1] = '\0';
- d.d_type = DT_DIR;
- break;
-
- default:
- if (fd_getfile(fdp, i - 2) == NULL)
- continue;
- d.d_fileno = i - 2 + FD_STDIN;
- d.d_namlen = snprintf(d.d_name, sizeof d.d_name,
- "%d", i - 2);
- d.d_type = DT_UNKNOWN;
- break;
- }
-
- if ((error = uiomove(&d, UIO_MX, uio)) != 0)
- break;
- }
- }
-
- uio->uio_offset = i;
- return (error);
-}
-
-int
-fdesc_readlink(v)
- void *v;
-{
- struct vop_readlink_args /* {
- struct vnode *a_vp;
- struct uio *a_uio;
- struct ucred *a_cred;
- } */ *ap = v;
- struct vnode *vp = ap->a_vp;
- int error;
-
- if (vp->v_type != VLNK)
- return (EPERM);
-
- if (VTOFDESC(vp)->fd_type == Flink) {
- char *ln = VTOFDESC(vp)->fd_link;
- error = uiomove(ln, strlen(ln), ap->a_uio);
- } else {
- error = EOPNOTSUPP;
- }
-
- return (error);
-}
-
-int
-fdesc_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;
- int error = EOPNOTSUPP;
-
- switch (VTOFDESC(ap->a_vp)->fd_type) {
- case Fctty:
- error = cttyread(devctty, ap->a_uio, ap->a_ioflag);
- break;
-
- default:
- error = EOPNOTSUPP;
- break;
- }
-
- return (error);
-}
-
-int
-fdesc_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;
- int error = EOPNOTSUPP;
-
- switch (VTOFDESC(ap->a_vp)->fd_type) {
- case Fctty:
- error = cttywrite(devctty, ap->a_uio, ap->a_ioflag);
- break;
-
- default:
- error = EOPNOTSUPP;
- break;
- }
-
- return (error);
-}
-
-int
-fdesc_ioctl(v)
- void *v;
-{
- struct vop_ioctl_args /* {
- struct vnode *a_vp;
- u_long a_command;
- caddr_t a_data;
- int a_fflag;
- struct ucred *a_cred;
- struct proc *a_p;
- } */ *ap = v;
- int error = EOPNOTSUPP;
-
- switch (VTOFDESC(ap->a_vp)->fd_type) {
- case Fctty:
- error = cttyioctl(devctty, ap->a_command, ap->a_data,
- ap->a_fflag, ap->a_p);
- break;
-
- default:
- error = EOPNOTSUPP;
- break;
- }
-
- return (error);
-}
-
-int
-fdesc_poll(v)
- void *v;
-{
- struct vop_poll_args /* {
- struct vnode *a_vp;
- int a_events;
- struct proc *a_p;
- } */ *ap = v;
- int revents;
-
- switch (VTOFDESC(ap->a_vp)->fd_type) {
- case Fctty:
- revents = cttypoll(devctty, ap->a_events, ap->a_p);
- break;
-
- default:
- revents = ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM);
- break;
- }
-
- return (revents);
-}
-
-int
-fdesc_inactive(v)
- void *v;
-{
- struct vop_inactive_args /* {
- struct vnode *a_vp;
- struct proc *a_p;
- } */ *ap = v;
- struct vnode *vp = ap->a_vp;
-
- /*
- * Clear out the v_type field to avoid
- * nasty things happening in vgone().
- */
- VOP_UNLOCK(vp, 0, ap->a_p);
- vp->v_type = VNON;
- return (0);
-}
-
-int
-fdesc_reclaim(v)
- void *v;
-{
- struct vop_reclaim_args /* {
- struct vnode *a_vp;
- } */ *ap = v;
- struct vnode *vp = ap->a_vp;
- struct fdescnode *fd = VTOFDESC(vp);
-
- LIST_REMOVE(fd, fd_hash);
- FREE(vp->v_data, M_TEMP);
- vp->v_data = 0;
-
- return (0);
-}
-
-/*
- * Return POSIX pathconf information applicable to special devices.
- */
-int
-fdesc_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 the contents of a /dev/fd vnode.
- */
-/* ARGSUSED */
-int
-fdesc_print(v)
- void *v;
-{
- printf("tag VT_NON, fdesc vnode\n");
- return (0);
-}
-
-int
-fdesc_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
-fdesc_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);
-}
-
-/*
- * /dev/fd "should never get here" operation
- */
-/*ARGSUSED*/
-int
-fdesc_badop(v)
- void *v;
-{
-
- panic("fdesc: bad op");
- /* NOTREACHED */
-}
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 524492e587b..73f31adadd1 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount.h,v 1.65 2005/11/30 10:35:08 pedro Exp $ */
+/* $OpenBSD: mount.h,v 1.66 2005/12/06 20:18:57 pedro Exp $ */
/* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */
/*
@@ -345,7 +345,6 @@ struct ostatfs {
#define MOUNT_MFS "mfs" /* Memory Filesystem */
#define MOUNT_MSDOS "msdos" /* MSDOS Filesystem */
#define MOUNT_LFS "lfs" /* Log-based Filesystem */
-#define MOUNT_FDESC "fdesc" /* File Descriptor Filesystem */
#define MOUNT_PORTAL "portal" /* Portal Filesystem */
#define MOUNT_PROCFS "procfs" /* /proc Filesystem */
#define MOUNT_AFS "afs" /* Andrew Filesystem */
diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1
index b802050d4e5..0ce9ed57e4c 100644
--- a/usr.bin/man/man.1
+++ b/usr.bin/man/man.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: man.1,v 1.25 2005/11/27 13:12:00 jmc Exp $
+.\" $OpenBSD: man.1,v 1.26 2005/12/06 20:18:57 pedro Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -117,7 +117,6 @@ mount, unmount (2) \- mount or dismount a filesystem
mount_ados (8) \- mount an AmigaDOS file system
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_procfs (8) \- mount the process file system
mount_xfs (8) \- mount the xfs filesystem
diff --git a/usr.sbin/procmap/procmap.c b/usr.sbin/procmap/procmap.c
index 57c40d1115e..6eaf7b916d7 100644
--- a/usr.sbin/procmap/procmap.c
+++ b/usr.sbin/procmap/procmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procmap.c,v 1.21 2005/11/24 12:08:17 pedro Exp $ */
+/* $OpenBSD: procmap.c,v 1.22 2005/12/06 20:18:57 pedro Exp $ */
/* $NetBSD: pmap.c,v 1.1 2002/09/01 20:32:44 atatat Exp $ */
/*
@@ -637,7 +637,6 @@ dump_vm_map_entry(kvm_t *kd, struct kbit *vmspace,
case VT_MFS:
case VT_MSDOSFS:
case VT_LOFS:
- case VT_FDESC:
case VT_PORTAL:
case VT_PROCFS:
case VT_AFS: