summaryrefslogtreecommitdiffstats
path: root/sys/tools
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-02-08 12:54:32 +0000
committerphk <phk@FreeBSD.org>2005-02-08 12:54:32 +0000
commitc312924f2d9921133f9fcf4bcc365f997b1f75ac (patch)
treeb9b06f46a3db2d193e35c87457b50eda0e435ab5 /sys/tools
parent80eee84ab50470b0d3b454cd420c5fe8a2b70dd5 (diff)
downloadFreeBSD-src-c312924f2d9921133f9fcf4bcc365f997b1f75ac.zip
FreeBSD-src-c312924f2d9921133f9fcf4bcc365f997b1f75ac.tar.gz
Add VOP_FOO_APV() which takes a pointer to the vop_vector.
This allows stacked or partitioned filesystems to say "Continue the normal resolution from here", for instace from FFS to UFS. Use VNASSERT() instead of KASSERT().
Diffstat (limited to 'sys/tools')
-rw-r--r--sys/tools/vnode_if.awk17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk
index 7acf145..97cefd9 100644
--- a/sys/tools/vnode_if.awk
+++ b/sys/tools/vnode_if.awk
@@ -174,6 +174,7 @@ if (cfile) {
"#include <sys/param.h>\n" \
"#include <sys/systm.h>\n" \
"#include <sys/vnode.h>\n" \
+ "#include <sys/systm.h>\n" \
"\n" \
"struct vnodeop_desc vop_default_desc = {\n" \
" \"default\",\n" \
@@ -306,6 +307,7 @@ while ((getline < srcfile) > 0) {
# Print out function prototypes.
printh("int " uname "_AP(struct " name "_args *);");
+ printh("int " uname "_APV(struct vop_vector *vop, struct " name "_args *);");
printh("");
printh("static __inline int " uname "(");
for (i = 0; i < numargs; ++i) {
@@ -318,7 +320,7 @@ while ((getline < srcfile) > 0) {
printh("\ta.a_gen.a_desc = &" name "_desc;");
for (i = 0; i < numargs; ++i)
printh("\ta.a_" args[i] " = " args[i] ";");
- printh("\treturn (" uname "_AP(&a));");
+ printh("\treturn (" uname "_APV("args[0]"->v_op, &a));");
printh("}");
printh("");
@@ -350,16 +352,19 @@ while ((getline < srcfile) > 0) {
# Print out function.
printc("\nint\n" uname "_AP(struct " name "_args *a)");
printc("{");
+ printc("");
+ printc("\treturn(" uname "_APV(a->a_" args[0] "->v_op, a));");
+ printc("}");
+ printc("\nint\n" uname "_APV(struct vop_vector *vop, struct " name "_args *a)");
+ printc("{");
printc("\tint rc;");
- printc("\tstruct vnode *vp = a->a_" args[0]";");
- printc("\tstruct vop_vector *vop = vp->v_op;");
printc("");
- printc("\tKASSERT(a->a_gen.a_desc == &" name "_desc,");
- printc("\t (\"Wrong a_desc in " name "(%p, %p)\", vp, a));");
+ printc("\tVNASSERT(a->a_gen.a_desc == &" name "_desc, a->a_" args[0]",");
+ printc("\t (\"Wrong a_desc in " name "(%p, %p)\", a->a_" args[0]", a));");
printc("\twhile(vop != NULL && \\");
printc("\t vop->"name" == NULL && vop->vop_bypass == NULL)")
printc("\t\tvop = vop->vop_default;")
- printc("\tKASSERT(vop != NULL, (\"No "name"(%p, %p)\", vp, a));")
+ printc("\tVNASSERT(vop != NULL, a->a_" args[0]", (\"No "name"(%p, %p)\", a->a_" args[0]", a));")
for (i = 0; i < numargs; ++i)
add_debug_code(name, args[i], "Entry", "\t");
add_debug_pre(name);
OpenPOWER on IntegriCloud