1994-05-24 10:09:53 +00:00
|
|
|
/*
|
|
|
|
* 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. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. 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.9 (Berkeley) 1/21/94
|
|
|
|
*
|
1998-06-14 08:46:41 +00:00
|
|
|
* $Id: fdesc_vnops.c,v 1.37 1998/06/10 21:21:28 dfr Exp $
|
1994-05-24 10:09:53 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* /dev/fd Filesystem
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/proc.h>
|
|
|
|
#include <sys/kernel.h> /* boottime */
|
|
|
|
#include <sys/filedesc.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/dirent.h>
|
1994-10-02 17:48:58 +00:00
|
|
|
#include <sys/socketvar.h>
|
1995-12-08 11:19:42 +00:00
|
|
|
#include <sys/conf.h>
|
1994-05-24 10:09:53 +00:00
|
|
|
#include <miscfs/fdesc/fdesc.h>
|
|
|
|
|
1995-12-08 11:19:42 +00:00
|
|
|
extern struct cdevsw ctty_cdevsw;
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
#define cttyvp(p) ((p)->p_flag & P_CONTROLT ? (p)->p_session->s_ttyvp : NULL)
|
|
|
|
|
|
|
|
#define FDL_WANT 0x01
|
|
|
|
#define FDL_LOCKED 0x02
|
|
|
|
static int fdcache_lock;
|
|
|
|
|
1997-09-07 05:27:26 +00:00
|
|
|
static vop_t **fdesc_vnodeop_p;
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
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
|
|
|
|
|
1994-09-09 13:23:20 +00:00
|
|
|
#define NFDCACHE 4
|
1997-02-10 02:22:35 +00:00
|
|
|
#define FD_NHASH(ix) \
|
|
|
|
(&fdhashtbl[(ix) & fdhash])
|
1998-02-09 06:11:36 +00:00
|
|
|
static LIST_HEAD(fdhashhead, fdescnode) *fdhashtbl;
|
|
|
|
static u_long fdhash;
|
1994-05-24 10:09:53 +00:00
|
|
|
|
1995-12-03 14:54:48 +00:00
|
|
|
static int fdesc_attr __P((int fd, struct vattr *vap, struct ucred *cred,
|
|
|
|
struct proc *p));
|
|
|
|
static int fdesc_badop __P((void));
|
|
|
|
static int fdesc_getattr __P((struct vop_getattr_args *ap));
|
|
|
|
static struct fdcache *
|
|
|
|
fdesc_hash __P((int ix));
|
|
|
|
static int fdesc_inactive __P((struct vop_inactive_args *ap));
|
|
|
|
static int fdesc_ioctl __P((struct vop_ioctl_args *ap));
|
|
|
|
static int fdesc_lookup __P((struct vop_lookup_args *ap));
|
|
|
|
static int fdesc_open __P((struct vop_open_args *ap));
|
|
|
|
static int fdesc_print __P((struct vop_print_args *ap));
|
|
|
|
static int fdesc_read __P((struct vop_read_args *ap));
|
|
|
|
static int fdesc_readdir __P((struct vop_readdir_args *ap));
|
|
|
|
static int fdesc_readlink __P((struct vop_readlink_args *ap));
|
|
|
|
static int fdesc_reclaim __P((struct vop_reclaim_args *ap));
|
1997-09-14 02:58:12 +00:00
|
|
|
static int fdesc_poll __P((struct vop_poll_args *ap));
|
1995-12-03 14:54:48 +00:00
|
|
|
static int fdesc_setattr __P((struct vop_setattr_args *ap));
|
|
|
|
static int fdesc_write __P((struct vop_write_args *ap));
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
/*
|
|
|
|
* Initialise cache headers
|
|
|
|
*/
|
1994-05-25 09:21:21 +00:00
|
|
|
int
|
1997-02-10 02:22:35 +00:00
|
|
|
fdesc_init(vfsp)
|
|
|
|
struct vfsconf *vfsp;
|
1994-05-24 10:09:53 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
devctty = makedev(nchrdev, 0);
|
1997-02-10 02:22:35 +00:00
|
|
|
fdhashtbl = hashinit(NFDCACHE, M_CACHE, &fdhash);
|
1994-05-25 09:21:21 +00:00
|
|
|
return (0);
|
1994-05-24 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
fdesc_allocvp(ftype, ix, mp, vpp)
|
|
|
|
fdntype ftype;
|
|
|
|
int ix;
|
|
|
|
struct mount *mp;
|
|
|
|
struct vnode **vpp;
|
|
|
|
{
|
1997-02-10 02:22:35 +00:00
|
|
|
struct proc *p = curproc; /* XXX */
|
|
|
|
struct fdhashhead *fc;
|
1994-05-24 10:09:53 +00:00
|
|
|
struct fdescnode *fd;
|
|
|
|
int error = 0;
|
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
fc = FD_NHASH(ix);
|
1994-05-24 10:09:53 +00:00
|
|
|
loop:
|
1997-02-10 02:22:35 +00:00
|
|
|
for (fd = fc->lh_first; fd != 0; fd = fd->fd_hash.le_next) {
|
1994-05-24 10:09:53 +00:00
|
|
|
if (fd->fd_ix == ix && fd->fd_vnode->v_mount == mp) {
|
1997-02-10 02:22:35 +00:00
|
|
|
if (vget(fd->fd_vnode, 0, p))
|
1994-05-24 10:09:53 +00:00
|
|
|
goto loop;
|
|
|
|
*vpp = fd->fd_vnode;
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* otherwise lock the array while we call getnewvnode
|
|
|
|
* since that can block.
|
1995-05-30 08:16:23 +00:00
|
|
|
*/
|
1994-05-24 10:09:53 +00:00
|
|
|
if (fdcache_lock & FDL_LOCKED) {
|
|
|
|
fdcache_lock |= FDL_WANT;
|
1994-10-06 21:07:04 +00:00
|
|
|
(void) tsleep((caddr_t) &fdcache_lock, PINOD, "fdalvp", 0);
|
1994-05-24 10:09:53 +00:00
|
|
|
goto loop;
|
|
|
|
}
|
|
|
|
fdcache_lock |= FDL_LOCKED;
|
|
|
|
|
1996-06-12 03:37:57 +00:00
|
|
|
/*
|
|
|
|
* Do the MALLOC before the getnewvnode since doing so afterward
|
|
|
|
* might cause a bogus v_data pointer to get dereferenced
|
|
|
|
* elsewhere if MALLOC should block.
|
|
|
|
*/
|
|
|
|
MALLOC(fd, struct fdescnode *, sizeof(struct fdescnode), M_TEMP, M_WAITOK);
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
error = getnewvnode(VT_FDESC, mp, fdesc_vnodeop_p, vpp);
|
1996-06-12 03:37:57 +00:00
|
|
|
if (error) {
|
|
|
|
FREE(fd, M_TEMP);
|
1994-05-24 10:09:53 +00:00
|
|
|
goto out;
|
1996-06-12 03:37:57 +00:00
|
|
|
}
|
1994-05-24 10:09:53 +00:00
|
|
|
(*vpp)->v_data = fd;
|
|
|
|
fd->fd_vnode = *vpp;
|
|
|
|
fd->fd_type = ftype;
|
|
|
|
fd->fd_fd = -1;
|
|
|
|
fd->fd_link = 0;
|
|
|
|
fd->fd_ix = ix;
|
1997-02-10 02:22:35 +00:00
|
|
|
LIST_INSERT_HEAD(fc, fd, fd_hash);
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
out:;
|
|
|
|
fdcache_lock &= ~FDL_LOCKED;
|
|
|
|
|
|
|
|
if (fdcache_lock & FDL_WANT) {
|
|
|
|
fdcache_lock &= ~FDL_WANT;
|
|
|
|
wakeup((caddr_t) &fdcache_lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* vp is the current namei directory
|
|
|
|
* ndp is the name to locate in that directory...
|
|
|
|
*/
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_lookup(ap)
|
|
|
|
struct vop_lookup_args /* {
|
|
|
|
struct vnode * a_dvp;
|
|
|
|
struct vnode ** a_vpp;
|
|
|
|
struct componentname * a_cnp;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
struct vnode **vpp = ap->a_vpp;
|
|
|
|
struct vnode *dvp = ap->a_dvp;
|
1997-02-10 02:22:35 +00:00
|
|
|
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;
|
1994-05-24 10:09:53 +00:00
|
|
|
int error;
|
|
|
|
struct vnode *fvp;
|
|
|
|
char *ln;
|
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) {
|
1995-09-02 20:19:12 +00:00
|
|
|
error = EROFS;
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
VOP_UNLOCK(dvp, 0, p);
|
|
|
|
if (cnp->cn_namelen == 1 && *pname == '.') {
|
1994-05-24 10:09:53 +00:00
|
|
|
*vpp = dvp;
|
1997-02-10 02:22:35 +00:00
|
|
|
VREF(dvp);
|
|
|
|
vn_lock(dvp, LK_SHARED | LK_RETRY, p);
|
1994-05-24 10:09:53 +00:00
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (VTOFDESC(dvp)->fd_type) {
|
|
|
|
default:
|
|
|
|
case Flink:
|
|
|
|
case Fdesc:
|
|
|
|
case Fctty:
|
|
|
|
error = ENOTDIR;
|
|
|
|
goto bad;
|
|
|
|
|
|
|
|
case Froot:
|
1997-02-10 02:22:35 +00:00
|
|
|
if (cnp->cn_namelen == 2 && bcmp(pname, "fd", 2) == 0) {
|
1994-05-24 10:09:53 +00:00
|
|
|
error = fdesc_allocvp(Fdevfd, FD_DEVFD, dvp->v_mount, &fvp);
|
|
|
|
if (error)
|
|
|
|
goto bad;
|
|
|
|
*vpp = fvp;
|
|
|
|
fvp->v_type = VDIR;
|
1997-02-10 02:22:35 +00:00
|
|
|
vn_lock(fvp, LK_SHARED | LK_RETRY, p);
|
1994-05-24 10:09:53 +00:00
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
if (cnp->cn_namelen == 3 && bcmp(pname, "tty", 3) == 0) {
|
1994-05-24 10:09:53 +00:00
|
|
|
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 = VFIFO;
|
1997-02-10 02:22:35 +00:00
|
|
|
vn_lock(fvp, LK_SHARED | LK_RETRY, p);
|
1994-05-24 10:09:53 +00:00
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
ln = 0;
|
1997-02-10 02:22:35 +00:00
|
|
|
switch (cnp->cn_namelen) {
|
1994-05-24 10:09:53 +00:00
|
|
|
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;
|
1997-02-10 02:22:35 +00:00
|
|
|
vn_lock(fvp, LK_SHARED | LK_RETRY, p);
|
1994-05-24 10:09:53 +00:00
|
|
|
return (0);
|
|
|
|
} else {
|
|
|
|
error = ENOENT;
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FALL THROUGH */
|
|
|
|
|
|
|
|
case Fdevfd:
|
1997-02-10 02:22:35 +00:00
|
|
|
if (cnp->cn_namelen == 2 && bcmp(pname, "..", 2) == 0) {
|
|
|
|
if (error = fdesc_root(dvp->v_mount, vpp))
|
|
|
|
goto bad;
|
|
|
|
return (0);
|
1994-05-24 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 >= nfiles || p->p_fd->fd_ofiles[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;
|
1997-02-10 02:22:35 +00:00
|
|
|
vn_lock(fvp, LK_SHARED | LK_RETRY, p);
|
1994-05-24 10:09:53 +00:00
|
|
|
*vpp = fvp;
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
bad:;
|
1997-02-10 02:22:35 +00:00
|
|
|
vn_lock(dvp, LK_SHARED | LK_RETRY, p);
|
1994-05-24 10:09:53 +00:00
|
|
|
*vpp = NULL;
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_open(ap)
|
|
|
|
struct vop_open_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
int a_mode;
|
|
|
|
struct ucred *a_cred;
|
|
|
|
struct proc *a_p;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
struct vnode *vp = ap->a_vp;
|
|
|
|
int error = 0;
|
|
|
|
|
|
|
|
switch (VTOFDESC(vp)->fd_type) {
|
|
|
|
case Fdesc:
|
|
|
|
/*
|
|
|
|
* XXX Kludge: set p->p_dupfd to contain the value of the
|
1995-05-30 08:16:23 +00:00
|
|
|
* the file descriptor being sought for duplication. The error
|
1994-05-24 10:09:53 +00:00
|
|
|
* 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 */
|
|
|
|
error = ENODEV;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Fctty:
|
1995-12-08 11:19:42 +00:00
|
|
|
error = (*ctty_cdevsw.d_open)(devctty, ap->a_mode, 0, ap->a_p);
|
1994-05-24 10:09:53 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
fdesc_attr(fd, vap, cred, p)
|
|
|
|
int fd;
|
|
|
|
struct vattr *vap;
|
|
|
|
struct ucred *cred;
|
|
|
|
struct proc *p;
|
|
|
|
{
|
|
|
|
struct filedesc *fdp = p->p_fd;
|
|
|
|
struct file *fp;
|
|
|
|
struct stat stb;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
if (fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL)
|
|
|
|
return (EBADF);
|
|
|
|
|
|
|
|
switch (fp->f_type) {
|
1996-12-19 19:42:37 +00:00
|
|
|
case DTYPE_FIFO:
|
1994-05-24 10:09:53 +00:00
|
|
|
case DTYPE_VNODE:
|
|
|
|
error = VOP_GETATTR((struct vnode *) fp->f_data, vap, cred, p);
|
|
|
|
if (error == 0 && vap->va_type == VDIR) {
|
|
|
|
/*
|
1997-02-10 02:22:35 +00:00
|
|
|
* directories can cause loops in the namespace,
|
|
|
|
* so turn off the 'x' bits to avoid trouble.
|
1994-05-24 10:09:53 +00:00
|
|
|
*/
|
1997-02-10 02:22:35 +00:00
|
|
|
vap->va_mode &= ~((VEXEC)|(VEXEC>>3)|(VEXEC>>6));
|
1994-05-24 10:09:53 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DTYPE_SOCKET:
|
|
|
|
error = soo_stat((struct socket *)fp->f_data, &stb);
|
|
|
|
if (error == 0) {
|
|
|
|
vattr_null(vap);
|
|
|
|
vap->va_type = VSOCK;
|
|
|
|
vap->va_mode = stb.st_mode;
|
|
|
|
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 attr");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_getattr(ap)
|
|
|
|
struct vop_getattr_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
struct vattr *a_vap;
|
|
|
|
struct ucred *a_cred;
|
|
|
|
struct proc *a_p;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
struct vnode *vp = ap->a_vp;
|
|
|
|
struct vattr *vap = ap->a_vap;
|
|
|
|
unsigned fd;
|
|
|
|
int error = 0;
|
|
|
|
|
|
|
|
switch (VTOFDESC(vp)->fd_type) {
|
|
|
|
case Froot:
|
|
|
|
case Fdevfd:
|
|
|
|
case Flink:
|
|
|
|
case Fctty:
|
|
|
|
bzero((caddr_t) vap, sizeof(*vap));
|
|
|
|
vattr_null(vap);
|
|
|
|
vap->va_fileid = VTOFDESC(vp)->fd_ix;
|
|
|
|
|
|
|
|
switch (VTOFDESC(vp)->fd_type) {
|
|
|
|
case Flink:
|
|
|
|
vap->va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
|
|
|
|
vap->va_type = VLNK;
|
|
|
|
vap->va_nlink = 1;
|
|
|
|
vap->va_size = strlen(VTOFDESC(vp)->fd_link);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Fctty:
|
|
|
|
vap->va_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
|
|
|
|
vap->va_type = VFIFO;
|
|
|
|
vap->va_nlink = 1;
|
|
|
|
vap->va_size = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
vap->va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
|
|
|
|
vap->va_type = VDIR;
|
|
|
|
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;
|
1996-09-20 05:56:36 +00:00
|
|
|
vap->va_atime.tv_sec = boottime.tv_sec;
|
|
|
|
vap->va_atime.tv_nsec = 0;
|
1994-05-24 10:09:53 +00:00
|
|
|
vap->va_mtime = vap->va_atime;
|
|
|
|
vap->va_ctime = vap->va_mtime;
|
|
|
|
vap->va_gen = 0;
|
|
|
|
vap->va_flags = 0;
|
|
|
|
vap->va_rdev = 0;
|
|
|
|
vap->va_bytes = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Fdesc:
|
|
|
|
fd = VTOFDESC(vp)->fd_fd;
|
|
|
|
error = fdesc_attr(fd, vap, ap->a_cred, ap->a_p);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
panic("fdesc_getattr");
|
1995-05-30 08:16:23 +00:00
|
|
|
break;
|
1994-05-24 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (error == 0)
|
|
|
|
vp->v_type = vap->va_type;
|
|
|
|
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_setattr(ap)
|
|
|
|
struct vop_setattr_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
struct vattr *a_vap;
|
|
|
|
struct ucred *a_cred;
|
|
|
|
struct proc *a_p;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
struct filedesc *fdp = ap->a_p->p_fd;
|
1998-06-10 21:21:31 +00:00
|
|
|
struct vattr *vap = ap->a_vap;
|
1994-05-24 10:09:53 +00:00
|
|
|
struct file *fp;
|
|
|
|
unsigned fd;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Can't mess with the root vnode
|
|
|
|
*/
|
|
|
|
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
|
|
|
case Fdesc:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Fctty:
|
1998-06-10 06:34:57 +00:00
|
|
|
if (vap->va_flags != VNOVAL)
|
|
|
|
return (EOPNOTSUPP);
|
1994-05-24 10:09:53 +00:00
|
|
|
return (0);
|
|
|
|
|
|
|
|
default:
|
|
|
|
return (EACCES);
|
|
|
|
}
|
|
|
|
|
|
|
|
fd = VTOFDESC(ap->a_vp)->fd_fd;
|
|
|
|
if (fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) {
|
|
|
|
return (EBADF);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Can setattr the underlying vnode, but not sockets!
|
|
|
|
*/
|
|
|
|
switch (fp->f_type) {
|
1996-12-19 19:42:37 +00:00
|
|
|
case DTYPE_FIFO:
|
1998-06-10 06:34:57 +00:00
|
|
|
case DTYPE_PIPE:
|
1994-05-24 10:09:53 +00:00
|
|
|
case DTYPE_VNODE:
|
|
|
|
error = VOP_SETATTR((struct vnode *) fp->f_data, ap->a_vap, ap->a_cred, ap->a_p);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DTYPE_SOCKET:
|
1998-06-10 06:34:57 +00:00
|
|
|
if (vap->va_flags != VNOVAL)
|
1998-06-10 19:56:06 +00:00
|
|
|
error = EOPNOTSUPP;
|
1998-06-10 06:34:57 +00:00
|
|
|
else
|
|
|
|
error = 0;
|
1994-05-24 10:09:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
1994-09-09 13:24:26 +00:00
|
|
|
error = EBADF;
|
1994-05-24 10:09:53 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define UIO_MX 16
|
|
|
|
|
|
|
|
static struct dirtmp {
|
|
|
|
u_long d_fileno;
|
|
|
|
u_short d_reclen;
|
|
|
|
u_short d_namlen;
|
|
|
|
char d_name[8];
|
|
|
|
} rootent[] = {
|
|
|
|
{ FD_DEVFD, UIO_MX, 2, "fd" },
|
|
|
|
{ FD_STDIN, UIO_MX, 5, "stdin" },
|
|
|
|
{ FD_STDOUT, UIO_MX, 6, "stdout" },
|
|
|
|
{ FD_STDERR, UIO_MX, 6, "stderr" },
|
|
|
|
{ FD_CTTY, UIO_MX, 3, "tty" },
|
|
|
|
};
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_readdir(ap)
|
|
|
|
struct vop_readdir_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
struct uio *a_uio;
|
|
|
|
struct ucred *a_cred;
|
1997-02-10 02:22:35 +00:00
|
|
|
int *a_eofflag;
|
|
|
|
u_long *a_cookies;
|
|
|
|
int a_ncookies;
|
1994-05-24 10:09:53 +00:00
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
struct uio *uio = ap->a_uio;
|
|
|
|
struct filedesc *fdp;
|
1998-06-14 08:46:41 +00:00
|
|
|
int error, i, off;
|
1994-05-24 10:09:53 +00:00
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
/*
|
|
|
|
* We don't allow exporting fdesc mounts, and currently local
|
|
|
|
* requests do not need cookies.
|
|
|
|
*/
|
|
|
|
if (ap->a_ncookies)
|
|
|
|
panic("fdesc_readdir: not hungry");
|
|
|
|
|
1998-06-14 08:46:41 +00:00
|
|
|
if (VTOFDESC(ap->a_vp)->fd_type != Froot &&
|
|
|
|
VTOFDESC(ap->a_vp)->fd_type != Fdevfd)
|
|
|
|
panic("fdesc_readdir: not dir");
|
1994-05-24 10:09:53 +00:00
|
|
|
|
1998-06-14 08:46:41 +00:00
|
|
|
off = (int)uio->uio_offset;
|
|
|
|
if (off != uio->uio_offset || off < 0 || (u_int)off % UIO_MX != 0 ||
|
|
|
|
uio->uio_resid < UIO_MX)
|
|
|
|
return (EINVAL);
|
|
|
|
i = (u_int)off / UIO_MX;
|
1994-05-24 10:09:53 +00:00
|
|
|
fdp = uio->uio_procp->p_fd;
|
|
|
|
|
|
|
|
if (VTOFDESC(ap->a_vp)->fd_type == Froot) {
|
|
|
|
struct dirent d;
|
|
|
|
struct dirent *dp = &d;
|
|
|
|
struct dirtmp *dt;
|
|
|
|
|
|
|
|
error = 0;
|
|
|
|
|
1998-06-14 08:46:41 +00:00
|
|
|
while (i < sizeof(rootent) / sizeof(rootent[0]) &&
|
|
|
|
uio->uio_resid >= UIO_MX) {
|
1994-05-24 10:09:53 +00:00
|
|
|
dt = &rootent[i];
|
|
|
|
switch (dt->d_fileno) {
|
|
|
|
case FD_CTTY:
|
|
|
|
if (cttyvp(uio->uio_procp) == NULL)
|
|
|
|
continue;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FD_STDIN:
|
|
|
|
case FD_STDOUT:
|
|
|
|
case FD_STDERR:
|
|
|
|
if ((dt->d_fileno-FD_STDIN) >= fdp->fd_nfiles)
|
|
|
|
continue;
|
|
|
|
if (fdp->fd_ofiles[dt->d_fileno-FD_STDIN] == NULL)
|
|
|
|
continue;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
bzero((caddr_t) dp, UIO_MX);
|
|
|
|
dp->d_fileno = dt->d_fileno;
|
|
|
|
dp->d_namlen = dt->d_namlen;
|
|
|
|
dp->d_type = DT_UNKNOWN;
|
|
|
|
dp->d_reclen = dt->d_reclen;
|
|
|
|
bcopy(dt->d_name, dp->d_name, dp->d_namlen+1);
|
|
|
|
error = uiomove((caddr_t) dp, UIO_MX, uio);
|
|
|
|
if (error)
|
|
|
|
break;
|
1998-06-14 08:46:41 +00:00
|
|
|
i++;
|
1994-05-24 10:09:53 +00:00
|
|
|
}
|
|
|
|
uio->uio_offset = i * UIO_MX;
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
error = 0;
|
1998-06-14 08:46:41 +00:00
|
|
|
while (i < fdp->fd_nfiles && uio->uio_resid >= UIO_MX) {
|
1994-05-24 10:09:53 +00:00
|
|
|
if (fdp->fd_ofiles[i] != NULL) {
|
|
|
|
struct dirent d;
|
|
|
|
struct dirent *dp = &d;
|
|
|
|
|
|
|
|
bzero((caddr_t) dp, UIO_MX);
|
|
|
|
|
|
|
|
dp->d_namlen = sprintf(dp->d_name, "%d", i);
|
|
|
|
dp->d_reclen = UIO_MX;
|
|
|
|
dp->d_type = DT_UNKNOWN;
|
|
|
|
dp->d_fileno = i + FD_STDIN;
|
|
|
|
/*
|
|
|
|
* And ship to userland
|
|
|
|
*/
|
|
|
|
error = uiomove((caddr_t) dp, UIO_MX, uio);
|
|
|
|
if (error)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
uio->uio_offset = i * UIO_MX;
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_readlink(ap)
|
|
|
|
struct vop_readlink_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
struct uio *a_uio;
|
|
|
|
struct ucred *a_cred;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_read(ap)
|
|
|
|
struct vop_read_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
struct uio *a_uio;
|
|
|
|
int a_ioflag;
|
|
|
|
struct ucred *a_cred;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
int error = EOPNOTSUPP;
|
|
|
|
|
|
|
|
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
|
|
|
case Fctty:
|
1995-12-08 11:19:42 +00:00
|
|
|
error = (*ctty_cdevsw.d_read)(devctty, ap->a_uio, ap->a_ioflag);
|
1994-05-24 10:09:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
error = EOPNOTSUPP;
|
|
|
|
break;
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_write(ap)
|
|
|
|
struct vop_write_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
struct uio *a_uio;
|
|
|
|
int a_ioflag;
|
|
|
|
struct ucred *a_cred;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
int error = EOPNOTSUPP;
|
|
|
|
|
|
|
|
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
|
|
|
case Fctty:
|
1995-12-08 11:19:42 +00:00
|
|
|
error = (*ctty_cdevsw.d_write)(devctty, ap->a_uio, ap->a_ioflag);
|
1994-05-24 10:09:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
error = EOPNOTSUPP;
|
|
|
|
break;
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_ioctl(ap)
|
|
|
|
struct vop_ioctl_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
int a_command;
|
|
|
|
caddr_t a_data;
|
|
|
|
int a_fflag;
|
|
|
|
struct ucred *a_cred;
|
|
|
|
struct proc *a_p;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
int error = EOPNOTSUPP;
|
|
|
|
|
|
|
|
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
|
|
|
case Fctty:
|
1995-12-08 11:19:42 +00:00
|
|
|
error = (*ctty_cdevsw.d_ioctl)(devctty, ap->a_command,
|
|
|
|
ap->a_data, ap->a_fflag, ap->a_p);
|
1994-05-24 10:09:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
error = EOPNOTSUPP;
|
|
|
|
break;
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1997-09-14 02:58:12 +00:00
|
|
|
fdesc_poll(ap)
|
|
|
|
struct vop_poll_args /* {
|
1994-05-24 10:09:53 +00:00
|
|
|
struct vnode *a_vp;
|
1997-09-14 02:58:12 +00:00
|
|
|
int a_events;
|
1994-05-24 10:09:53 +00:00
|
|
|
struct ucred *a_cred;
|
|
|
|
struct proc *a_p;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
1997-09-14 02:58:12 +00:00
|
|
|
int revents;
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
|
|
|
case Fctty:
|
1997-09-14 02:58:12 +00:00
|
|
|
revents = (*ctty_cdevsw.d_poll)(devctty, ap->a_events, ap->a_p);
|
1994-05-24 10:09:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
1997-09-14 02:58:12 +00:00
|
|
|
revents = seltrue(0, ap->a_events, ap->a_p);
|
1994-05-24 10:09:53 +00:00
|
|
|
break;
|
|
|
|
}
|
1995-05-30 08:16:23 +00:00
|
|
|
|
1997-09-14 02:58:12 +00:00
|
|
|
return (revents);
|
1994-05-24 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_inactive(ap)
|
|
|
|
struct vop_inactive_args /* {
|
|
|
|
struct vnode *a_vp;
|
1997-02-10 02:22:35 +00:00
|
|
|
struct proc *a_p;
|
1994-05-24 10:09:53 +00:00
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
struct vnode *vp = ap->a_vp;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Clear out the v_type field to avoid
|
|
|
|
* nasty things happening in vgone().
|
|
|
|
*/
|
1997-02-10 02:22:35 +00:00
|
|
|
VOP_UNLOCK(vp, 0, ap->a_p);
|
1994-05-24 10:09:53 +00:00
|
|
|
vp->v_type = VNON;
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_reclaim(ap)
|
|
|
|
struct vop_reclaim_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
struct vnode *vp = ap->a_vp;
|
1997-02-10 02:22:35 +00:00
|
|
|
struct fdescnode *fd = VTOFDESC(vp);
|
1994-05-24 10:09:53 +00:00
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
LIST_REMOVE(fd, fd_hash);
|
1994-05-24 10:09:53 +00:00
|
|
|
FREE(vp->v_data, M_TEMP);
|
|
|
|
vp->v_data = 0;
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Print out the contents of a /dev/fd vnode.
|
|
|
|
*/
|
|
|
|
/* ARGSUSED */
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_print(ap)
|
|
|
|
struct vop_print_args /* {
|
|
|
|
struct vnode *a_vp;
|
|
|
|
} */ *ap;
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("tag VT_NON, fdesc vnode\n");
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* /dev/fd "should never get here" operation
|
|
|
|
*/
|
1995-11-07 13:39:31 +00:00
|
|
|
static int
|
1994-05-24 10:09:53 +00:00
|
|
|
fdesc_badop()
|
|
|
|
{
|
|
|
|
|
|
|
|
panic("fdesc: bad op");
|
|
|
|
/* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
1995-11-07 13:39:31 +00:00
|
|
|
static struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = {
|
1997-10-26 20:55:39 +00:00
|
|
|
{ &vop_default_desc, (vop_t *) vop_defaultop },
|
|
|
|
{ &vop_access_desc, (vop_t *) vop_null },
|
VFS mega cleanup commit (x/N)
1. Add new file "sys/kern/vfs_default.c" where default actions for
VOPs go. Implement proper defaults for ABORTOP, BWRITE, LEASE,
POLL, REVOKE and STRATEGY. Various stuff spread over the entire
tree belongs here.
2. Change VOP_BLKATOFF to a normal function in cd9660.
3. Kill VOP_BLKATOFF, VOP_TRUNCATE, VOP_VFREE, VOP_VALLOC. These
are private interface functions between UFS and the underlying
storage manager layer (FFS/LFS/MFS/EXT2FS). The functions now
live in struct ufsmount instead.
4. Remove a kludge of VOP_ functions in all filesystems, that did
nothing but obscure the simplicity and break the expandability.
If a filesystem doesn't implement VOP_FOO, it shouldn't have an
entry for it in its vnops table. The system will try to DTRT
if it is not implemented. There are still some cruft left, but
the bulk of it is done.
5. Fix another VCALL in vfs_cache.c (thanks Bruce!)
1997-10-16 10:50:27 +00:00
|
|
|
{ &vop_bmap_desc, (vop_t *) fdesc_badop },
|
1997-10-15 09:22:02 +00:00
|
|
|
{ &vop_getattr_desc, (vop_t *) fdesc_getattr },
|
1997-10-15 10:05:29 +00:00
|
|
|
{ &vop_inactive_desc, (vop_t *) fdesc_inactive },
|
1997-10-15 09:22:02 +00:00
|
|
|
{ &vop_ioctl_desc, (vop_t *) fdesc_ioctl },
|
|
|
|
{ &vop_lookup_desc, (vop_t *) fdesc_lookup },
|
|
|
|
{ &vop_open_desc, (vop_t *) fdesc_open },
|
1997-10-16 20:32:40 +00:00
|
|
|
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
1997-10-15 09:22:02 +00:00
|
|
|
{ &vop_poll_desc, (vop_t *) fdesc_poll },
|
|
|
|
{ &vop_print_desc, (vop_t *) fdesc_print },
|
|
|
|
{ &vop_read_desc, (vop_t *) fdesc_read },
|
|
|
|
{ &vop_readdir_desc, (vop_t *) fdesc_readdir },
|
1997-10-15 10:05:29 +00:00
|
|
|
{ &vop_readlink_desc, (vop_t *) fdesc_readlink },
|
1997-10-15 09:22:02 +00:00
|
|
|
{ &vop_reclaim_desc, (vop_t *) fdesc_reclaim },
|
|
|
|
{ &vop_setattr_desc, (vop_t *) fdesc_setattr },
|
|
|
|
{ &vop_write_desc, (vop_t *) fdesc_write },
|
1995-11-09 08:17:23 +00:00
|
|
|
{ NULL, NULL }
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
1995-11-07 13:39:31 +00:00
|
|
|
static struct vnodeopv_desc fdesc_vnodeop_opv_desc =
|
1994-05-24 10:09:53 +00:00
|
|
|
{ &fdesc_vnodeop_p, fdesc_vnodeop_entries };
|
1994-09-21 03:47:43 +00:00
|
|
|
|
|
|
|
VNODEOP_SET(fdesc_vnodeop_opv_desc);
|