diff options
author | jeff <jeff@FreeBSD.org> | 2002-07-09 20:07:29 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-07-09 20:07:29 +0000 |
commit | 3c00ac83f83fa4678e146db8e392df1ab196e4bb (patch) | |
tree | a0b6976f4024c0dd9cb0ad541a4517e95ff2b3b0 /sys | |
parent | 94c140555c689adeedb99225a050cd9283889e84 (diff) | |
download | FreeBSD-src-3c00ac83f83fa4678e146db8e392df1ab196e4bb.zip FreeBSD-src-3c00ac83f83fa4678e146db8e392df1ab196e4bb.tar.gz |
- Remove IS_LOCKING_VFS() all of our filesystems support locking now
- Add IGNORE_LOCK() that only ignores VCHR files for now since no one locks
their underlying device in the leaf filesystems. (devvp)
- Add prototypes for vop_lookup_{pre,post} that I forgot before.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/vnode.h | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index bcf0987..bc92a9a 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -451,24 +451,17 @@ extern int vfs_badlock_panic; extern int vfs_badlock_print; /* - * [dfr] Kludge until I get around to fixing all the vfs locking. - */ -#define IS_LOCKING_VFS(vp) ( ((vp)->v_tag == VT_UFS \ - || (vp)->v_tag == VT_NFS \ - || (vp)->v_tag == VT_LFS \ - || (vp)->v_tag == VT_ISOFS \ - || (vp)->v_tag == VT_MSDOSFS \ - || (vp)->v_tag == VT_DEVFS \ - || (vp)->v_tag == VT_UDF \ - || (vp)->v_tag == VT_PSEUDOFS \ - || (vp)->v_tag == VT_PROCFS) \ - && (vp)->v_type != VCHR) + * This only exists to supress warnings from unlocked specfs accesses. It is + * no longer ok to have an unlocked VFS. + */ + +#define IGNORE_LOCK(vp) ((vp)->v_type == VCHR) #define ASSERT_VOP_LOCKED(vp, str) \ do { \ struct vnode *_vp = (vp); \ \ - if (_vp && IS_LOCKING_VFS(_vp) && !VOP_ISLOCKED(_vp, NULL)) { \ + if (_vp && !IGNORE_LOCK(_vp) && !VOP_ISLOCKED(_vp, NULL)) { \ if (vfs_badlock_print) \ printf("%s: %p is not locked but should be\n", \ str, _vp); \ @@ -482,7 +475,7 @@ do { \ struct vnode *_vp = (vp); \ int lockstate; \ \ - if (_vp && IS_LOCKING_VFS(_vp)) { \ + if (_vp && !IGNORE_LOCK(_vp)) { \ lockstate = VOP_ISLOCKED(_vp, curthread); \ if (lockstate == LK_EXCLUSIVE) { \ if (vfs_badlock_print) \ @@ -498,8 +491,8 @@ do { \ do { \ struct vnode *_vp = (vp); \ \ - if (_vp && IS_LOCKING_VFS(_vp) && \ - VOP_ISLOCKED(_vp, curthread) != LK_EXCLUSIVE) \ + if (_vp && !IGNORE_LOCK(_vp) && \ + VOP_ISLOCKED(_vp, curthread) != LK_EXCLUSIVE) \ panic("%s: %p is not exclusive locked but should be", \ str, _vp); \ } while (0) @@ -508,8 +501,8 @@ do { \ do { \ struct vnode *_vp = (vp); \ \ - if (_vp && IS_LOCKING_VFS(_vp) && \ - VOP_ISLOCKED(_vp, curthread) != LK_EXCLOTHER) \ + if (_vp && !IGNORE_LOCK(_vp) && \ + VOP_ISLOCKED(_vp, curthread) != LK_EXCLOTHER) \ panic("%s: %p is not exclusive locked by another thread", \ str, _vp); \ } while (0) @@ -518,7 +511,7 @@ do { \ do { \ struct vnode *_vp = (vp); \ \ - if (_vp && IS_LOCKING_VFS(_vp) && \ + if (_vp && !IGNORE_LOCK(_vp) && \ VOP_ISLOCKED(_vp, NULL) != LK_SHARED) \ panic("%s: %p is not locked shared but should be", \ str, _vp); \ @@ -526,6 +519,8 @@ do { \ void vop_rename_pre(void *a); void vop_strategy_pre(void *a); +void vop_lookup_pre(void *a); +void vop_lookup_post(void *a, int rc); #else |