diff options
author | jeff <jeff@FreeBSD.org> | 2002-08-04 10:29:36 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-08-04 10:29:36 +0000 |
commit | 02517b6731ab2da44ce9b49260429744cf0114d5 (patch) | |
tree | e889f56910bf98cbee3be239655a9e4bbb928b2e /sys/kern/vfs_bio.c | |
parent | a03ca02ee99a255a2c14a75ff8eb488960b13ea7 (diff) | |
download | FreeBSD-src-02517b6731ab2da44ce9b49260429744cf0114d5.zip FreeBSD-src-02517b6731ab2da44ce9b49260429744cf0114d5.tar.gz |
- Replace v_flag with v_iflag and v_vflag
- v_vflag is protected by the vnode lock and is used when synchronization
with VOP calls is needed.
- v_iflag is protected by interlock and is used for dealing with vnode
management issues. These flags include X/O LOCK, FREE, DOOMED, etc.
- All accesses to v_iflag and v_vflag have either been locked or marked with
mp_fixme's.
- Many ASSERT_VOP_LOCKED calls have been added where the locking was not
clear.
- Many functions in vfs_subr.c were restructured to provide for stronger
locking.
Idea stolen from: BSD/OS
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 548e4fb..e0d623c 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2107,7 +2107,7 @@ inmem(struct vnode * vp, daddr_t blkno) return 1; if (vp->v_mount == NULL) return 0; - if (VOP_GETVOBJECT(vp, &obj) != 0 || (vp->v_flag & VOBJBUF) == 0) + if (VOP_GETVOBJECT(vp, &obj) != 0 || (vp->v_vflag & VV_OBJBUF) == 0) return 0; size = PAGE_SIZE; @@ -2408,7 +2408,8 @@ loop: bsize = size; offset = blkno * bsize; - vmio = (VOP_GETVOBJECT(vp, NULL) == 0) && (vp->v_flag & VOBJBUF); + vmio = (VOP_GETVOBJECT(vp, NULL) == 0) && + (vp->v_vflag & VV_OBJBUF); maxsize = vmio ? size + (offset & PAGE_MASK) : size; maxsize = imax(maxsize, bsize); @@ -2912,11 +2913,12 @@ bufdone(struct buf *bp) obj = bp->b_object; #if defined(VFS_BIO_DEBUG) + mp_fixme("usecount and vflag accessed without locks."); if (vp->v_usecount == 0) { panic("biodone: zero vnode ref count"); } - if ((vp->v_flag & VOBJBUF) == 0) { + if ((vp->v_vflag & VV_OBJBUF) == 0) { panic("biodone: vnode is not setup for merged cache"); } #endif |