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

Function vfs_bio_bzero_buf

freebsd/kern/vfs_bio.c:4808–4830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4806}
4807
4808void
4809vfs_bio_bzero_buf(struct buf *bp, int base, int size)
4810{
4811 vm_page_t m;
4812 int i, n;
4813
4814 if (buf_mapped(bp)) {
4815 BUF_CHECK_MAPPED(bp);
4816 bzero(bp->b_data + base, size);
4817 } else {
4818 BUF_CHECK_UNMAPPED(bp);
4819 n = PAGE_SIZE - (base & PAGE_MASK);
4820 for (i = base / PAGE_SIZE; size > 0 && i < bp->b_npages; ++i) {
4821 m = bp->b_pages[i];
4822 if (n > size)
4823 n = size;
4824 pmap_zero_page_area(m, base & PAGE_MASK, n);
4825 base += n;
4826 size -= n;
4827 n = PAGE_SIZE;
4828 }
4829 }
4830}
4831
4832/*
4833 * Update buffer flags based on I/O request parameters, optionally releasing the

Callers

nothing calls this directly

Calls 3

buf_mappedFunction · 0.85
bzeroFunction · 0.85
pmap_zero_page_areaFunction · 0.50

Tested by

no test coverage detected