From b51f1b3483893b7ecb449aa87bb41e93969625c7 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 3 Mar 1999 20:58:28 +0000 Subject: not using inline functions saves about 120K --- sys/kern/vnode_if.sh | 73 +++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 41 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/vnode_if.sh b/sys/kern/vnode_if.sh index e36b307c61e..855f5224fc8 100644 --- a/sys/kern/vnode_if.sh +++ b/sys/kern/vnode_if.sh @@ -33,7 +33,7 @@ copyright="\ * SUCH DAMAGE. */ " -SCRIPT_ID='$OpenBSD: vnode_if.sh,v 1.5 1999/03/03 14:23:19 deraadt Exp $' +SCRIPT_ID='$OpenBSD: vnode_if.sh,v 1.6 1999/03/03 20:58:27 deraadt Exp $' # SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.9 1996/02/29 20:58:22 cgd Exp $' # Script to produce VFS front-end sugar. @@ -164,19 +164,6 @@ extern struct vnodeop_desc vop_default_desc; echo '#include "systm.h"' -echo '#ifdef VOP_NOT_INLINE' -echo '#define STATIC_INLINE' -echo '#else' -echo '#define STATIC_INLINE static __inline' -echo '#endif' - -echo '#ifdef INTERNAL_VOP_NOT_INLINE' -echo '#define FUNC_STATIC_INLINE' -echo '#else' -echo '#undef FUNC_STATIC_INLINE' -echo '#define FUNC_STATIC_INLINE static __inline' -echo '#endif' - # Body stuff # This awk program needs toupper() so define it if necessary. sed -e "$sed_prep" $src | $awk "$toupper"' @@ -190,7 +177,7 @@ function doit() { printf("};\n"); printf("extern struct vnodeop_desc %s_desc;\n", name); # Prototype it. - protoarg = sprintf("STATIC_INLINE int %s __P((", toupper(name)); + protoarg = sprintf("int %s __P((", toupper(name)); protolen = length(protoarg); printf("%s", protoarg); for (i=0; iv_flag & VLOCKSWORK) && !VOP_ISLOCKED(%s)) panic(\"%s: %s\");\n", argname[i], argname[i], name, argname[i]); - printf ("#endif\n"); - } - } - printf("\treturn (VCALL(%s%s, VOFFSET(%s), &a));\n}\n", - argname[0], arg0special, name); - printf("#endif /* !VOP_NOT_INLINE */"); } BEGIN { arg0special=""; @@ -264,7 +227,6 @@ echo -n "$warning" | sed -e 's/\$//g' echo "" echo -n "$copyright" echo ' -#define INTERNAL_VOP_NOT_INLINE #include #include #include @@ -339,13 +301,42 @@ function doit() { do_offset("struct componentname *"); # transport layer information printf ("\tNULL,\n};\n"); + + # Define inline function. + printf("\nint %s(", toupper(name)); + for (i=0; iv_flag & VLOCKSWORK) && !VOP_ISLOCKED(%s)) panic(\"%s: %s\");\n", argname[i], argname[i], name, argname[i]); + printf ("#endif\n"); + } + } + printf("\treturn (VCALL(%s%s, VOFFSET(%s), &a));\n}\n", + argname[0], arg0special, name); + +} +BEGIN { + arg0special=""; } END { printf("\n/* Special cases: */\n"); argc=1; - argdir[0]="IN"; argtype[0]="struct buf *"; + argdir[0]="IN"; argname[0]="bp"; + shouldbelocked[0] = 0; + arg0special="->b_vp"; willrele[0]=0; name="vop_strategy"; doit(); -- cgit v1.2.3