summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2009-06-06 18:06:23 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2009-06-06 18:06:23 +0000
commite2b3079a9a2517a38b09f5f5122129e1f694dc8e (patch)
tree1bf93144b74c5ed6f6771088b014c23c8c0afdac
parent34fe98751844589de34ce4f031ccea5ab9f2db10 (diff)
All caller of buf_acquire were doing bremfree before the call.
Just put it in the buf_acquire function. oga@ ok
-rw-r--r--sys/kern/spec_vnops.c3
-rw-r--r--sys/kern/vfs_bio.c4
-rw-r--r--sys/kern/vfs_biomem.c4
-rw-r--r--sys/kern/vfs_subr.c5
-rw-r--r--sys/miscfs/specfs/spec_vnops.c3
-rw-r--r--sys/nfs/nfs_syscalls.c3
-rw-r--r--sys/nfs/nfs_vnops.c4
-rw-r--r--sys/ufs/ffs/ffs_softdep.c4
-rw-r--r--sys/ufs/ffs/ffs_vnops.c3
9 files changed, 11 insertions, 22 deletions
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c
index c310fbd8556..ed5a617a7d6 100644
--- a/sys/kern/spec_vnops.c
+++ b/sys/kern/spec_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_vnops.c,v 1.53 2008/07/24 18:48:18 thib Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.54 2009/06/06 18:06:22 art Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
@@ -439,7 +439,6 @@ loop:
continue;
if ((bp->b_flags & B_DELWRI) == 0)
panic("spec_fsync: not dirty");
- bremfree(bp);
buf_acquire(bp);
splx(s);
bawrite(bp);
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 8e900669145..42435d9e05f 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_bio.c,v 1.115 2009/06/05 04:29:14 beck Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.116 2009/06/06 18:06:22 art Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*
@@ -916,7 +916,6 @@ start:
if (!ISSET(bp->b_flags, B_INVAL)) {
bcstats.cachehits++;
- bremfree(bp);
SET(bp->b_flags, B_CACHE);
buf_acquire(bp);
splx(s);
@@ -1101,7 +1100,6 @@ buf_daemon(struct proc *p)
if (bcstats.numdirtypages < lodirtypages)
break;
- bremfree(bp);
buf_acquire(bp);
splx(s);
diff --git a/sys/kern/vfs_biomem.c b/sys/kern/vfs_biomem.c
index 2aa8ac9ee51..eddaf9d58df 100644
--- a/sys/kern/vfs_biomem.c
+++ b/sys/kern/vfs_biomem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_biomem.c,v 1.6 2009/06/02 23:00:19 oga Exp $ */
+/* $OpenBSD: vfs_biomem.c,v 1.7 2009/06/06 18:06:22 art Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
*
@@ -80,10 +80,12 @@ buf_acquire(struct buf *bp)
KASSERT((bp->b_flags & B_BUSY) == 0);
s = splbio();
+
/*
* Busy before waiting for kvm.
*/
SET(bp->b_flags, B_BUSY);
+ bremfree(bp);
buf_map(bp);
splx(s);
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 069cd7ce121..ced2bdc291e 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.176 2009/06/03 04:30:57 beck Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.177 2009/06/06 18:06:22 art Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1702,7 +1702,6 @@ vfs_syncwait(int verbose)
*/
if (bp->b_flags & B_DELWRI) {
s = splbio();
- bremfree(bp);
buf_acquire(bp);
splx(s);
nbusy++;
@@ -1873,7 +1872,6 @@ loop:
}
break;
}
- bremfree(bp);
buf_acquire(bp);
/*
* XXX Since there are no node locks for NFS, I believe
@@ -1911,7 +1909,6 @@ loop:
continue;
if ((bp->b_flags & B_DELWRI) == 0)
panic("vflushbuf: not dirty");
- bremfree(bp);
buf_acquire(bp);
splx(s);
/*
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c
index c310fbd8556..ed5a617a7d6 100644
--- a/sys/miscfs/specfs/spec_vnops.c
+++ b/sys/miscfs/specfs/spec_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_vnops.c,v 1.53 2008/07/24 18:48:18 thib Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.54 2009/06/06 18:06:22 art Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
@@ -439,7 +439,6 @@ loop:
continue;
if ((bp->b_flags & B_DELWRI) == 0)
panic("spec_fsync: not dirty");
- bremfree(bp);
buf_acquire(bp);
splx(s);
bawrite(bp);
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index c9cbe28575d..e0f646dfbc8 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.80 2009/06/04 01:02:42 blambert Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.81 2009/06/06 18:06:22 art Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -662,7 +662,6 @@ nfssvc_iod(void *arg)
if ((nbp->b_flags &
(B_BUSY|B_DELWRI|B_NEEDCOMMIT|B_NOCACHE))!=B_DELWRI)
continue;
- bremfree(nbp);
nbp->b_flags |= B_ASYNC;
buf_acquire(nbp);
break;
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 67eedde4fc1..2fe5acffd29 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.113 2009/06/04 00:31:42 blambert Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.114 2009/06/06 18:06:22 art Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -2827,7 +2827,6 @@ again:
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
!= (B_DELWRI | B_NEEDCOMMIT))
continue;
- bremfree(bp);
bp->b_flags |= B_WRITEINPROG;
buf_acquire(bp);
/*
@@ -2906,7 +2905,6 @@ loop:
panic("nfs_fsync: not dirty");
if ((passone || !commit) && (bp->b_flags & B_NEEDCOMMIT))
continue;
- bremfree(bp);
if (passone || !commit) {
bp->b_flags |= B_ASYNC;
} else {
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 7c6959df7a9..0a76d2144f1 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.98 2008/06/14 10:55:21 mk Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.99 2009/06/06 18:06:22 art Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -4700,7 +4700,6 @@ softdep_fsync_mountdev(vp, waitfor)
wk->wk_type != D_BMSAFEMAP) {
continue;
}
- bremfree(bp);
buf_acquire(bp);
FREE_LOCK(&lk);
(void) bawrite(bp);
@@ -5608,7 +5607,6 @@ getdirtybuf(bp, waitfor)
}
if ((bp->b_flags & B_DELWRI) == 0)
return (0);
- bremfree(bp);
buf_acquire(bp);
return (1);
}
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 160158f8f3b..7b92d471191 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vnops.c,v 1.52 2009/01/15 07:58:37 grange Exp $ */
+/* $OpenBSD: ffs_vnops.c,v 1.53 2009/06/06 18:06:22 art Exp $ */
/* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */
/*
@@ -448,7 +448,6 @@ loop:
continue;
}
- bremfree(bp);
buf_acquire(bp);
bp->b_flags |= B_SCANNED;
splx(s);