Reverse lock order by using local variable. This will shut up "acquiring

duplicate lock of same type" message.

Reviewed by:	mckusick
This commit is contained in:
Jun Kuriyama 2004-02-12 08:52:08 +00:00
parent cd54ef88cb
commit 5580f04ab0

View File

@ -488,9 +488,10 @@ ffs_snapshot(mp, snapfile)
VI_LOCK(devvp);
snaphead = &devvp->v_rdev->si_snapshots;
if ((xp = TAILQ_FIRST(snaphead)) != NULL) {
VI_LOCK(vp);
vp->v_vnlock = ITOV(xp)->v_vnlock;
struct lock *lkp = ITOV(xp)->v_vnlock;
VI_UNLOCK(devvp);
VI_LOCK(vp);
vp->v_vnlock = lkp;
} else {
struct lock *lkp;
@ -1793,9 +1794,10 @@ ffs_snapshot_mount(mp)
*/
VI_LOCK(devvp);
if ((xp = TAILQ_FIRST(snaphead)) != NULL) {
VI_LOCK(vp);
vp->v_vnlock = ITOV(xp)->v_vnlock;
struct lock *lkp = ITOV(xp)->v_vnlock;
VI_UNLOCK(devvp);
VI_LOCK(vp);
vp->v_vnlock = lkp;
} else {
struct lock *lkp;