MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bdata2bio

Function bdata2bio

freebsd/kern/vfs_bio.c:5106–5125  ·  view source on GitHub ↗

* Set bio_data or bio_ma for struct bio from the struct buf. */

Source from the content-addressed store, hash-verified

5104 * Set bio_data or bio_ma for struct bio from the struct buf.
5105 */
5106void
5107bdata2bio(struct buf *bp, struct bio *bip)
5108{
5109
5110 if (!buf_mapped(bp)) {
5111 KASSERT(unmapped_buf_allowed, ("unmapped"));
5112 bip->bio_ma = bp->b_pages;
5113 bip->bio_ma_n = bp->b_npages;
5114 bip->bio_data = unmapped_buf;
5115 bip->bio_ma_offset = (vm_offset_t)bp->b_offset & PAGE_MASK;
5116 bip->bio_flags |= BIO_UNMAPPED;
5117 KASSERT(round_page(bip->bio_ma_offset + bip->bio_length) /
5118 PAGE_SIZE == bp->b_npages,
5119 ("Buffer %p too short: %d %lld %d", bp, bip->bio_ma_offset,
5120 (long long)bip->bio_length, bip->bio_ma_n));
5121 } else {
5122 bip->bio_data = bp->b_data;
5123 bip->bio_ma = NULL;
5124 }
5125}
5126
5127/*
5128 * The MIPS pmap code currently doesn't handle aliased pages.

Callers

nothing calls this directly

Calls 1

buf_mappedFunction · 0.85

Tested by

no test coverage detected