1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-11 09:50:12 +00:00

Reduce the locking activity by epsilon by checking VNON condition before

releasing the mountlock.
This commit is contained in:
Poul-Henning Kamp 2004-10-28 08:22:11 +00:00
parent 570a7ddaa3
commit f00f5d71c2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137008
3 changed files with 9 additions and 12 deletions

View File

@ -845,17 +845,16 @@ msdosfs_sync(mp, waitfor, cred, td)
loop:
MNT_VNODE_FOREACH(vp, mp, nvp) {
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
if (vp->v_type == VNON || (vp->v_iflag & VI_XLOCK)) {
VI_UNLOCK(vp);
continue;
}
MNT_IUNLOCK(mp);
dep = VTODE(vp);
if (vp->v_type == VNON ||
((dep->de_flag &
if ((dep->de_flag &
(DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0 &&
(vp->v_bufobj.bo_dirty.bv_cnt == 0 ||
waitfor == MNT_LAZY))) {
waitfor == MNT_LAZY)) {
VI_UNLOCK(vp);
MNT_ILOCK(mp);
continue;

View File

@ -922,17 +922,16 @@ ext2_sync(mp, waitfor, cred, td)
loop:
MNT_VNODE_FOREACH(vp, mp, nvp) {
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
if (vp->v_type == VNON || (vp->v_iflag & VI_XLOCK)) {
VI_UNLOCK(vp);
continue;
}
MNT_IUNLOCK(mp);
ip = VTOI(vp);
if (vp->v_type == VNON ||
((ip->i_flag &
if ((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
(vp->v_bufobj.bo_dirty.bv_cnt == 0 ||
waitfor == MNT_LAZY))) {
waitfor == MNT_LAZY)) {
VI_UNLOCK(vp);
MNT_ILOCK(mp);
continue;

View File

@ -922,17 +922,16 @@ ext2_sync(mp, waitfor, cred, td)
loop:
MNT_VNODE_FOREACH(vp, mp, nvp) {
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
if (vp->v_type == VNON || (vp->v_iflag & VI_XLOCK)) {
VI_UNLOCK(vp);
continue;
}
MNT_IUNLOCK(mp);
ip = VTOI(vp);
if (vp->v_type == VNON ||
((ip->i_flag &
if ((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
(vp->v_bufobj.bo_dirty.bv_cnt == 0 ||
waitfor == MNT_LAZY))) {
waitfor == MNT_LAZY)) {
VI_UNLOCK(vp);
MNT_ILOCK(mp);
continue;