Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_cluster.c
Show First 20 Lines • Show All 362 Lines • ▼ Show 20 Lines | cluster_rbuild(struct vnode *vp, u_quad_t filesize, daddr_t lbn, | ||||
} else { | } else { | ||||
tbp = getblk(vp, lbn, size, 0, 0, gbflags); | tbp = getblk(vp, lbn, size, 0, 0, gbflags); | ||||
if (tbp->b_flags & B_CACHE) | if (tbp->b_flags & B_CACHE) | ||||
return tbp; | return tbp; | ||||
tbp->b_flags |= B_ASYNC | B_RAM; | tbp->b_flags |= B_ASYNC | B_RAM; | ||||
tbp->b_iocmd = BIO_READ; | tbp->b_iocmd = BIO_READ; | ||||
} | } | ||||
tbp->b_blkno = blkno; | tbp->b_blkno = blkno; | ||||
if( (tbp->b_flags & B_MALLOC) || | if ( ((tbp->b_flags & B_VMIO) == 0) || (run <= 1) ) | ||||
((tbp->b_flags & B_VMIO) == 0) || (run <= 1) ) | |||||
return tbp; | return tbp; | ||||
bp = trypbuf(&cluster_pbuf_freecnt); | bp = trypbuf(&cluster_pbuf_freecnt); | ||||
if (bp == NULL) | if (bp == NULL) | ||||
return tbp; | return tbp; | ||||
/* | /* | ||||
* We are synthesizing a buffer out of vm_page_t's, but | * We are synthesizing a buffer out of vm_page_t's, but | ||||
▲ Show 20 Lines • Show All 465 Lines • ▼ Show 20 Lines | while (len > 0) { | ||||
/* | /* | ||||
* 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 | ||||
* up if the cluster was terminated prematurely--too much | * up if the cluster was terminated prematurely--too much | ||||
* hassle. | * hassle. | ||||
*/ | */ | ||||
if (((tbp->b_flags & (B_CLUSTEROK | B_MALLOC | B_VMIO)) != | if (((tbp->b_flags & (B_CLUSTEROK | B_VMIO)) != | ||||
(B_CLUSTEROK | B_VMIO)) || | (B_CLUSTEROK | B_VMIO)) || | ||||
(tbp->b_bcount != tbp->b_bufsize) || | (tbp->b_bcount != tbp->b_bufsize) || | ||||
(tbp->b_bcount != size) || | (tbp->b_bcount != size) || | ||||
(len == 1) || | (len == 1) || | ||||
((bp = (vp->v_vflag & VV_MD) != 0 ? | ((bp = (vp->v_vflag & VV_MD) != 0 ? | ||||
trypbuf(&cluster_pbuf_freecnt) : | trypbuf(&cluster_pbuf_freecnt) : | ||||
getpbuf(&cluster_pbuf_freecnt)) == NULL)) { | getpbuf(&cluster_pbuf_freecnt)) == NULL)) { | ||||
totalwritten += tbp->b_bufsize; | totalwritten += tbp->b_bufsize; | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |