I've been thinking about a change to vn_lock and VOP_UNLOCK to pass down
file names and line numbers, and I'd like some input. Mainly, I want to
make sure I don't shoot performace down with this change.
Also, I don't want to screw lkm's.
No matter what, a const char * and an int need to be added to struct
vop_lock_args and struct vop_unlock_args.
I see three ways to do this:
1) Add const char * and int parameters to the exported VOP_LOCK and
VOP_UNLOCK calls.
+ simple, direct.
+ we can continue to use the vnode_if.sh script to generate
vnode_if.c and vnode_if.h.
- Every caller of these routines needs to change to conditionally
add __FILE__ and __LINE__ directives to the calls - very
gross!
2) Rename the locking calls VOP_LOCK1 and VOP_UNLOCK1, and make VOP_LOCK &
VOP_UNLOCK macros which pass in __FILE__ & __LINE__ directives to the
respective *1 routine iff we want this level of DEBUG
+ Existing VOP_{UN,}LOCK calls work fine
- With present vnode_if.sh, requires changing descriptor tag used
to refer to {un,}locking VOP (vop_{un,}lock_desc ->
vop_{un,}lock1_desc). Requires changing every fs module
and makes us different from every other BSD.
3) As with 2), except modify vnode_if.sh to permit a rename type attribute
so that VOP_{UN,}LOCK1 calls generate calls via the
vop_{un,}lock_desc descriptor vector.
+ Existing VOP_{UN,}LOCK calls work fine (same wrapper macro as
option 2)
+ Existing filesystems work fine w/o modification (they should all
be using genfs_lock() anyway)
- Add complexity to vnode_if.sh to permit the renaming
I like suggestion 3, but want input.
Take care,
Bill