summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 1bc259f..34f7acb 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -3203,6 +3203,7 @@ dev_strategy(struct cdev *dev, struct buf *bp)
{
struct cdevsw *csw;
struct bio *bip;
+ int ref;
if ((!bp->b_iocmd) || (bp->b_iocmd & (bp->b_iocmd - 1)))
panic("b_iocmd botch");
@@ -3224,7 +3225,7 @@ dev_strategy(struct cdev *dev, struct buf *bp)
KASSERT(dev->si_refcount > 0,
("dev_strategy on un-referenced struct cdev *(%s)",
devtoname(dev)));
- csw = dev_refthread(dev);
+ csw = dev_refthread(dev, &ref);
if (csw == NULL) {
g_destroy_bio(bip);
bp->b_error = ENXIO;
@@ -3233,7 +3234,7 @@ dev_strategy(struct cdev *dev, struct buf *bp)
return;
}
(*csw->d_strategy)(bip);
- dev_relthread(dev);
+ dev_relthread(dev, ref);
}
/*
OpenPOWER on IntegriCloud