summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-07-07 05:27:08 +0000
committerjeff <jeff@FreeBSD.org>2002-07-07 05:27:08 +0000
commit5d7805963eb441681bad7e5d38c517ef3cff8318 (patch)
tree8c2ff00b103f5f516a2de4d4b580f2a8845eb020 /sys/kern/vfs_bio.c
parent9b623ad295530eedaf3a602fd4550d92c7c235c9 (diff)
downloadFreeBSD-src-5d7805963eb441681bad7e5d38c517ef3cff8318.zip
FreeBSD-src-5d7805963eb441681bad7e5d38c517ef3cff8318.tar.gz
Add two asserts that prove & document getblk and geteblk's behavior of
returning locked bufs.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 6b284c8..f2696fe 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -2435,6 +2435,7 @@ loop:
splx(s);
bp->b_flags &= ~B_DONE;
}
+ KASSERT(BUF_REFCNT(bp) == 1, ("getblk: bp %p not locked",bp));
return (bp);
}
@@ -2456,6 +2457,7 @@ geteblk(int size)
splx(s);
allocbuf(bp, size);
bp->b_flags |= B_INVAL; /* b_dep cleared by getnewbuf() */
+ KASSERT(BUF_REFCNT(bp) == 1, ("geteblk: bp %p not locked",bp));
return (bp);
}
OpenPOWER on IntegriCloud