windows-buf-more-clean-vnode-speedups-20080301

LICENSE MIT

do not call buf_CleanAsync if you know the buffer isn't dirty
This commit is contained in:
Jeffrey Altman 2008-03-01 18:56:23 +00:00
parent 7083ceec5c
commit b47407ae72

View File

@ -1605,18 +1605,20 @@ long buf_CleanVnode(struct cm_scache *scp, cm_user_t *userp, cm_req_t *reqp)
/* clean buffer synchronously */ /* clean buffer synchronously */
if (cm_FidCmp(&bp->fid, &scp->fid) == 0) { if (cm_FidCmp(&bp->fid, &scp->fid) == 0) {
lock_ObtainMutex(&bp->mx); lock_ObtainMutex(&bp->mx);
if (userp) { if (bp->flags & CM_BUF_DIRTY) {
cm_HoldUser(userp); if (userp) {
if (bp->userp) cm_HoldUser(userp);
cm_ReleaseUser(bp->userp); if (bp->userp)
bp->userp = userp; cm_ReleaseUser(bp->userp);
} bp->userp = userp;
wasDirty = buf_CleanAsyncLocked(bp, reqp); }
buf_CleanWait(scp, bp, TRUE); wasDirty = buf_CleanAsyncLocked(bp, reqp);
if (bp->flags & CM_BUF_ERROR) { buf_CleanWait(scp, bp, TRUE);
code = bp->error; if (bp->flags & CM_BUF_ERROR) {
if (code == 0) code = bp->error;
code = -1; if (code == 0)
code = -1;
}
} }
lock_ReleaseMutex(&bp->mx); lock_ReleaseMutex(&bp->mx);
} }