diff options
author | kuriyama <kuriyama@FreeBSD.org> | 2004-02-12 08:52:08 +0000 |
---|---|---|
committer | kuriyama <kuriyama@FreeBSD.org> | 2004-02-12 08:52:08 +0000 |
commit | d9ccee2813368cdf8628e80bf3e4569d946f8125 (patch) | |
tree | 5efa5bf4905f86300810bb3472f5a9d60838c13b /sys/ufs | |
parent | 840feb292646f850c316abe74dfc20bf197e0032 (diff) | |
download | FreeBSD-src-d9ccee2813368cdf8628e80bf3e4569d946f8125.zip FreeBSD-src-d9ccee2813368cdf8628e80bf3e4569d946f8125.tar.gz |
Reverse lock order by using local variable. This will shut up "acquiring
duplicate lock of same type" message.
Reviewed by: mckusick
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_snapshot.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 8a4d3b4..9436d1b 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -488,9 +488,10 @@ loop: 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; |