diff options
author | phk <phk@FreeBSD.org> | 2005-01-13 07:53:01 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-01-13 07:53:01 +0000 |
commit | 4d9781b3dbece651d7be988939f2c166bc7e8562 (patch) | |
tree | e7e985f51392cbb38e54bd0ff0579b79648afa2c /sys/kern/vfs_init.c | |
parent | 93aaafbe168e1ffcbe302959df6d2898d8e3d894 (diff) | |
download | FreeBSD-src-4d9781b3dbece651d7be988939f2c166bc7e8562.zip FreeBSD-src-4d9781b3dbece651d7be988939f2c166bc7e8562.tar.gz |
Change the generated VOP_ macro implementations to improve type checking
and KASSERT coverage.
After this check there is only one "nasty" cast in this code but there
is a KASSERT to protect against the wrong argument structure behind
that cast.
Un-inlining the meat of VOP_FOO() saves 35kB of text segment on a typical
kernel with no change in performance.
We also now run the checking and tracing on VOP's which have been layered
by nullfs, umapfs, deadfs or unionfs.
Add new (non-inline) VOP_FOO_AP() functions which take a "struct
foo_args" argument and does everything the VOP_FOO() macros
used to do with checks and debugging code.
Add KASSERT to VOP_FOO_AP() check for argument type being
correct.
Slim down VOP_FOO() inline functions to just stuff arguments
into the struct foo_args and call VOP_FOO_AP().
Put function pointer to VOP_FOO_AP() into vop_foo_desc structure
and make VCALL() use it instead of the current offsetoff() hack.
Retire vcall() which implemented the offsetoff()
Make deadfs and unionfs use VOP_FOO_AP() calls instead of
VCALL(), we know which specific call we want already.
Remove unneeded arguments to VCALL() in nullfs and umapfs bypass
functions.
Remove unused vdesc_offset and VOFFSET().
Generally improve style/readability of the generated code.
Diffstat (limited to 'sys/kern/vfs_init.c')
-rw-r--r-- | sys/kern/vfs_init.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index e4c4f40..61d2675 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -89,32 +89,6 @@ struct vattr va_null; * Routines having to do with the management of the vnode table. */ -/* - * XXX: hack alert - */ -int -vcall(struct vnode *vp, u_int off, void *ap) -{ - struct vop_vector *vop = vp->v_op; - vop_bypass_t **bpt; - int rc; - - for(;;) { - bpt = (void *)((u_char *)vop + off); - if (vop != NULL && *bpt == NULL && vop->vop_bypass == NULL) { - vop = vop->vop_default; - continue; - } - break; - } - KASSERT(vop != NULL, ("No VCALL(%p...)", vp)); - if (*bpt != NULL) - rc = (*bpt)(ap); - else - rc = vop->vop_bypass(ap); - return (rc); -} - struct vfsconf * vfs_byname(const char *name) { |