Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_cluster.c
Show First 20 Lines • Show All 830 Lines • ▼ Show 20 Lines | if (BUF_LOCK(tbp, | ||||
continue; | continue; | ||||
} | } | ||||
if ((tbp->b_flags & (B_INVAL | B_DELWRI)) != B_DELWRI) { | if ((tbp->b_flags & (B_INVAL | B_DELWRI)) != B_DELWRI) { | ||||
BUF_UNLOCK(tbp); | BUF_UNLOCK(tbp); | ||||
++start_lbn; | ++start_lbn; | ||||
--len; | --len; | ||||
continue; | continue; | ||||
} | } | ||||
if (tbp->b_pin_count > 0) { | |||||
BUF_UNLOCK(tbp); | |||||
++start_lbn; | |||||
--len; | |||||
continue; | |||||
} | |||||
bremfree(tbp); | bremfree(tbp); | ||||
tbp->b_flags &= ~B_DONE; | tbp->b_flags &= ~B_DONE; | ||||
/* | /* | ||||
* Extra memory in the buffer, punt on this buffer. | * Extra memory in the buffer, punt on this buffer. | ||||
* XXX we could handle this in most cases, but we would | * XXX we could handle this in most cases, but we would | ||||
* have to push the extra memory down to after our max | * have to push the extra memory down to after our max | ||||
* possible cluster size and then potentially pull it back | * possible cluster size and then potentially pull it back | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | for (i = 0; i < len; ++i, ++start_lbn) { | ||||
* would make sense with regard to pages | * would make sense with regard to pages | ||||
* and would not be too large | * and would not be too large | ||||
*/ | */ | ||||
if ((tbp->b_bcount != size) || | if ((tbp->b_bcount != size) || | ||||
((bp->b_blkno + (dbsize * i)) != | ((bp->b_blkno + (dbsize * i)) != | ||||
tbp->b_blkno) || | tbp->b_blkno) || | ||||
((tbp->b_npages + bp->b_npages) > | ((tbp->b_npages + bp->b_npages) > | ||||
(vp->v_mount->mnt_iosize_max / PAGE_SIZE))) { | (vp->v_mount->mnt_iosize_max / PAGE_SIZE))) { | ||||
BUF_UNLOCK(tbp); | |||||
break; | |||||
} | |||||
/* | |||||
* Do not pull in pinned buffers. | |||||
*/ | |||||
if (tbp->b_pin_count > 0) { | |||||
BUF_UNLOCK(tbp); | BUF_UNLOCK(tbp); | ||||
break; | break; | ||||
} | } | ||||
/* | /* | ||||
* Ok, it's passed all the tests, | * Ok, it's passed all the tests, | ||||
* so remove it from the free list | * so remove it from the free list | ||||
* and mark it busy. We will use it. | * and mark it busy. We will use it. | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |