Remove unused second arg to vfinddev().

Don't call addaliasu() on VBLK nodes.
This commit is contained in:
Poul-Henning Kamp 2004-03-11 16:33:11 +00:00
parent 5faeb9c682
commit 651b11eaf2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126851
8 changed files with 25 additions and 18 deletions

View File

@ -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

View File

@ -866,8 +866,10 @@ 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;

View File

@ -1750,8 +1750,10 @@ 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;

View File

@ -1750,8 +1750,10 @@ 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;

View File

@ -866,8 +866,10 @@ 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;

View File

@ -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);

View File

@ -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;

View File

@ -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);