Don't attempt to recurse lockmgr, it doesn't like it.

This commit is contained in:
Poul-Henning Kamp 2005-09-15 21:16:43 +00:00
parent 19b2dff7b0
commit 59307b0dfe
2 changed files with 6 additions and 3 deletions

View File

@ -292,7 +292,6 @@ devfs_populate(struct devfs_mount *dm)
if (dm->dm_generation == devfs_generation)
return;
lockmgr(&dm->dm_lock, LK_UPGRADE, 0, curthread);
if (devfs_noverflow && dm->dm_overflow == NULL) {
i = devfs_noverflow * sizeof (struct devfs_dirent *);
MALLOC(dm->dm_overflow, struct devfs_dirent **, i,
@ -370,7 +369,6 @@ devfs_populate(struct devfs_mount *dm)
TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list);
}
}
lockmgr(&dm->dm_lock, LK_DOWNGRADE, 0, curthread);
}
/*

View File

@ -520,7 +520,9 @@ devfs_lookupx(struct vop_lookup_args *ap)
return (error);
}
lockmgr(&dmp->dm_lock, LK_UPGRADE, 0, curthread);
devfs_populate(dmp);
lockmgr(&dmp->dm_lock, LK_DOWNGRADE, 0, curthread);
dd = dvp->v_data;
TAILQ_FOREACH(de, &dd->de_dlist, de_list) {
if (cnp->cn_namelen != de->de_dirent->d_namlen)
@ -550,7 +552,9 @@ devfs_lookupx(struct vop_lookup_args *ap)
if (cdev == NULL)
goto notfound;
lockmgr(&dmp->dm_lock, LK_UPGRADE, 0, curthread);
devfs_populate(dmp);
lockmgr(&dmp->dm_lock, LK_DOWNGRADE, 0, curthread);
dde = devfs_itode(dmp, cdev->si_inode);
dev_rel(cdev);
@ -841,8 +845,9 @@ devfs_readdir(struct vop_readdir_args *ap)
return (EINVAL);
dmp = VFSTODEVFS(ap->a_vp->v_mount);
lockmgr(&dmp->dm_lock, LK_SHARED, 0, curthread);
lockmgr(&dmp->dm_lock, LK_EXCLUSIVE, 0, curthread);
devfs_populate(dmp);
lockmgr(&dmp->dm_lock, LK_DOWNGRADE, 0, curthread);
error = 0;
de = ap->a_vp->v_data;
off = 0;