summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-07-25 21:24:23 +0000
committerphk <phk@FreeBSD.org>2004-07-25 21:24:23 +0000
commit5297516e026506cc0daa09237372bf903023155d (patch)
treedecfba6d72a4ee95eba49ec562edf0d69589ffbc
parent1fd2b9091152080c075df2ecbc4654e6d28eebbf (diff)
downloadFreeBSD-src-5297516e026506cc0daa09237372bf903023155d.zip
FreeBSD-src-5297516e026506cc0daa09237372bf903023155d.tar.gz
Eliminate unused second argument to reassignbuf() and simplify it
accordingly.
-rw-r--r--sys/kern/vfs_bio.c4
-rw-r--r--sys/kern/vfs_cluster.c2
-rw-r--r--sys/kern/vfs_subr.c43
-rw-r--r--sys/nfs4client/nfs4_vnops.c2
-rw-r--r--sys/nfsclient/nfs_vnops.c2
-rw-r--r--sys/sys/buf.h2
6 files changed, 18 insertions, 37 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index e8ff1b1..7acabb3 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1109,7 +1109,7 @@ bdirty(bp)
if ((bp->b_flags & B_DELWRI) == 0) {
bp->b_flags |= B_DONE | B_DELWRI;
- reassignbuf(bp, bp->b_vp);
+ reassignbuf(bp);
atomic_add_int(&numdirtybuffers, 1);
bd_wakeup((lodirtybuffers + hidirtybuffers) / 2);
}
@@ -1136,7 +1136,7 @@ bundirty(bp)
if (bp->b_flags & B_DELWRI) {
bp->b_flags &= ~B_DELWRI;
- reassignbuf(bp, bp->b_vp);
+ reassignbuf(bp);
atomic_subtract_int(&numdirtybuffers, 1);
numdirtywakeup(lodirtybuffers);
}
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index c51598b..453831f 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -969,7 +969,7 @@ cluster_wbuild(vp, size, start_lbn, len)
tbp->b_ioflags &= ~BIO_ERROR;
tbp->b_flags |= B_ASYNC;
tbp->b_iocmd = BIO_WRITE;
- reassignbuf(tbp, tbp->b_vp); /* put on clean list */
+ reassignbuf(tbp); /* put on clean list */
VI_LOCK(tbp->b_vp);
++tbp->b_vp->v_numoutput;
VI_UNLOCK(tbp->b_vp);
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index e483b43..ca5ee2f 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1794,17 +1794,11 @@ pbrelvp(bp)
* (indirect blocks) to the vnode to which they belong.
*/
void
-reassignbuf(bp, newvp)
- register struct buf *bp;
- register struct vnode *newvp;
+reassignbuf(struct buf *bp)
{
struct vnode *vp;
int delay;
- if (newvp == NULL) {
- printf("reassignbuf: NULL");
- return;
- }
vp = bp->b_vp;
++reassignbufcalls;
@@ -1819,24 +1813,15 @@ reassignbuf(bp, newvp)
* Delete from old vnode list, if on one.
*/
VI_LOCK(vp);
- if (bp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) {
+ if (bp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN))
buf_vlist_remove(bp);
- if (vp != newvp) {
- vdropl(bp->b_vp);
- bp->b_vp = NULL; /* for clarification */
- }
- }
- if (vp != newvp) {
- VI_UNLOCK(vp);
- VI_LOCK(newvp);
- }
/*
* If dirty, put on list of dirty buffers; otherwise insert onto list
* of clean buffers.
*/
if (bp->b_flags & B_DELWRI) {
- if ((newvp->v_iflag & VI_ONWORKLST) == 0) {
- switch (newvp->v_type) {
+ if ((vp->v_iflag & VI_ONWORKLST) == 0) {
+ switch (vp->v_type) {
case VDIR:
delay = dirdelay;
break;
@@ -1846,26 +1831,22 @@ reassignbuf(bp, newvp)
default:
delay = filedelay;
}
- vn_syncer_add_to_worklist(newvp, delay);
+ vn_syncer_add_to_worklist(vp, delay);
}
- buf_vlist_add(bp, newvp, BX_VNDIRTY);
+ buf_vlist_add(bp, vp, BX_VNDIRTY);
} else {
- buf_vlist_add(bp, newvp, BX_VNCLEAN);
+ buf_vlist_add(bp, vp, BX_VNCLEAN);
- if ((newvp->v_iflag & VI_ONWORKLST) &&
- TAILQ_EMPTY(&newvp->v_dirtyblkhd)) {
+ if ((vp->v_iflag & VI_ONWORKLST) &&
+ TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
mtx_lock(&sync_mtx);
- LIST_REMOVE(newvp, v_synclist);
+ LIST_REMOVE(vp, v_synclist);
syncer_worklist_len--;
mtx_unlock(&sync_mtx);
- newvp->v_iflag &= ~VI_ONWORKLST;
+ vp->v_iflag &= ~VI_ONWORKLST;
}
}
- if (bp->b_vp != newvp) {
- bp->b_vp = newvp;
- vholdl(bp->b_vp);
- }
- VI_UNLOCK(newvp);
+ VI_UNLOCK(vp);
}
/*
diff --git a/sys/nfs4client/nfs4_vnops.c b/sys/nfs4client/nfs4_vnops.c
index 27464a9..1acb915 100644
--- a/sys/nfs4client/nfs4_vnops.c
+++ b/sys/nfs4client/nfs4_vnops.c
@@ -2989,7 +2989,7 @@ nfs4_writebp(struct buf *bp, int force, struct thread *td)
if (oldflags & B_DELWRI) {
s = splbio();
- reassignbuf(bp, bp->b_vp);
+ reassignbuf(bp);
splx(s);
}
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index adc2219..663e3b0 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -2980,7 +2980,7 @@ nfs_writebp(struct buf *bp, int force, struct thread *td)
if (oldflags & B_DELWRI) {
s = splbio();
- reassignbuf(bp, bp->b_vp);
+ reassignbuf(bp);
splx(s);
}
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 30235be..4aa5e4f 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -521,7 +521,7 @@ void bgetvp(struct vnode *, struct buf *);
void pbgetvp(struct vnode *, struct buf *);
void pbrelvp(struct buf *);
int allocbuf(struct buf *bp, int size);
-void reassignbuf(struct buf *, struct vnode *);
+void reassignbuf(struct buf *);
struct buf *trypbuf(int *);
void bwait(struct buf *, u_char, const char *);
void bdone(struct buf *);
OpenPOWER on IntegriCloud