summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_bio.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 853803c..5d4f170 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -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);
}
/*
OpenPOWER on IntegriCloud