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

Function aio_biocleanup

freebsd/kern/vfs_aio.c:2429–2454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2427}
2428
2429static void
2430aio_biocleanup(struct bio *bp)
2431{
2432 struct kaiocb *job = (struct kaiocb *)bp->bio_caller1;
2433 struct kaioinfo *ki;
2434 struct buf *pbuf = (struct buf *)bp->bio_caller2;
2435
2436 /* Release mapping into kernel space. */
2437 if (pbuf != NULL) {
2438 MPASS(pbuf->b_npages <= atop(maxphys) + 1);
2439 pmap_qremove((vm_offset_t)pbuf->b_data, pbuf->b_npages);
2440 vm_page_unhold_pages(pbuf->b_pages, pbuf->b_npages);
2441 uma_zfree(pbuf_zone, pbuf);
2442 atomic_subtract_int(&num_buf_aio, 1);
2443 ki = job->userproc->p_aioinfo;
2444 AIO_LOCK(ki);
2445 ki->kaio_buffer_count--;
2446 AIO_UNLOCK(ki);
2447 } else {
2448 MPASS(bp->bio_ma_n <= atop(maxphys) + 1);
2449 vm_page_unhold_pages(bp->bio_ma, bp->bio_ma_n);
2450 free(bp->bio_ma, M_TEMP);
2451 atomic_subtract_int(&num_unmapped_aio, 1);
2452 }
2453 g_destroy_bio(bp);
2454}
2455
2456static void
2457aio_biowakeup(struct bio *bp)

Callers 2

aio_qbioFunction · 0.85
aio_biowakeupFunction · 0.85

Calls 4

vm_page_unhold_pagesFunction · 0.85
freeFunction · 0.70
pmap_qremoveFunction · 0.50
uma_zfreeFunction · 0.50

Tested by

no test coverage detected