use dev_re[fl]thread() rather than home rolled versions.

This commit is contained in:
Poul-Henning Kamp 2004-09-24 05:55:03 +00:00
parent 2c15afd888
commit 6230ce6aa9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135705

View File

@ -3108,11 +3108,7 @@ dev_strategy(struct buf *bp)
KASSERT(dev->si_refcount > 0,
("dev_strategy on un-referenced struct cdev *(%s)",
devtoname(dev)));
dev_lock();
csw = devsw(dev);
if (csw != NULL)
dev->si_threadcount++;
dev_unlock();
csw = dev_refthread(dev);
if (csw == NULL) {
bp->b_error = ENXIO;
bp->b_ioflags = BIO_ERROR;
@ -3122,9 +3118,7 @@ dev_strategy(struct buf *bp)
return;
}
(*csw->d_strategy)(&bp->b_io);
dev_lock();
dev->si_threadcount--;
dev_unlock();
dev_relthread(dev);
}
/*