- Further simplify ffs_sync(). The vnode lock is required for UFS_UPDATE()
so make the code slightly more uniform. The vnode lock is acquired in all cases and now the only difference between VCHR and other is we call UFS_UPDATE instead of VOP_FSYNC().
This commit is contained in:
parent
cffa37d466
commit
ab1f917b53
@ -1160,26 +1160,22 @@ ffs_sync(mp, waitfor, cred, td)
|
||||
continue;
|
||||
}
|
||||
mtx_unlock(&mntvnode_mtx);
|
||||
if ((error = vget(vp, lockreq, td)) != 0) {
|
||||
mtx_lock(&mntvnode_mtx);
|
||||
if (error == ENOENT)
|
||||
goto loop;
|
||||
continue;
|
||||
}
|
||||
if (vp->v_type != VCHR) {
|
||||
if ((error = vget(vp, lockreq, td)) != 0) {
|
||||
mtx_lock(&mntvnode_mtx);
|
||||
if (error == ENOENT)
|
||||
goto loop;
|
||||
continue;
|
||||
}
|
||||
if ((error = VOP_FSYNC(vp, cred, waitfor, td)) != 0)
|
||||
allerror = error;
|
||||
VOP_UNLOCK(vp, 0, td);
|
||||
mtx_lock(&mntvnode_mtx);
|
||||
if (TAILQ_NEXT(vp, v_nmntvnodes) != nvp)
|
||||
restart = 1;
|
||||
vrele(vp);
|
||||
} else {
|
||||
VI_UNLOCK(vp);
|
||||
/* XXX UFS_UPDATE is not protected by any lock. */
|
||||
} else
|
||||
UFS_UPDATE(vp, wait);
|
||||
mtx_lock(&mntvnode_mtx);
|
||||
}
|
||||
VOP_UNLOCK(vp, 0, td);
|
||||
mtx_lock(&mntvnode_mtx);
|
||||
if (TAILQ_NEXT(vp, v_nmntvnodes) != nvp)
|
||||
restart = 1;
|
||||
vrele(vp);
|
||||
if (restart)
|
||||
goto loop;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user