Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_cluster.c
Show First 20 Lines • Show All 380 Lines • ▼ Show 20 Lines | cluster_rbuild(struct vnode *vp, u_quad_t filesize, daddr_t lbn, | ||||
tbp->b_blkno = blkno; | tbp->b_blkno = blkno; | ||||
if( (tbp->b_flags & B_MALLOC) || | if( (tbp->b_flags & B_MALLOC) || | ||||
((tbp->b_flags & B_VMIO) == 0) || (run <= 1) ) | ((tbp->b_flags & B_VMIO) == 0) || (run <= 1) ) | ||||
return tbp; | return tbp; | ||||
bp = uma_zalloc(cluster_pbuf_zone, M_NOWAIT); | bp = uma_zalloc(cluster_pbuf_zone, M_NOWAIT); | ||||
if (bp == NULL) | if (bp == NULL) | ||||
return tbp; | return tbp; | ||||
MPASS((bp->b_flags & B_MAXPHYS) != 0); | |||||
/* | /* | ||||
* We are synthesizing a buffer out of vm_page_t's, but | * We are synthesizing a buffer out of vm_page_t's, but | ||||
* if the block size is not page aligned then the starting | * if the block size is not page aligned then the starting | ||||
* address may not be either. Inherit the b_data offset | * address may not be either. Inherit the b_data offset | ||||
* from the original buffer. | * from the original buffer. | ||||
*/ | */ | ||||
bp->b_flags = B_ASYNC | B_CLUSTER | B_VMIO; | bp->b_flags = B_ASYNC | B_CLUSTER | B_VMIO; | ||||
▲ Show 20 Lines • Show All 469 Lines • ▼ Show 20 Lines | if (((tbp->b_flags & (B_CLUSTEROK | B_MALLOC | B_VMIO)) != | ||||
(len == 1) || | (len == 1) || | ||||
((bp = uma_zalloc(cluster_pbuf_zone, M_NOWAIT)) == NULL)) { | ((bp = uma_zalloc(cluster_pbuf_zone, M_NOWAIT)) == NULL)) { | ||||
totalwritten += tbp->b_bufsize; | totalwritten += tbp->b_bufsize; | ||||
bawrite(tbp); | bawrite(tbp); | ||||
++start_lbn; | ++start_lbn; | ||||
--len; | --len; | ||||
continue; | continue; | ||||
} | } | ||||
MPASS((bp->b_flags & B_MAXPHYS) != 0); | |||||
/* | /* | ||||
* We got a pbuf to make the cluster in. | * We got a pbuf to make the cluster in. | ||||
* so initialise it. | * so initialise it. | ||||
*/ | */ | ||||
TAILQ_INIT(&bp->b_cluster.cluster_head); | TAILQ_INIT(&bp->b_cluster.cluster_head); | ||||
bp->b_bcount = 0; | bp->b_bcount = 0; | ||||
bp->b_bufsize = 0; | bp->b_bufsize = 0; | ||||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |