diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/linux/linux_stats.c | 2 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 4 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_vnops.c | 4 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vnops.c | 4 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_vfsops.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 16 | ||||
-rw-r--r-- | sys/nfsclient/nfs_subs.c | 7 | ||||
-rw-r--r-- | sys/sys/vnode.h | 2 |
8 files changed, 25 insertions, 18 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 9d61de2..eaf6da0 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -366,7 +366,7 @@ linux_ustat(struct thread *td, struct linux_ustat_args *args) * ustat in that case. */ dev = udev2dev(makeudev(args->dev >> 8, args->dev & 0xFF)); - if (dev != NODEV && vfinddev(dev, VCHR, &vp)) { + if (dev != NODEV && vfinddev(dev, &vp)) { if (vp->v_mount == NULL) return (EINVAL); #ifdef MAC diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 0f8f3c9..2a19ef1 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -866,9 +866,11 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir) case VFIFO: vp->v_op = cd9660_fifoop_p; break; - case VCHR: case VBLK: vp->v_op = cd9660_specop_p; + break; + case VCHR: + vp->v_op = cd9660_specop_p; vp = addaliasu(vp, ip->inode.iso_rdev); ip->i_vnode = vp; break; diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index f08c1ad..d7e1659 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -1750,9 +1750,11 @@ ext2_vinit(mntp, specops, fifoops, vpp) vp = *vpp; ip = VTOI(vp); switch(vp->v_type = IFTOVT(ip->i_mode)) { - case VCHR: case VBLK: vp->v_op = specops; + break; + case VCHR: + vp->v_op = specops; vp = addaliasu(vp, ip->i_rdev); ip->i_vnode = vp; break; diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index f08c1ad..d7e1659 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -1750,9 +1750,11 @@ ext2_vinit(mntp, specops, fifoops, vpp) vp = *vpp; ip = VTOI(vp); switch(vp->v_type = IFTOVT(ip->i_mode)) { - case VCHR: case VBLK: vp->v_op = specops; + break; + case VCHR: + vp->v_op = specops; vp = addaliasu(vp, ip->i_rdev); ip->i_vnode = vp; break; diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index 0f8f3c9..2a19ef1 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -866,9 +866,11 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir) case VFIFO: vp->v_op = cd9660_fifoop_p; break; - case VCHR: case VBLK: vp->v_op = cd9660_specop_p; + break; + case VCHR: + vp->v_op = cd9660_specop_p; vp = addaliasu(vp, ip->inode.iso_rdev); ip->i_vnode = vp; break; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 0a6f4f9..2849cf9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1756,8 +1756,9 @@ bdevvp(dev, vpp) *vpp = NULLVP; return (ENXIO); } - if (vfinddev(dev, VCHR, vpp)) + if (vfinddev(dev, vpp)) return (0); + error = getnewvnode("none", (struct mount *)0, spec_vnodeop_p, &nvp); if (error) { *vpp = NULLVP; @@ -1813,7 +1814,7 @@ addaliasu(nvp, nvp_rdev) * discard the newly created vnode rather than leaving the * bdevvp vnode lying around with no associated filesystem. */ - if (vfinddev(dev, nvp->v_type, &ovp) == 0 || ovp->v_data != NULL) { + if (vfinddev(dev, &ovp) == 0 || ovp->v_data != NULL) { addalias(nvp, dev); return (nvp); } @@ -2626,20 +2627,17 @@ vgonel(vp, td) * Lookup a vnode by device number. */ int -vfinddev(dev, type, vpp) +vfinddev(dev, vpp) dev_t dev; - enum vtype type; struct vnode **vpp; { struct vnode *vp; mtx_lock(&spechash_mtx); SLIST_FOREACH(vp, &dev->si_hlist, v_specnext) { - if (type == vp->v_type) { - *vpp = vp; - mtx_unlock(&spechash_mtx); - return (1); - } + *vpp = vp; + mtx_unlock(&spechash_mtx); + return (1); } mtx_unlock(&spechash_mtx); return (0); diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index 96f0405..b9acf1e 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -528,10 +528,11 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, np = VTONFS(vp); if (vp->v_type != vtyp) { vp->v_type = vtyp; - if (vp->v_type == VFIFO) { + if (vp->v_type == VFIFO) vp->v_op = fifo_nfsnodeop_p; - } - if (vp->v_type == VCHR || vp->v_type == VBLK) { + else if (vp->v_type == VBLK) + vp->v_op = spec_nfsnodeop_p; + else if (vp->v_type == VCHR) { vp->v_op = spec_nfsnodeop_p; vp = addaliasu(vp, rdev); np->n_vnode = vp; diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 91319ed..4079adf 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -629,7 +629,7 @@ void vattr_null(struct vattr *vap); int vcount(struct vnode *vp); void vdrop(struct vnode *); void vdropl(struct vnode *); -int vfinddev(dev_t dev, enum vtype type, struct vnode **vpp); +int vfinddev(dev_t dev, struct vnode **vpp); void vfs_add_vnodeops(const void *); void vfs_rm_vnodeops(const void *); int vflush(struct mount *mp, int rootrefs, int flags); |