diff options
Diffstat (limited to 'sys/kern/vfs_bio.c')
| -rw-r--r-- | sys/kern/vfs_bio.c | 68 | 
1 files changed, 0 insertions, 68 deletions
| diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 5f68bde8cd1c..ea7c0a4fd5ba 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3768,74 +3768,6 @@ bufwait(struct buf *bp)  	}  } - /* -  * Call back function from struct bio back up to struct buf. -  */ -static void -bufdonebio(struct bio *bip) -{ -	struct buf *bp; - -	bp = bip->bio_caller2; -	bp->b_resid = bip->bio_resid; -	bp->b_ioflags = bip->bio_flags; -	bp->b_error = bip->bio_error; -	if (bp->b_error) -		bp->b_ioflags |= BIO_ERROR; -	bufdone(bp); -	g_destroy_bio(bip); -} - -void -dev_strategy(struct cdev *dev, struct buf *bp) -{ -	struct cdevsw *csw; -	int ref; - -	KASSERT(dev->si_refcount > 0, -	    ("dev_strategy on un-referenced struct cdev *(%s) %p", -	    devtoname(dev), dev)); - -	csw = dev_refthread(dev, &ref); -	dev_strategy_csw(dev, csw, bp); -	dev_relthread(dev, ref); -} - -void -dev_strategy_csw(struct cdev *dev, struct cdevsw *csw, struct buf *bp) -{ -	struct bio *bip; - -	KASSERT(bp->b_iocmd == BIO_READ || bp->b_iocmd == BIO_WRITE, -	    ("b_iocmd botch")); -	KASSERT(((dev->si_flags & SI_ETERNAL) != 0 && csw != NULL) || -	    dev->si_threadcount > 0, -	    ("dev_strategy_csw threadcount cdev *(%s) %p", devtoname(dev), -	    dev)); -	if (csw == NULL) { -		bp->b_error = ENXIO; -		bp->b_ioflags = BIO_ERROR; -		bufdone(bp); -		return; -	} -	for (;;) { -		bip = g_new_bio(); -		if (bip != NULL) -			break; -		/* Try again later */ -		tsleep(&bp, PRIBIO, "dev_strat", hz/10); -	} -	bip->bio_cmd = bp->b_iocmd; -	bip->bio_offset = bp->b_iooffset; -	bip->bio_length = bp->b_bcount; -	bip->bio_bcount = bp->b_bcount;	/* XXX: remove */ -	bdata2bio(bp, bip); -	bip->bio_done = bufdonebio; -	bip->bio_caller2 = bp; -	bip->bio_dev = dev; -	(*csw->d_strategy)(bip); -} -  /*   *	bufdone:   * | 
