summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2006-03-31 02:56:30 +0000
committerjeff <jeff@FreeBSD.org>2006-03-31 02:56:30 +0000
commit2086f279cf6f34c84b68782651af859bd337032d (patch)
tree01eafea626f999d93e5778d0b6a0680c55fe937b /sys/kern/vfs_subr.c
parent01da4eecd31ee97c8f97e06c60388e309dd70e79 (diff)
downloadFreeBSD-src-2086f279cf6f34c84b68782651af859bd337032d.zip
FreeBSD-src-2086f279cf6f34c84b68782651af859bd337032d.tar.gz
- Add the B_NEEDSGIANT flag which is only set if the vnode that owns a buf
requires Giant. It is set in bgetvp and cleared in brelvp. - Create QUEUE_DIRTY_GIANT for dirty buffers that require giant. - In the buf daemon, only grab giant when processing QUEUE_DIRTY_GIANT and only if we think there are buffers in that queue. Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 4af051d..8dbee34 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1440,6 +1440,8 @@ bgetvp(struct vnode *vp, struct buf *bp)
ASSERT_VI_LOCKED(vp, "bgetvp");
vholdl(vp);
+ if (VFS_NEEDSGIANT(vp->v_mount))
+ bp->b_flags |= B_NEEDSGIANT;
bp->b_vp = vp;
bp->b_bufobj = &vp->v_bufobj;
/*
@@ -1477,6 +1479,7 @@ brelvp(struct buf *bp)
syncer_worklist_len--;
mtx_unlock(&sync_mtx);
}
+ bp->b_flags &= ~B_NEEDSGIANT;
bp->b_vp = NULL;
bp->b_bufobj = NULL;
vdropl(vp);
OpenPOWER on IntegriCloud