summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-09-25 02:12:32 +0000
committerjeff <jeff@FreeBSD.org>2002-09-25 02:12:32 +0000
commit8ec2a2de7d55e53b72955acc48380f1e5cb307e9 (patch)
tree152f015ee6e078c0c383d691e7daf0eeaf3160aa /sys/kern/vfs_cluster.c
parent54956e8ea4a48ce84e32d80dbf940b24b36890ab (diff)
downloadFreeBSD-src-8ec2a2de7d55e53b72955acc48380f1e5cb307e9.zip
FreeBSD-src-8ec2a2de7d55e53b72955acc48380f1e5cb307e9.tar.gz
- Use incore() where no other interlock locking is necessary.
- Lock access to numoutput.
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 5c5f0f0..1994c54 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -151,6 +151,7 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
* for efficiency.
*/
s = splbio();
+ VI_LOCK(vp);
for (i = 1; i < maxra; i++) {
/*
* Stop if the buffer does not exist or it
@@ -168,6 +169,7 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
(i == (maxra - 1)))
tbp->b_flags |= B_RAM;
}
+ VI_UNLOCK(vp);
splx(s);
if (i >= maxra) {
return 0;
@@ -790,7 +792,7 @@ cluster_wbuild(vp, size, start_lbn, len)
* is delayed-write but either locked or inval, it cannot
* partake in the clustered write.
*/
- if (((tbp = gbincore(vp, start_lbn)) == NULL) ||
+ if (((tbp = incore(vp, start_lbn)) == NULL) ||
((tbp->b_flags & (B_LOCKED | B_INVAL | B_DELWRI)) != B_DELWRI) ||
BUF_LOCK(tbp, LK_EXCLUSIVE | LK_NOWAIT)) {
++start_lbn;
@@ -864,7 +866,7 @@ cluster_wbuild(vp, size, start_lbn, len)
* If the adjacent data is not even in core it
* can't need to be written.
*/
- if ((tbp = gbincore(vp, start_lbn)) == NULL) {
+ if ((tbp = incore(vp, start_lbn)) == NULL) {
splx(s);
break;
}
@@ -956,7 +958,9 @@ cluster_wbuild(vp, size, start_lbn, len)
tbp->b_flags |= B_ASYNC;
tbp->b_iocmd = BIO_WRITE;
reassignbuf(tbp, tbp->b_vp); /* put on clean list */
+ VI_LOCK(tbp->b_vp);
++tbp->b_vp->v_numoutput;
+ VI_UNLOCK(tbp->b_vp);
splx(s);
BUF_KERNPROC(tbp);
TAILQ_INSERT_TAIL(&bp->b_cluster.cluster_head,
OpenPOWER on IntegriCloud