summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-07-07 05:29:45 +0000
committerjeff <jeff@FreeBSD.org>2002-07-07 05:29:45 +0000
commit8bf1a039cbc4ffad07555a6fbdf870dab6537d9a (patch)
tree802e57a26d66550a57dbad338caa3e6be6a9b391 /sys/kern/vfs_subr.c
parent5d7805963eb441681bad7e5d38c517ef3cff8318 (diff)
downloadFreeBSD-src-8bf1a039cbc4ffad07555a6fbdf870dab6537d9a.zip
FreeBSD-src-8bf1a039cbc4ffad07555a6fbdf870dab6537d9a.tar.gz
- BUF_REFCNT() seems to be the preferred method for verifying a locked buf.
Tell vop_strategy_pre() to use this instead. - Ignore B_CLUSTER bufs. Their components are locked but they don't really exist so they don't have to be. This isn't ideal but it is safe.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 83c7bec..059b50b 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -257,11 +257,17 @@ void
vop_strategy_pre(void *ap)
{
struct vop_strategy_args *a = ap;
- int status;
+ struct buf *bp;
- status = lockstatus(&a->a_bp->b_lock, curthread);
+ bp = a->a_bp;
- if (status != LK_SHARED && status != LK_EXCLUSIVE) {
+ /*
+ * Cluster ops lock their component buffers but not the IO container.
+ */
+ if ((bp->b_flags & B_CLUSTER) != 0)
+ return;
+
+ if (BUF_REFCNT(bp) < 1) {
if (vfs_badlock_print)
printf("VOP_STRATEGY: bp is not locked but should be.\n");
if (vfs_badlock_panic)
OpenPOWER on IntegriCloud