Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfsserver/nfs_nfsdport.c
Show First 20 Lines • Show All 1,670 Lines • ▼ Show 20 Lines | if (cnt == 0 || cnt > MAX_COMMIT_COUNT || | ||||
if (vp->v_object && vm_object_mightbedirty(vp->v_object)) { | if (vp->v_object && vm_object_mightbedirty(vp->v_object)) { | ||||
VM_OBJECT_WLOCK(vp->v_object); | VM_OBJECT_WLOCK(vp->v_object); | ||||
vm_object_page_clean(vp->v_object, off, off + cnt, | vm_object_page_clean(vp->v_object, off, off + cnt, | ||||
OBJPC_SYNC); | OBJPC_SYNC); | ||||
VM_OBJECT_WUNLOCK(vp->v_object); | VM_OBJECT_WUNLOCK(vp->v_object); | ||||
} | } | ||||
bo = &vp->v_bufobj; | bo = vp2bo(vp); | ||||
BO_LOCK(bo); | BO_LOCK(bo); | ||||
while (cnt > 0) { | while (cnt > 0) { | ||||
struct buf *bp; | struct buf *bp; | ||||
/* | /* | ||||
* If we have a buffer and it is marked B_DELWRI we | * If we have a buffer and it is marked B_DELWRI we | ||||
* have to lock and write it. Otherwise the prior | * have to lock and write it. Otherwise the prior | ||||
* write is assumed to have already been committed. | * write is assumed to have already been committed. | ||||
* | * | ||||
* gbincore() can return invalid buffers now so we | * gbincore() can return invalid buffers now so we | ||||
* have to check that bit as well (though B_DELWRI | * have to check that bit as well (though B_DELWRI | ||||
* should not be set if B_INVAL is set there could be | * should not be set if B_INVAL is set there could be | ||||
* a race here since we haven't locked the buffer). | * a race here since we haven't locked the buffer). | ||||
*/ | */ | ||||
if ((bp = gbincore(&vp->v_bufobj, lblkno)) != NULL) { | if ((bp = gbincore(bo, lblkno)) != NULL) { | ||||
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | | if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | | ||||
LK_INTERLOCK, BO_LOCKPTR(bo)) == ENOLCK) { | LK_INTERLOCK, BO_LOCKPTR(bo)) == ENOLCK) { | ||||
BO_LOCK(bo); | BO_LOCK(bo); | ||||
continue; /* retry */ | continue; /* retry */ | ||||
} | } | ||||
if ((bp->b_flags & (B_DELWRI|B_INVAL)) == | if ((bp->b_flags & (B_DELWRI|B_INVAL)) == | ||||
B_DELWRI) { | B_DELWRI) { | ||||
bremfree(bp); | bremfree(bp); | ||||
▲ Show 20 Lines • Show All 5,027 Lines • Show Last 20 Lines |