diff options
Diffstat (limited to 'sys/miscfs/kernfs/kernfs_vnops.c')
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vnops.c | 397 |
1 files changed, 189 insertions, 208 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index afd30e7..108c443 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)kernfs_vnops.c 8.6 (Berkeley) 2/10/94 + * @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95 * $FreeBSD$ */ @@ -67,41 +67,44 @@ #define DIR_MODE (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) static struct kern_target { + u_char kt_type; + u_char kt_namlen; char *kt_name; void *kt_data; -#define KTT_NULL 1 -#define KTT_TIME 5 -#define KTT_INT 17 -#define KTT_STRING 31 -#define KTT_HOSTNAME 47 -#define KTT_BOOTFILE 49 -#define KTT_AVENRUN 53 - int kt_tag; - int kt_rw; - int kt_vtype; - struct vnode **kt_vp; +#define KTT_NULL 1 +#define KTT_TIME 5 +#define KTT_INT 17 +#define KTT_STRING 31 +#define KTT_HOSTNAME 47 +#define KTT_BOOTFILE 49 +#define KTT_AVENRUN 53 +#define KTT_DEVICE 71 + u_char kt_tag; + u_char kt_vtype; + mode_t kt_mode; } kern_targets[] = { /* NOTE: The name must be less than UIO_MX-16 chars in length */ - /* name data tag ro/rw type vnodep*/ - { ".", 0, KTT_NULL, VREAD, VDIR, NULL }, - { "..", 0, KTT_NULL, VREAD, VDIR, NULL }, - { "boottime", &boottime.tv_sec, KTT_INT, VREAD, VREG, NULL }, - { "copyright", copyright, KTT_STRING, VREAD, VREG, NULL }, - { "hostname", 0, KTT_HOSTNAME,VREAD|VWRITE,VREG, NULL }, - { "bootfile", 0, KTT_BOOTFILE, VREAD, VREG, NULL }, - { "hz", &hz, KTT_INT, VREAD, VREG, NULL }, - { "loadavg", 0, KTT_AVENRUN, VREAD, VREG, NULL }, - { "pagesize", &cnt.v_page_size, KTT_INT, VREAD, VREG, NULL }, - { "physmem", &physmem, KTT_INT, VREAD, VREG, NULL }, +#define N(s) sizeof(s)-1, s + /* name data tag type ro/rw */ + { DT_DIR, N("."), 0, KTT_NULL, VDIR, DIR_MODE }, + { DT_DIR, N(".."), 0, KTT_NULL, VDIR, DIR_MODE }, + { DT_REG, N("boottime"), &boottime.tv_sec, KTT_INT, VREG, READ_MODE }, + { DT_REG, N("copyright"), copyright, KTT_STRING, VREG, READ_MODE }, + { DT_REG, N("hostname"), 0, KTT_HOSTNAME, VREG, WRITE_MODE }, + { DT_REG, N("bootfile"), 0, KTT_BOOTFILE, VREG, READ_MODE }, + { DT_REG, N("hz"), &hz, KTT_INT, VREG, READ_MODE }, + { DT_REG, N("loadavg"), 0, KTT_AVENRUN, VREG, READ_MODE }, + { DT_REG, N("pagesize"), &cnt.v_page_size, KTT_INT, VREG, READ_MODE }, + { DT_REG, N("physmem"), &physmem, KTT_INT, VREG, READ_MODE }, #if 0 - { "root", 0, KTT_NULL, VREAD, VDIR, &rootdir}, - { "rootdev", 0, KTT_NULL, VREAD, VBLK, &rootvp }, - { "rrootdev", 0, KTT_NULL, VREAD, VCHR, &rrootvp}, + { DT_DIR, N("root"), 0, KTT_NULL, VDIR, DIR_MODE }, + { DT_BLK, N("rootdev"), &rootdev, KTT_DEVICE, VBLK, READ_MODE }, + { DT_CHR, N("rrootdev"), &rrootdev, KTT_DEVICE, VCHR, READ_MODE }, #endif - { "time", 0, KTT_TIME, VREAD, VREG, NULL }, - { "version", version, KTT_STRING, VREAD, VREG, NULL }, + { DT_REG, N("time"), 0, KTT_TIME, VREG, READ_MODE }, + { DT_REG, N("version"), version, KTT_STRING, VREG, READ_MODE }, +#undef N }; - static int nkern_targets = sizeof(kern_targets) / sizeof(kern_targets[0]); static int kernfs_access __P((struct vop_access_args *ap)); @@ -130,6 +133,7 @@ kernfs_xread(kt, buf, len, lenp) int len; int *lenp; { + switch (kt->kt_tag) { case KTT_TIME: { struct timeval tv; @@ -183,14 +187,12 @@ kernfs_xread(kt, buf, len, lenp) case KTT_AVENRUN: sprintf(buf, "%ld %ld %ld %ld\n", - averunnable.ldavg[0], - averunnable.ldavg[1], - averunnable.ldavg[2], - averunnable.fscale); + averunnable.ldavg[0], averunnable.ldavg[1], + averunnable.ldavg[2], averunnable.fscale); break; default: - return (EINVAL); + return (EIO); } *lenp = strlen(buf); @@ -203,15 +205,15 @@ kernfs_xwrite(kt, buf, len) char *buf; int len; { + switch (kt->kt_tag) { - case KTT_HOSTNAME: { + case KTT_HOSTNAME: /* XXX BOGUS !!! no check for the length */ if (buf[len-1] == '\n') --len; bcopy(buf, hostname, len); hostname[len] = '\0'; return (0); - } default: return (EIO); @@ -231,26 +233,32 @@ kernfs_lookup(ap) struct componentname * a_cnp; } */ *ap; { + struct componentname *cnp = ap->a_cnp; 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; + struct kern_target *kt; struct vnode *fvp; int nameiop = cnp->cn_nameiop; int error, i; - char *pname; #ifdef KERNFS_DIAGNOSTIC printf("kernfs_lookup(%x)\n", ap); printf("kernfs_lookup(dp = %x, vpp = %x, cnp = %x)\n", dvp, vpp, ap->a_cnp); -#endif - pname = cnp->cn_nameptr; -#ifdef KERNFS_DIAGNOSTIC printf("kernfs_lookup(%s)\n", pname); #endif + + *vpp = NULLVP; + + if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) + return (EROFS); + + VOP_UNLOCK(dvp, 0, p); if (cnp->cn_namelen == 1 && *pname == '.') { *vpp = dvp; VREF(dvp); - /*VOP_LOCK(dvp);*/ + vn_lock(dvp, LK_SHARED | LK_RETRY, p); return (0); } @@ -258,91 +266,58 @@ kernfs_lookup(ap) if (cnp->cn_namelen == 4 && bcmp(pname, "root", 4) == 0) { *vpp = rootdir; VREF(rootdir); - VOP_LOCK(rootdir); + vn_lock(rootdir, LK_SHARED | LK_RETRY, p) return (0); } #endif - error = ENOENT; - - for (i = 0; i < nkern_targets; i++) { - struct kern_target *kt = &kern_targets[i]; - if (cnp->cn_namelen == strlen(kt->kt_name) && - bcmp(kt->kt_name, pname, cnp->cn_namelen) == 0) { - error = 0; - break; - } + for (kt = kern_targets, i = 0; i < nkern_targets; kt++, i++) { + if (cnp->cn_namelen == kt->kt_namlen && + bcmp(kt->kt_name, pname, cnp->cn_namelen) == 0) + goto found; } #ifdef KERNFS_DIAGNOSTIC - printf("kernfs_lookup: i = %d, error = %d\n", i, error); + printf("kernfs_lookup: i = %d, failed", i); #endif - /* - * If the name wasn't found, and this is not a LOOKUP - * request, we return EOPNOTSUPP so that the initial namei() - * fails and the higher level routines will not try to call - * our VOP_* functions. - */ - if (error) { - if (nameiop != LOOKUP) - error = EOPNOTSUPP; - goto bad; - } - - /* - * DELETE requests are not supported. - */ - if (nameiop == DELETE) { - error = EOPNOTSUPP; - goto bad; - } + vn_lock(dvp, LK_SHARED | LK_RETRY, p); + return (cnp->cn_nameiop == LOOKUP ? ENOENT : EROFS); - /* - * Allow CREATE requests if the name in question can - * be written to. This allows open(name, O_RDWR | O_CREAT) - * to work. Otherwise CREATE requests are not supported. - */ - if (nameiop == CREATE && (kern_targets[i].kt_rw & VWRITE == 0)) { - error = EOPNOTSUPP; - goto bad; - } - - /* - * Check if this name has already has a vnode associated with it. - */ - if (kern_targets[i].kt_vp) { - if (*kern_targets[i].kt_vp) { - *vpp = *kern_targets[i].kt_vp; - VREF(*vpp); - VOP_LOCK(*vpp); - return (0); +found: + if (kt->kt_tag == KTT_DEVICE) { + dev_t *dp = kt->kt_data; + loop: + if (*dp == NODEV || !vfinddev(*dp, kt->kt_vtype, &fvp)) { + vn_lock(dvp, LK_SHARED | LK_RETRY, p); + return (ENOENT); } - error = ENXIO; - goto bad; + *vpp = fvp; + if (vget(fvp, LK_EXCLUSIVE, p)) + goto loop; + return (0); } #ifdef KERNFS_DIAGNOSTIC printf("kernfs_lookup: allocate new vnode\n"); #endif - error = getnewvnode(VT_KERNFS, dvp->v_mount, kernfs_vnodeop_p, &fvp); - if (error) - goto bad; - MALLOC(fvp->v_data, void *, sizeof(struct kernfs_node), M_TEMP, M_WAITOK); - VTOKERN(fvp)->kf_kt = &kern_targets[i]; - fvp->v_type = VTOKERN(fvp)->kf_kt->kt_vtype; + if (error = getnewvnode(VT_KERNFS, dvp->v_mount, kernfs_vnodeop_p, + &fvp)) { + vn_lock(dvp, LK_SHARED | LK_RETRY, p); + return (error); + } + + MALLOC(fvp->v_data, void *, sizeof(struct kernfs_node), M_TEMP, + M_WAITOK); + VTOKERN(fvp)->kf_kt = kt; + fvp->v_type = kt->kt_vtype; + vn_lock(fvp, LK_SHARED | LK_RETRY, p); *vpp = fvp; + #ifdef KERNFS_DIAGNOSTIC printf("kernfs_lookup: newvp = %x\n", fvp); #endif return (0); - -bad:; - *vpp = NULL; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_lookup: error = %d\n", error); -#endif - return (error); } static int @@ -354,22 +329,8 @@ kernfs_open(ap) struct proc *a_p; } */ *ap; { - struct vnode *vp = ap->a_vp; - - /* - * Can always open the root (modulo perms) - */ - if (vp->v_flag & VROOT) - return (0); - -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_open, mode = %x, file = %s\n", - ap->a_mode, VTOKERN(vp)->kf_kt->kt_name); -#endif - - if ((ap->a_mode & FWRITE) && !(VTOKERN(vp)->kf_kt->kt_rw & VWRITE)) - return (EOPNOTSUPP); + /* Only need to check access permissions. */ return (0); } @@ -382,33 +343,45 @@ kernfs_access(ap) struct proc *a_p; } */ *ap; { - struct vnode *vp = ap->a_vp; - struct ucred *cred = ap->a_cred; - mode_t mode = ap->a_mode; - - if (mode & VEXEC) { - if (vp->v_flag & VROOT) - return (0); - return (EACCES); - } + register struct vnode *vp = ap->a_vp; + register struct ucred *cred = ap->a_cred; + mode_t amode = ap->a_mode; + mode_t fmode = + (vp->v_flag & VROOT) ? DIR_MODE : VTOKERN(vp)->kf_kt->kt_mode; + mode_t mask = 0; + register gid_t *gp; + int i; - if (cred->cr_uid == 0) { - if ((vp->v_flag & VROOT) == 0) { - struct kern_target *kt = VTOKERN(vp)->kf_kt; + /* Some files are simply not modifiable. */ + if ((amode & VWRITE) && (fmode & (S_IWUSR|S_IWGRP|S_IWOTH)) == 0) + return (EPERM); - if ((mode & VWRITE) && !(kt->kt_rw & VWRITE)) - return (EROFS); - } + /* Root can do anything else. */ + if (cred->cr_uid == 0) return (0); - } - if (mode & VWRITE) - return (EACCES); + /* Check for group 0 (wheel) permissions. */ + for (i = 0, gp = cred->cr_groups; i < cred->cr_ngroups; i++, gp++) + if (*gp == 0) { + if (amode & VEXEC) + mask |= S_IXGRP; + if (amode & VREAD) + mask |= S_IRGRP; + if (amode & VWRITE) + mask |= S_IWGRP; + return ((fmode & mask) == mask ? 0 : EACCES); + } - return (0); + /* Otherwise, check everyone else. */ + if (amode & VEXEC) + mask |= S_IXOTH; + if (amode & VREAD) + mask |= S_IROTH; + if (amode & VWRITE) + mask |= S_IWOTH; + return ((fmode & mask) == mask ? 0 : EACCES); } - static int kernfs_getattr(ap) struct vop_getattr_args /* { @@ -420,6 +393,7 @@ kernfs_getattr(ap) { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; + struct timeval tv; int error = 0; char strbuf[KSTRING]; @@ -428,7 +402,7 @@ kernfs_getattr(ap) vap->va_uid = 0; vap->va_gid = 0; vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; - /* vap->va_qsize = 0; */ + vap->va_size = 0; vap->va_blocksize = DEV_BSIZE; { struct timeval tv; @@ -440,7 +414,6 @@ kernfs_getattr(ap) vap->va_gen = 0; vap->va_flags = 0; vap->va_rdev = 0; - /* vap->va_qbytes = 0; */ vap->va_bytes = 0; if (vp->v_flag & VROOT) { @@ -459,14 +432,13 @@ kernfs_getattr(ap) printf("kernfs_getattr: stat target %s\n", kt->kt_name); #endif vap->va_type = kt->kt_vtype; - vap->va_mode = (kt->kt_rw & VWRITE ? WRITE_MODE : READ_MODE); + vap->va_mode = kt->kt_mode; vap->va_nlink = 1; - vap->va_fileid = 3 + (kt - kern_targets) / sizeof(*kt); + vap->va_fileid = 1 + (kt - kern_targets) / sizeof(*kt); error = kernfs_xread(kt, strbuf, sizeof(strbuf), &nbytes); vap->va_size = nbytes; } - vp->v_type = vap->va_type; #ifdef KERNFS_DIAGNOSTIC printf("kernfs_getattr: return error %d\n", error); #endif @@ -509,7 +481,7 @@ kernfs_read(ap) int error, len; char *cp; - if (vp->v_flag & VROOT) + if (vp->v_type == VDIR) return (EOPNOTSUPP); kt = VTOKERN(vp)->kf_kt; @@ -519,12 +491,11 @@ kernfs_read(ap) #endif len = 0; - error = kernfs_xread(kt, strbuf, sizeof(strbuf), &len); - if (error) + if (error = kernfs_xread(kt, strbuf, sizeof(strbuf), &len)) return (error); - cp = strbuf + off; - len -= off; - return (uiomove(cp, len, uio)); + if (len <= off) + return (0); + return (uiomove(&strbuf[off], len - off, uio)); } static int @@ -542,8 +513,8 @@ kernfs_write(ap) int error, xlen; char strbuf[KSTRING]; - if (vp->v_flag & VROOT) - return (0); + if (vp->v_type == VDIR) + return (EOPNOTSUPP); kt = VTOKERN(vp)->kf_kt; @@ -551,8 +522,7 @@ kernfs_write(ap) return (EINVAL); xlen = min(uio->uio_resid, KSTRING-1); - error = uiomove(strbuf, xlen, uio); - if (error) + if (error = uiomove(strbuf, xlen, uio)) return (error); if (uio->uio_resid != 0) @@ -563,33 +533,52 @@ kernfs_write(ap) return (kernfs_xwrite(kt, strbuf, xlen)); } - static int kernfs_readdir(ap) struct vop_readdir_args /* { struct vnode *a_vp; struct uio *a_uio; struct ucred *a_cred; + int *a_eofflag; + u_long *a_cookies; + int a_ncookies; } */ *ap; { + int error, i; struct uio *uio = ap->a_uio; - int i; - int error; + struct kern_target *kt; + struct dirent d; + + if (ap->a_vp->v_type != VDIR) + return (ENOTDIR); + + /* + * We don't allow exporting kernfs mounts, and currently local + * requests do not need cookies. + */ + if (ap->a_ncookies != NULL) + panic("kernfs_readdir: not hungry"); i = uio->uio_offset / UIO_MX; error = 0; - while (uio->uio_resid > 0 && i < nkern_targets) { - struct dirent d; + for (kt = &kern_targets[i]; + uio->uio_resid >= UIO_MX && i < nkern_targets; kt++, i++) { struct dirent *dp = &d; - struct kern_target *kt = &kern_targets[i]; #ifdef KERNFS_DIAGNOSTIC printf("kernfs_readdir: i = %d\n", i); #endif - bzero((caddr_t) dp, UIO_MX); + if (kt->kt_tag == KTT_DEVICE) { + dev_t *dp = kt->kt_data; + struct vnode *fvp; + + if (*dp == NODEV || !vfinddev(*dp, kt->kt_vtype, &fvp)) + continue; + } - dp->d_namlen = strlen(kt->kt_name); - bcopy(kt->kt_name, dp->d_name, dp->d_namlen+1); + bzero((caddr_t)dp, UIO_MX); + dp->d_namlen = kt->kt_namlen; + bcopy(kt->kt_name, dp->d_name, kt->kt_namlen+1); #ifdef KERNFS_DIAGNOSTIC printf("kernfs_readdir: name = %s, len = %d\n", @@ -600,14 +589,12 @@ kernfs_readdir(ap) */ dp->d_reclen = UIO_MX; dp->d_fileno = i + 3; - dp->d_type = DT_UNKNOWN; /* XXX */ + dp->d_type = kt->kt_type; /* * And ship to userland */ - error = uiomove((caddr_t) dp, UIO_MX, uio); - if (error) + if (error = uiomove((caddr_t)dp, UIO_MX, uio)) break; - i++; } uio->uio_offset = i * UIO_MX; @@ -619,18 +606,20 @@ static int kernfs_inactive(ap) struct vop_inactive_args /* { struct vnode *a_vp; + struct proc *a_p; } */ *ap; { struct vnode *vp = ap->a_vp; +#ifdef KERNFS_DIAGNOSTIC + printf("kernfs_inactive(%x)\n", vp); +#endif /* * Clear out the v_type field to avoid * nasty things happening in vgone(). */ + VOP_UNLOCK(vp, 0, ap->a_p); vp->v_type = VNON; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_inactive(%x)\n", vp); -#endif return (0); } @@ -641,6 +630,7 @@ kernfs_reclaim(ap) } */ *ap; { struct vnode *vp = ap->a_vp; + #ifdef KERNFS_DIAGNOSTIC printf("kernfs_reclaim(%x)\n", vp); #endif @@ -717,16 +707,6 @@ kernfs_vfree(ap) } /* - * Kernfs vnode unsupported operation - */ -static int -kernfs_enotsupp() -{ - - return (EOPNOTSUPP); -} - -/* * Kernfs "should never get here" operation */ static int @@ -735,42 +715,42 @@ kernfs_badop() return (EIO); } -#define kernfs_create ((int (*) __P((struct vop_create_args *)))kernfs_enotsupp) -#define kernfs_mknod ((int (*) __P((struct vop_mknod_args *)))kernfs_enotsupp) +#define kernfs_create ((int (*) __P((struct vop_create_args *)))eopnotsupp) +#define kernfs_mknod ((int (*) __P((struct vop_mknod_args *)))eopnotsupp) #define kernfs_close ((int (*) __P((struct vop_close_args *)))nullop) -#define kernfs_ioctl ((int (*) __P((struct vop_ioctl_args *)))kernfs_enotsupp) -#define kernfs_select ((int (*) __P((struct vop_select_args *)))kernfs_enotsupp) -#define kernfs_mmap ((int (*) __P((struct vop_mmap_args *)))kernfs_enotsupp) +#define kernfs_ioctl ((int (*) __P((struct vop_ioctl_args *)))eopnotsupp) +#define kernfs_select ((int (*) __P((struct vop_select_args *)))eopnotsupp) +#define kernfs_revoke vop_revoke +#define kernfs_mmap ((int (*) __P((struct vop_mmap_args *)))eopnotsupp) #define kernfs_fsync ((int (*) __P((struct vop_fsync_args *)))nullop) #define kernfs_seek ((int (*) __P((struct vop_seek_args *)))nullop) -#define kernfs_remove ((int (*) __P((struct vop_remove_args *)))kernfs_enotsupp) -#define kernfs_link ((int (*) __P((struct vop_link_args *)))kernfs_enotsupp) -#define kernfs_rename ((int (*) __P((struct vop_rename_args *)))kernfs_enotsupp) -#define kernfs_mkdir ((int (*) __P((struct vop_mkdir_args *)))kernfs_enotsupp) -#define kernfs_rmdir ((int (*) __P((struct vop_rmdir_args *)))kernfs_enotsupp) -#define kernfs_symlink ((int (*) __P((struct vop_symlink_args *)))kernfs_enotsupp) -#define kernfs_readlink \ - ((int (*) __P((struct vop_readlink_args *)))kernfs_enotsupp) +#define kernfs_remove ((int (*) __P((struct vop_remove_args *)))eopnotsupp) +#define kernfs_link ((int (*) __P((struct vop_link_args *)))eopnotsupp) +#define kernfs_rename ((int (*) __P((struct vop_rename_args *)))eopnotsupp) +#define kernfs_mkdir ((int (*) __P((struct vop_mkdir_args *)))eopnotsupp) +#define kernfs_rmdir ((int (*) __P((struct vop_rmdir_args *)))eopnotsupp) +#define kernfs_symlink ((int (*) __P((struct vop_symlink_args *)))eopnotsupp) +#define kernfs_readlink ((int (*) __P((struct vop_readlink_args *)))eopnotsupp) #define kernfs_abortop ((int (*) __P((struct vop_abortop_args *)))nullop) -#define kernfs_lock ((int (*) __P((struct vop_lock_args *)))nullop) -#define kernfs_unlock ((int (*) __P((struct vop_unlock_args *)))nullop) +#define kernfs_lock ((int (*) __P((struct vop_lock_args *)))vop_nolock) +#define kernfs_unlock ((int (*) __P((struct vop_unlock_args *)))vop_nounlock) #define kernfs_bmap ((int (*) __P((struct vop_bmap_args *)))kernfs_badop) -#define kernfs_strategy ((int (*) __P((struct vop_strategy_args *)))kernfs_badop) -#define kernfs_islocked ((int (*) __P((struct vop_islocked_args *)))nullop) -#define kernfs_advlock ((int (*) __P((struct vop_advlock_args *)))kernfs_enotsupp) -#define kernfs_blkatoff \ - ((int (*) __P((struct vop_blkatoff_args *)))kernfs_enotsupp) +#define kernfs_strategy \ + ((int (*) __P((struct vop_strategy_args *)))kernfs_badop) +#define kernfs_islocked \ + ((int (*) __P((struct vop_islocked_args *)))vop_noislocked) +#define kernfs_advlock ((int (*) __P((struct vop_advlock_args *)))eopnotsupp) +#define kernfs_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))eopnotsupp) #define kernfs_valloc ((int(*) __P(( \ struct vnode *pvp, \ int mode, \ struct ucred *cred, \ - struct vnode **vpp))) kernfs_enotsupp) -#define kernfs_truncate \ - ((int (*) __P((struct vop_truncate_args *)))kernfs_enotsupp) -#define kernfs_update ((int (*) __P((struct vop_update_args *)))kernfs_enotsupp) -#define kernfs_bwrite ((int (*) __P((struct vop_bwrite_args *)))kernfs_enotsupp) + struct vnode **vpp))) eopnotsupp) +#define kernfs_truncate ((int (*) __P((struct vop_truncate_args *)))eopnotsupp) +#define kernfs_update ((int (*) __P((struct vop_update_args *)))eopnotsupp) +#define kernfs_bwrite ((int (*) __P((struct vop_bwrite_args *)))eopnotsupp) -vop_t **kernfs_vnodeop_p; +vop_t **kernfs_vnodeop_p; static struct vnodeopv_entry_desc kernfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)kernfs_lookup }, /* lookup */ @@ -785,6 +765,7 @@ static struct vnodeopv_entry_desc kernfs_vnodeop_entries[] = { { &vop_write_desc, (vop_t *)kernfs_write }, /* write */ { &vop_ioctl_desc, (vop_t *)kernfs_ioctl }, /* ioctl */ { &vop_select_desc, (vop_t *)kernfs_select }, /* select */ + { &vop_revoke_desc, (vop_t *)kernfs_revoke }, /* revoke */ { &vop_mmap_desc, (vop_t *)kernfs_mmap }, /* mmap */ { &vop_fsync_desc, (vop_t *)kernfs_fsync }, /* fsync */ { &vop_seek_desc, (vop_t *)kernfs_seek }, /* seek */ |