Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_bio.c
Show First 20 Lines • Show All 2,319 Lines • ▼ Show 20 Lines | #endif /* RACCT */ | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
bufbdflush(struct bufobj *bo, struct buf *bp) | bufbdflush(struct bufobj *bo, struct buf *bp) | ||||
{ | { | ||||
struct buf *nbp; | struct buf *nbp; | ||||
struct bufdomain *bd; | |||||
if (bo->bo_dirty.bv_cnt > dirtybufthresh + 10) { | bd = &bdomain[bo->bo_domain]; | ||||
if (bo->bo_dirty.bv_cnt > bd->bd_dirtybufthresh + 10) { | |||||
(void) VOP_FSYNC(bp->b_vp, MNT_NOWAIT, curthread); | (void) VOP_FSYNC(bp->b_vp, MNT_NOWAIT, curthread); | ||||
altbufferflushes++; | altbufferflushes++; | ||||
} else if (bo->bo_dirty.bv_cnt > dirtybufthresh) { | } else if (bo->bo_dirty.bv_cnt > bd->bd_dirtybufthresh) { | ||||
BO_LOCK(bo); | BO_LOCK(bo); | ||||
/* | /* | ||||
* Try to find a buffer to flush. | * Try to find a buffer to flush. | ||||
*/ | */ | ||||
TAILQ_FOREACH(nbp, &bo->bo_dirty.bv_hd, b_bobufs) { | TAILQ_FOREACH(nbp, &bo->bo_dirty.bv_hd, b_bobufs) { | ||||
if ((nbp->b_vflags & BV_BKGRDINPROG) || | if ((nbp->b_vflags & BV_BKGRDINPROG) || | ||||
BUF_LOCK(nbp, | BUF_LOCK(nbp, | ||||
LK_EXCLUSIVE | LK_NOWAIT, NULL)) | LK_EXCLUSIVE | LK_NOWAIT, NULL)) | ||||
▲ Show 20 Lines • Show All 3,188 Lines • Show Last 20 Lines |