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

Function biowait

freebsd/kern/vfs_bio.c:4372–4387  ·  view source on GitHub ↗

* Wait for a BIO to finish. */

Source from the content-addressed store, hash-verified

4370 * Wait for a BIO to finish.
4371 */
4372int
4373biowait(struct bio *bp, const char *wchan)
4374{
4375 struct mtx *mtxp;
4376
4377 mtxp = mtx_pool_find(mtxpool_sleep, bp);
4378 mtx_lock(mtxp);
4379 while ((bp->bio_flags & BIO_DONE) == 0)
4380 msleep(bp, mtxp, PRIBIO, wchan, 0);
4381 mtx_unlock(mtxp);
4382 if (bp->bio_error != 0)
4383 return (bp->bio_error);
4384 if (!(bp->bio_flags & BIO_ERROR))
4385 return (0);
4386 return (EIO);
4387}
4388
4389void
4390biofinish(struct bio *bp, struct devstat *stat, int error)

Callers 2

vdev_geom_ioFunction · 0.85
physioFunction · 0.85

Calls 3

mtx_pool_findFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected