summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-08-08 09:48:03 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-08-08 09:48:03 +0000
commit287d126cd15091bd49278fb5efcc66401b4a8c66 (patch)
tree4bffa75e65f370cabc4223374174f0a7564a7a69 /sys/ufs
parent6c28c8a324a71c55a562e7a02f11c5f282ad80d4 (diff)
Add a few splassert() checks, okay art@
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 9e94e6e2be9..2527ef60993 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.60 2005/07/20 16:30:34 pedro Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.61 2005/08/08 09:48:02 pedro Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
*
@@ -458,6 +458,8 @@ softdep_freequeue_process(void)
{
struct worklist *wk;
+ splassert(IPL_BIO);
+
while ((wk = LIST_FIRST(&softdep_freequeue)) != NULL) {
LIST_REMOVE(wk, wk_list);
FREE_LOCK(&lk);
@@ -994,6 +996,8 @@ pagedep_lookup(ip, lbn, flags, pagedeppp)
struct mount *mp;
int i;
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (lk.lkt_held == -1)
panic("pagedep_lookup: lock not held");
@@ -1065,6 +1069,8 @@ inodedep_lookup(fs, inum, flags, inodedeppp)
struct inodedep_hashhead *inodedephd;
int firsttry;
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (lk.lkt_held == -1)
panic("inodedep_lookup: lock not held");
@@ -1375,6 +1381,8 @@ bmsafemap_lookup(bp)
struct bmsafemap *bmsafemap;
struct worklist *wk;
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (lk.lkt_held == -1)
panic("bmsafemap_lookup: lock not held");
@@ -1552,6 +1560,8 @@ allocdirect_merge(adphead, newadp, oldadp)
struct freefrag *freefrag;
struct newdirblk *newdirblk;
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (lk.lkt_held == -1)
panic("allocdirect_merge: lock not held");
@@ -2141,6 +2151,8 @@ free_allocdirect(adphead, adp, delay)
struct newdirblk *newdirblk;
struct worklist *wk;
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (lk.lkt_held == -1)
panic("free_allocdirect: lock not held");
@@ -2183,6 +2195,8 @@ free_newdirblk(newdirblk)
struct diradd *dap;
int i;
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (lk.lkt_held == -1)
panic("free_newdirblk: lock not held");
@@ -2276,6 +2290,7 @@ STATIC int
check_inode_unwritten(inodedep)
struct inodedep *inodedep;
{
+ splassert(IPL_BIO);
if ((inodedep->id_state & DEPCOMPLETE) != 0 ||
LIST_FIRST(&inodedep->id_pendinghd) != NULL ||
@@ -2484,6 +2499,8 @@ free_allocindir(aip, inodedep)
{
struct freefrag *freefrag;
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (lk.lkt_held == -1)
panic("free_allocindir: lock not held");
@@ -2732,6 +2749,8 @@ free_diradd(dap)
struct inodedep *inodedep;
struct mkdir *mkdir, *nextmd;
+ splassert(IPL_BIO);
+
#ifdef DEBUG
if (lk.lkt_held == -1)
panic("free_diradd: lock not held");
@@ -3621,6 +3640,8 @@ handle_allocdirect_partdone(adp)
struct inodedep *inodedep;
long bsize, delay;
+ splassert(IPL_BIO);
+
if ((adp->ad_state & ALLCOMPLETE) != ALLCOMPLETE)
return;
if (adp->ad_buf != NULL)
@@ -3692,6 +3713,8 @@ handle_allocindir_partdone(aip)
{
struct indirdep *indirdep;
+ splassert(IPL_BIO);
+
if ((aip->ai_state & ALLCOMPLETE) != ALLCOMPLETE)
return;
if (aip->ai_buf != NULL)
@@ -3726,6 +3749,8 @@ handle_written_inodeblock(inodedep, bp)
struct ufs1_dinode *dp;
int hadchanges;
+ splassert(IPL_BIO);
+
if ((inodedep->id_state & IOSTARTED) == 0)
panic("handle_written_inodeblock: not started");
inodedep->id_state &= ~IOSTARTED;
@@ -3874,6 +3899,8 @@ diradd_inode_written(dap, inodedep)
{
struct pagedep *pagedep;
+ splassert(IPL_BIO);
+
dap->da_state |= COMPLETE;
if ((dap->da_state & ALLCOMPLETE) == ALLCOMPLETE) {
if (dap->da_state & DIRCHG)
@@ -3897,6 +3924,8 @@ handle_written_mkdir(mkdir, type)
struct diradd *dap;
struct pagedep *pagedep;
+ splassert(IPL_BIO);
+
if (mkdir->md_state != type)
panic("handle_written_mkdir: bad type");
dap = mkdir->md_diradd;
@@ -3932,6 +3961,8 @@ handle_written_filepage(pagedep, bp)
struct direct *ep;
int i, chgs;
+ splassert(IPL_BIO);
+
if ((pagedep->pd_state & IOSTARTED) == 0)
panic("handle_written_filepage: not started");
pagedep->pd_state &= ~IOSTARTED;
@@ -4133,6 +4164,8 @@ merge_inode_lists(inodedep)
{
struct allocdirect *listadp, *newadp;
+ splassert(IPL_BIO);
+
newadp = TAILQ_FIRST(&inodedep->id_newinoupdt);
for (listadp = TAILQ_FIRST(&inodedep->id_inoupdt); listadp && newadp;) {
if (listadp->ad_lbn < newadp->ad_lbn) {
@@ -4611,6 +4644,8 @@ flush_inodedep_deps(fs, ino)
int error, waitfor;
struct buf *bp;
+ splassert(IPL_BIO);
+
/*
* This work is done in two passes. The first pass grabs most
* of the buffers and begins asynchronously writing them. The
@@ -4705,6 +4740,8 @@ flush_pagedep_deps(pvp, mp, diraddhdp)
struct buf *bp;
ino_t inum;
+ splassert(IPL_BIO);
+
ump = VFSTOUFS(mp);
while ((dap = LIST_FIRST(diraddhdp)) != NULL) {
/*
@@ -5177,6 +5214,8 @@ getdirtybuf(bpp, waitfor)
struct buf *bp;
int s;
+ splassert(IPL_BIO);
+
for (;;) {
if ((bp = *bpp) == NULL)
return (0);
@@ -5206,9 +5245,12 @@ drain_output(vp, islocked)
int islocked;
{
int s;
-
+
if (!islocked)
ACQUIRE_LOCK(&lk);
+
+ splassert(IPL_BIO);
+
while (vp->v_numoutput) {
vp->v_bioflag |= VBIOWAIT;
s = FREE_LOCK_INTERLOCKED(&lk);