153838Spendry /* 253838Spendry * Copyright (c) 1992 The Regents of the University of California 353838Spendry * Copyright (c) 1990, 1992 Jan-Simon Pendry 453838Spendry * All rights reserved. 553838Spendry * 653838Spendry * This code is derived from software donated to Berkeley by 753838Spendry * Jan-Simon Pendry. 853838Spendry * 953838Spendry * %sccs.include.redist.c% 1053838Spendry * 11*54981Spendry * @(#)fdesc_vnops.c 1.4 (Berkeley) 07/12/92 1253838Spendry * 1353838Spendry * $Id: fdesc_vnops.c,v 1.7 1992/05/30 10:05:34 jsp Exp jsp $ 1453838Spendry */ 1553838Spendry 1653838Spendry /* 1753838Spendry * /dev/fd Filesystem 1853838Spendry */ 1953838Spendry 2053838Spendry #include <sys/param.h> 2153838Spendry #include <sys/systm.h> 2253838Spendry #include <sys/types.h> 2353838Spendry #include <sys/time.h> 2453838Spendry #include <sys/proc.h> 2553838Spendry #include <sys/resourcevar.h> 2653838Spendry #include <sys/filedesc.h> 2753838Spendry #include <sys/vnode.h> 2853838Spendry #include <sys/malloc.h> 2953838Spendry #include <sys/file.h> 3053838Spendry #include <sys/stat.h> 3153838Spendry #include <sys/mount.h> 3253838Spendry #include <sys/namei.h> 3353838Spendry #include <sys/buf.h> 34*54981Spendry #include <sys/dirent.h> 3553838Spendry #include <fdesc/fdesc.h> 3653838Spendry 3753838Spendry /* 3853838Spendry * vp is the current namei directory 3953838Spendry * ndp is the name to locate in that directory... 4053838Spendry */ 4153838Spendry fdesc_lookup (ap) 4253838Spendry struct vop_lookup_args *ap; 4353838Spendry { 4454049Spendry struct vnode **vpp = ap->a_vpp; 4554049Spendry struct vnode *dvp = ap->a_dvp; 4653838Spendry char *pname; 4753838Spendry struct proc *p; 4853838Spendry int nfiles; 4953838Spendry unsigned fd; 5053838Spendry int error; 5153838Spendry struct vnode *fvp; 5253838Spendry 5353838Spendry #ifdef FDESC_DIAGNOSTIC 5453838Spendry printf("fdesc_lookup(%x)\n", ap); 5554049Spendry printf("fdesc_lookup(dp = %x, vpp = %x, cnp = %x)\n", dvp, vpp, ap->a_cnp); 5653838Spendry #endif 5753838Spendry pname = ap->a_cnp->cn_nameptr; 5853838Spendry #ifdef FDESC_DIAGNOSTIC 5953838Spendry printf("fdesc_lookup(%s)\n", pname); 6053838Spendry #endif 6153838Spendry if (ap->a_cnp->cn_namelen == 1 && *pname == '.') { 6254049Spendry *vpp = dvp; 6354049Spendry VREF(dvp); 6454049Spendry /*VOP_LOCK(dvp);*/ 6553838Spendry return (0); 6653838Spendry } 6753838Spendry 6853838Spendry p = ap->a_cnp->cn_proc; 6953838Spendry nfiles = p->p_fd->fd_nfiles; 7053838Spendry 7153838Spendry fd = 0; 7253838Spendry while (*pname >= '0' && *pname <= '9') { 7353838Spendry fd = 10 * fd + *pname++ - '0'; 7453838Spendry if (fd >= nfiles) 7553838Spendry break; 7653838Spendry } 7753838Spendry 7853838Spendry #ifdef FDESC_DIAGNOSTIC 7953838Spendry printf("fdesc_lookup: fd = %d, *pname = %x\n", fd, *pname); 8053838Spendry #endif 8153838Spendry if (*pname != '\0') { 8253838Spendry error = ENOENT; 8353838Spendry goto bad; 8453838Spendry } 8553838Spendry 8653838Spendry if (fd >= nfiles || p->p_fd->fd_ofiles[fd] == NULL) { 8753838Spendry error = EBADF; 8853838Spendry goto bad; 8953838Spendry } 9053838Spendry 9153838Spendry #ifdef FDESC_DIAGNOSTIC 9253838Spendry printf("fdesc_lookup: allocate new vnode\n"); 9353838Spendry #endif 9454049Spendry error = getnewvnode(VT_UFS, dvp->v_mount, fdesc_vnodeop_p, &fvp); 9553838Spendry if (error) 9653838Spendry goto bad; 9753838Spendry MALLOC(fvp->v_data, void *, sizeof(struct fdescnode), M_TEMP, M_WAITOK); 9853838Spendry VTOFDESC(fvp)->f_fd = fd; 9953838Spendry /*VTOFDESC(fvp)->f_isroot = 0;*/ 10054049Spendry *vpp = fvp; 10153838Spendry #ifdef FDESC_DIAGNOSTIC 10253838Spendry printf("fdesc_lookup: newvp = %x\n", fvp); 10353838Spendry #endif 10453838Spendry return (0); 10553838Spendry 10653838Spendry bad:; 10754049Spendry *vpp = NULL; 10853838Spendry #ifdef FDESC_DIAGNOSTIC 10953838Spendry printf("fdesc_lookup: error = %d\n", error); 11053838Spendry #endif 11153838Spendry return (error); 11253838Spendry } 11353838Spendry 11453838Spendry fdesc_open (ap) 11553838Spendry struct vop_open_args *ap; 11653838Spendry { 11754049Spendry struct vnode *vp = ap->a_vp; 11854049Spendry 11953838Spendry /* 12053838Spendry * Can always open the root (modulo perms) 12153838Spendry */ 12254049Spendry if (vp->v_flag & VROOT) 12353838Spendry return (0); 12453838Spendry 12553838Spendry /* 12653838Spendry * XXX Kludge: set ap->a_p->p_dupfd to contain the value of the 12753838Spendry * the file descriptor being sought for duplication. The error 12853838Spendry * return ensures that the vnode for this device will be released 12953838Spendry * by vn_open. Open will detect this special error and take the 13053838Spendry * actions in dupfdopen. Other callers of vn_open or VOP_OPEN 13153838Spendry * will simply report the error. 13253838Spendry */ 13354049Spendry ap->a_p->p_dupfd = VTOFDESC(vp)->f_fd; /* XXX */ 13453838Spendry return (ENODEV); 13553838Spendry } 13653838Spendry 13753838Spendry static int 13853838Spendry fdesc_attr(fd, vap, cred, p) 13953838Spendry int fd; 14053838Spendry struct vattr *vap; 14153838Spendry struct ucred *cred; 14253838Spendry struct proc *p; 14353838Spendry { 14453838Spendry struct filedesc *fdp = p->p_fd; 14553838Spendry struct file *fp; 14653838Spendry int error; 14753838Spendry 14853838Spendry #ifdef FDESC_DIAGNOSTIC 14953838Spendry printf("fdesc_attr: fd = %d, nfiles = %d\n", fd, fdp->fd_nfiles); 15053838Spendry #endif 15153838Spendry if (fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) { 15253838Spendry #ifdef FDESC_DIAGNOSTIC 15353838Spendry printf("fdesc_attr: fp = %x (EBADF)\n", fp); 15453838Spendry #endif 15553838Spendry return (EBADF); 15653838Spendry } 15753838Spendry 15853838Spendry /* 15953838Spendry * Can stat the underlying vnode, but not sockets because 16053838Spendry * they don't use struct vattrs. Well, we could convert from 16153838Spendry * a struct stat back to a struct vattr, later... 16253838Spendry */ 16353838Spendry switch (fp->f_type) { 16453838Spendry case DTYPE_VNODE: 16553838Spendry error = VOP_GETATTR((struct vnode *) fp->f_data, vap, cred, p); 16653838Spendry break; 16753838Spendry 16853838Spendry case DTYPE_SOCKET: 16953838Spendry error = EOPNOTSUPP; 17053838Spendry break; 17153838Spendry 17253838Spendry default: 17353838Spendry panic("fdesc attr"); 17453838Spendry break; 17553838Spendry } 17653838Spendry 17753838Spendry #ifdef FDESC_DIAGNOSTIC 17853838Spendry printf("fdesc_attr: returns error %d\n", error); 17953838Spendry #endif 18053838Spendry return (error); 18153838Spendry } 18253838Spendry 18353838Spendry fdesc_getattr (ap) 18453838Spendry struct vop_getattr_args *ap; 18553838Spendry { 18654049Spendry struct vnode *vp = ap->a_vp; 18754049Spendry struct vattr *vap = ap->a_vap; 18853838Spendry unsigned fd; 18953838Spendry int error; 19053838Spendry 19154049Spendry if (vp->v_flag & VROOT) { 19253838Spendry #ifdef FDESC_DIAGNOSTIC 19353838Spendry printf("fdesc_getattr: stat rootdir\n"); 19453838Spendry #endif 19554049Spendry bzero((caddr_t) vap, sizeof(*vap)); 19654049Spendry vattr_null(vap); 19754049Spendry vap->va_type = VDIR; 19854049Spendry vap->va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; 19954049Spendry vap->va_nlink = 2; 20054049Spendry vap->va_uid = 0; 20154049Spendry vap->va_gid = 0; 20254049Spendry vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; 20354049Spendry vap->va_fileid = 2; 20454049Spendry /* vap->va_qsize = 0; */ 20554049Spendry vap->va_size = DEV_BSIZE; 20654049Spendry vap->va_blocksize = DEV_BSIZE; 20754049Spendry microtime(&vap->va_atime); 20854049Spendry vap->va_mtime = vap->va_atime; 20954049Spendry vap->va_ctime = vap->va_ctime; 21054049Spendry vap->va_gen = 0; 21154049Spendry vap->va_flags = 0; 21254049Spendry vap->va_rdev = 0; 21354049Spendry /* vap->va_qbytes = 0; */ 21454049Spendry vap->va_bytes = 0; 21553838Spendry return (0); 21653838Spendry } 21753838Spendry 21854049Spendry fd = VTOFDESC(vp)->f_fd; 21954049Spendry error = fdesc_attr(fd, vap, ap->a_cred, ap->a_p); 22053838Spendry if (error == 0) 22154049Spendry vp->v_type = vap->va_type; 22253838Spendry return (error); 22353838Spendry } 22453838Spendry 22553838Spendry fdesc_setattr (ap) 22653838Spendry struct vop_setattr_args *ap; 22753838Spendry { 22853838Spendry struct filedesc *fdp = ap->a_p->p_fd; 22953838Spendry struct file *fp; 23053838Spendry unsigned fd; 23153838Spendry int error; 23253838Spendry 23353838Spendry /* 23453838Spendry * Can't mess with the root vnode 23553838Spendry */ 23653838Spendry if (ap->a_vp->v_flag & VROOT) 23753838Spendry return (EACCES); 23853838Spendry 23953838Spendry fd = VTOFDESC(ap->a_vp)->f_fd; 24053838Spendry #ifdef FDESC_DIAGNOSTIC 24153838Spendry printf("fdesc_setattr: fd = %d, nfiles = %d\n", fd, fdp->fd_nfiles); 24253838Spendry #endif 24353838Spendry if (fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) { 24453838Spendry #ifdef FDESC_DIAGNOSTIC 24553838Spendry printf("fdesc_setattr: fp = %x (EBADF)\n", fp); 24653838Spendry #endif 24753838Spendry return (EBADF); 24853838Spendry } 24953838Spendry 25053838Spendry /* 25153838Spendry * Can setattr the underlying vnode, but not sockets! 25253838Spendry */ 25353838Spendry switch (fp->f_type) { 25453838Spendry case DTYPE_VNODE: 25553838Spendry error = VOP_SETATTR((struct vnode *) fp->f_data, ap->a_vap, ap->a_cred, ap->a_p); 25653838Spendry break; 25753838Spendry 25853838Spendry case DTYPE_SOCKET: 25953838Spendry error = EOPNOTSUPP; 26053838Spendry break; 26153838Spendry 26253838Spendry default: 26353838Spendry panic("fdesc setattr"); 26453838Spendry break; 26553838Spendry } 26653838Spendry 26753838Spendry #ifdef FDESC_DIAGNOSTIC 26853838Spendry printf("fdesc_setattr: returns error %d\n", error); 26953838Spendry #endif 27053838Spendry return (error); 27153838Spendry } 27253838Spendry 27353838Spendry fdesc_readdir (ap) 27453838Spendry struct vop_readdir_args *ap; 27553838Spendry { 27654049Spendry struct uio *uio = ap->a_uio; 27753838Spendry struct filedesc *fdp; 27853838Spendry int i; 27953838Spendry int error; 28053838Spendry 28153838Spendry #define UIO_MX 16 28253838Spendry 28354049Spendry fdp = uio->uio_procp->p_fd; 28454049Spendry i = uio->uio_offset / UIO_MX; 28553838Spendry error = 0; 28654049Spendry while (uio->uio_resid > 0) { 28753838Spendry if (i >= fdp->fd_nfiles) { 28854980Spendry /* *ap->a_eofflagp = 1; */ 28953838Spendry break; 29053838Spendry } 29153838Spendry if (fdp->fd_ofiles[i] != NULL) { 292*54981Spendry struct dirent d; 293*54981Spendry struct dirent *dp = &d; 29453838Spendry char *cp = dp->d_name; 29553838Spendry #ifdef FDESC_FILEID 29653838Spendry struct vattr va; 29753838Spendry #endif 29853838Spendry bzero((caddr_t) dp, UIO_MX); 29953838Spendry 30053838Spendry dp->d_namlen = sprintf(dp->d_name, "%d", i); 30153838Spendry /* 30253838Spendry * Fill in the remaining fields 30353838Spendry */ 30453838Spendry dp->d_reclen = UIO_MX; 305*54981Spendry dp->d_type = DT_UNKNOWN; 306*54981Spendry dp->d_fileno = i + 3; 30753838Spendry #ifdef FDESC_FILEID 30853838Spendry /* 30953838Spendry * If we want the file ids to match the 31053838Spendry * we must call getattr on the underlying file. 31153838Spendry * fdesc_attr may return an error, in which case 31253838Spendry * we ignore the returned file id. 31353838Spendry */ 31453838Spendry error = fdesc_attr(i, &va, ap->a_cred, p); 31553838Spendry if (error == 0) 31653838Spendry dp->d_ino = va.va_fileid; 31753838Spendry #endif 31853838Spendry /* 31953838Spendry * And ship to userland 32053838Spendry */ 32154049Spendry error = uiomove((caddr_t) dp, UIO_MX, uio); 32253838Spendry if (error) 32353838Spendry break; 32453838Spendry } 32553838Spendry i++; 32653838Spendry } 32753838Spendry 32854049Spendry uio->uio_offset = i * UIO_MX; 32953838Spendry return (error); 33053838Spendry } 33153838Spendry 33253838Spendry fdesc_inactive (ap) 33353838Spendry struct vop_inactive_args *ap; 33453838Spendry { 33554049Spendry struct vnode *vp = ap->a_vp; 33654049Spendry 33753838Spendry /* 33853838Spendry * Clear out the v_type field to avoid 33953838Spendry * nasty things happening in vgone(). 34053838Spendry */ 34154049Spendry vp->v_type = VNON; 34253838Spendry #ifdef FDESC_DIAGNOSTIC 34354049Spendry printf("fdesc_inactive(%x)\n", vp); 34453838Spendry #endif 34553838Spendry return (0); 34653838Spendry } 34753838Spendry 34853838Spendry fdesc_reclaim (ap) 34953838Spendry struct vop_reclaim_args *ap; 35053838Spendry { 35153838Spendry struct vnode *vp = ap->a_vp; 35253838Spendry printf("fdesc_reclaim(%x)\n", vp); 35353838Spendry if (vp->v_data) { 35453838Spendry FREE(vp->v_data, M_TEMP); 35553838Spendry vp->v_data = 0; 35653838Spendry } 35753838Spendry return (0); 35853838Spendry } 35953838Spendry 36053838Spendry /* 36153838Spendry * Print out the contents of a /dev/fd vnode. 36253838Spendry */ 36353838Spendry /* ARGSUSED */ 36453838Spendry fdesc_print (ap) 36553838Spendry struct vop_print_args *ap; 36653838Spendry { 36753838Spendry printf("tag VT_NON, fdesc vnode\n"); 36853838Spendry } 36953838Spendry 37053838Spendry /*void*/ 37153838Spendry fdesc_vfree (ap) 37253838Spendry struct vop_vfree_args *ap; 37353838Spendry { 37453838Spendry 37553838Spendry return; 37653838Spendry } 37753838Spendry 37853838Spendry /* 37953838Spendry * /dev/fd vnode unsupported operation 38053838Spendry */ 38153838Spendry fdesc_enotsupp() 38253838Spendry { 38353838Spendry return (EOPNOTSUPP); 38453838Spendry } 38553838Spendry 38653838Spendry /* 38753838Spendry * /dev/fd "should never get here" operation 38853838Spendry */ 38953838Spendry fdesc_badop() 39053838Spendry { 39153838Spendry panic("fdesc: bad op"); 39253838Spendry /* NOTREACHED */ 39353838Spendry } 39453838Spendry 39553838Spendry /* 39653838Spendry * /dev/fd vnode null operation 39753838Spendry */ 39853838Spendry fdesc_nullop() 39953838Spendry { 40053838Spendry return (0); 40153838Spendry } 40253838Spendry 40353838Spendry #define fdesc_create ((int (*) __P((struct vop_create_args *)))fdesc_enotsupp) 40453838Spendry #define fdesc_mknod ((int (*) __P((struct vop_mknod_args *)))fdesc_enotsupp) 40553838Spendry #define fdesc_close ((int (*) __P((struct vop_close_args *)))nullop) 40653838Spendry #define fdesc_access ((int (*) __P((struct vop_access_args *)))nullop) 40753838Spendry #define fdesc_read ((int (*) __P((struct vop_read_args *)))fdesc_enotsupp) 40853838Spendry #define fdesc_write ((int (*) __P((struct vop_write_args *)))fdesc_enotsupp) 40953838Spendry #define fdesc_ioctl ((int (*) __P((struct vop_ioctl_args *)))fdesc_enotsupp) 41053838Spendry #define fdesc_select ((int (*) __P((struct vop_select_args *)))fdesc_enotsupp) 41153838Spendry #define fdesc_mmap ((int (*) __P((struct vop_mmap_args *)))fdesc_enotsupp) 41253838Spendry #define fdesc_fsync ((int (*) __P((struct vop_fsync_args *)))nullop) 41353838Spendry #define fdesc_seek ((int (*) __P((struct vop_seek_args *)))nullop) 41453838Spendry #define fdesc_remove ((int (*) __P((struct vop_remove_args *)))fdesc_enotsupp) 41553838Spendry #define fdesc_link ((int (*) __P((struct vop_link_args *)))fdesc_enotsupp) 41653838Spendry #define fdesc_rename ((int (*) __P((struct vop_rename_args *)))fdesc_enotsupp) 41753838Spendry #define fdesc_mkdir ((int (*) __P((struct vop_mkdir_args *)))fdesc_enotsupp) 41853838Spendry #define fdesc_rmdir ((int (*) __P((struct vop_rmdir_args *)))fdesc_enotsupp) 41953838Spendry #define fdesc_symlink ((int (*) __P((struct vop_symlink_args *)))fdesc_enotsupp) 42053838Spendry #define fdesc_readlink ((int (*) __P((struct vop_readlink_args *)))fdesc_enotsupp) 42153838Spendry #define fdesc_abortop ((int (*) __P((struct vop_abortop_args *)))nullop) 42253838Spendry #define fdesc_lock ((int (*) __P((struct vop_lock_args *)))nullop) 42353838Spendry #define fdesc_unlock ((int (*) __P((struct vop_unlock_args *)))nullop) 42453838Spendry #define fdesc_bmap ((int (*) __P((struct vop_bmap_args *)))fdesc_badop) 42553838Spendry #define fdesc_strategy ((int (*) __P((struct vop_strategy_args *)))fdesc_badop) 42653838Spendry #define fdesc_islocked ((int (*) __P((struct vop_islocked_args *)))nullop) 42753838Spendry #define fdesc_advlock ((int (*) __P((struct vop_advlock_args *)))fdesc_enotsupp) 42853838Spendry #define fdesc_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))fdesc_enotsupp) 42953838Spendry #define fdesc_vget ((int (*) __P((struct vop_vget_args *)))fdesc_enotsupp) 43053838Spendry #define fdesc_valloc ((int(*) __P(( \ 43153838Spendry struct vnode *pvp, \ 43253838Spendry int mode, \ 43353838Spendry struct ucred *cred, \ 43453838Spendry struct vnode **vpp))) fdesc_enotsupp) 43553838Spendry #define fdesc_truncate ((int (*) __P((struct vop_truncate_args *)))fdesc_enotsupp) 43653838Spendry #define fdesc_update ((int (*) __P((struct vop_update_args *)))fdesc_enotsupp) 43753838Spendry #define fdesc_bwrite ((int (*) __P((struct vop_bwrite_args *)))fdesc_enotsupp) 43853838Spendry 43953838Spendry int (**fdesc_vnodeop_p)(); 44053838Spendry struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = { 44153838Spendry { &vop_default_desc, vn_default_error }, 44253838Spendry { &vop_lookup_desc, fdesc_lookup }, /* lookup */ 44353838Spendry { &vop_create_desc, fdesc_create }, /* create */ 44453838Spendry { &vop_mknod_desc, fdesc_mknod }, /* mknod */ 44553838Spendry { &vop_open_desc, fdesc_open }, /* open */ 44653838Spendry { &vop_close_desc, fdesc_close }, /* close */ 44753838Spendry { &vop_access_desc, fdesc_access }, /* access */ 44853838Spendry { &vop_getattr_desc, fdesc_getattr }, /* getattr */ 44953838Spendry { &vop_setattr_desc, fdesc_setattr }, /* setattr */ 45053838Spendry { &vop_read_desc, fdesc_read }, /* read */ 45153838Spendry { &vop_write_desc, fdesc_write }, /* write */ 45253838Spendry { &vop_ioctl_desc, fdesc_ioctl }, /* ioctl */ 45353838Spendry { &vop_select_desc, fdesc_select }, /* select */ 45453838Spendry { &vop_mmap_desc, fdesc_mmap }, /* mmap */ 45553838Spendry { &vop_fsync_desc, fdesc_fsync }, /* fsync */ 45653838Spendry { &vop_seek_desc, fdesc_seek }, /* seek */ 45753838Spendry { &vop_remove_desc, fdesc_remove }, /* remove */ 45853838Spendry { &vop_link_desc, fdesc_link }, /* link */ 45953838Spendry { &vop_rename_desc, fdesc_rename }, /* rename */ 46053838Spendry { &vop_mkdir_desc, fdesc_mkdir }, /* mkdir */ 46153838Spendry { &vop_rmdir_desc, fdesc_rmdir }, /* rmdir */ 46253838Spendry { &vop_symlink_desc, fdesc_symlink }, /* symlink */ 46353838Spendry { &vop_readdir_desc, fdesc_readdir }, /* readdir */ 46453838Spendry { &vop_readlink_desc, fdesc_readlink }, /* readlink */ 46553838Spendry { &vop_abortop_desc, fdesc_abortop }, /* abortop */ 46653838Spendry { &vop_inactive_desc, fdesc_inactive }, /* inactive */ 46753838Spendry { &vop_reclaim_desc, fdesc_reclaim }, /* reclaim */ 46853838Spendry { &vop_lock_desc, fdesc_lock }, /* lock */ 46953838Spendry { &vop_unlock_desc, fdesc_unlock }, /* unlock */ 47053838Spendry { &vop_bmap_desc, fdesc_bmap }, /* bmap */ 47153838Spendry { &vop_strategy_desc, fdesc_strategy }, /* strategy */ 47253838Spendry { &vop_print_desc, fdesc_print }, /* print */ 47353838Spendry { &vop_islocked_desc, fdesc_islocked }, /* islocked */ 47453838Spendry { &vop_advlock_desc, fdesc_advlock }, /* advlock */ 47553838Spendry { &vop_blkatoff_desc, fdesc_blkatoff }, /* blkatoff */ 47653838Spendry { &vop_valloc_desc, fdesc_valloc }, /* valloc */ 47753838Spendry { &vop_vfree_desc, fdesc_vfree }, /* vfree */ 47853838Spendry { &vop_truncate_desc, fdesc_truncate }, /* truncate */ 47953838Spendry { &vop_update_desc, fdesc_update }, /* update */ 48053838Spendry { &vop_bwrite_desc, fdesc_bwrite }, /* bwrite */ 48153838Spendry { (struct vnodeop_desc*)NULL, (int(*)())NULL } 48253838Spendry }; 48353838Spendry struct vnodeopv_desc fdesc_vnodeop_opv_desc = 48453838Spendry { &fdesc_vnodeop_p, fdesc_vnodeop_entries }; 485