FreeBSD/sys/kern/vfs_bio.c
/*
 * Truncate the backing store for a non-vmio buffer.
 */
Truncate the backing store for a non-vmio buffer.
Truncate the backing store for a non - vmio buffer .
static void
vfs_nonvmio_truncate(struct buf *bp, int newbsize)
{
	if (bp->b_flags & B_MALLOC) {
		if (newbsize == 0) {
			bufmallocadjust(bp, 0);
			free(bp->b_data, M_BIOBUF);
			bp->b_data = bp->b_kvabase;
			bp->b_flags &= ~B_MALLOC;
		}
		return;
	}
	vm_hold_free_pages(bp, newbsize);
	bufspace_adjust(bp, newbsize);
}
static void vfs_nonvmio_truncate ( struct buf * bp , int newbsize ) { if ( bp -> b_flags & B_MALLOC ) { if ( newbsize == 0 ) { bufmallocadjust ( bp , 0 ) ; free ( bp -> b_data , M_BIOBUF ) ; bp -> b_data = bp -> b_kvabase ; bp -> b_flags &= ~ B_MALLOC ; } return ; } vm_hold_free_pages ( bp , newbsize ) ; bufspace_adjust ( bp , newbsize ) ; }
Truncate the backing store for a non-vmio buffer.
Truncate the backing store for a non - vmio buffer .
/*
		 * malloced buffers are not shrunk
		 */