diff options
author | kib <kib@FreeBSD.org> | 2010-08-06 09:42:15 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-08-06 09:42:15 +0000 |
commit | ba7ee96f4acc27c8c70a4af6c81be42c4856619f (patch) | |
tree | 7da521a717547b550e58c94609d3078b5dd9e826 /sys/kern/vfs_bio.c | |
parent | c3d4f0835cad384499298be886c0a8afc90d5822 (diff) | |
download | FreeBSD-src-ba7ee96f4acc27c8c70a4af6c81be42c4856619f.zip FreeBSD-src-ba7ee96f4acc27c8c70a4af6c81be42c4856619f.tar.gz |
Add new make_dev_p(9) flag MAKEDEV_ETERNAL to inform devfs that created
cdev will never be destroyed. Propagate the flag to devfs vnodes as
VV_ETERNVALDEV. Use the flags to avoid acquiring devmtx and taking a
thread reference on such nodes.
In collaboration with: pho
MFC after: 1 month
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 5 |
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); } /* |