Deleted Added
full compact
33c33
< # $FreeBSD: head/sys/tools/vnode_if.awk 139825 2005-01-07 02:29:27Z imp $
---
> # $FreeBSD: head/sys/tools/vnode_if.awk 140165 2005-01-13 07:53:01Z phk $
65c65
< function add_debug_code(name, arg, pos)
---
> function add_debug_code(name, arg, pos, ind)
68c68,70
< arg = "*vpp";
---
> star = "*";
> else
> star = "";
71c73
< printh("\tif ("substr(arg, 2)" != NULL) {");
---
> printc(ind"if ("substr(arg, 2)" != NULL) {");
73c75
< printh("\tASSERT_VI_UNLOCKED("arg", \""uname"\");");
---
> printc(ind"ASSERT_VI_UNLOCKED("star"a->a_"arg", \""uname"\");");
76c78
< printh("\tASSERT_VOP_LOCKED("arg", \""uname"\");");
---
> printc(ind"ASSERT_VOP_LOCKED(" star "a->a_"arg", \""uname"\");");
78c80
< printh("\tASSERT_VOP_UNLOCKED("arg", \""uname"\");");
---
> printc(ind"ASSERT_VOP_UNLOCKED(" star "a->a_"arg", \""uname"\");");
83c85
< printh("\t}");
---
> printc("ind}");
91,93c93,95
< printh("#ifdef DEBUG_VFS_LOCKS");
< printh("\t"lockdata[name, "pre"]"(&a);");
< printh("#endif");
---
> printc("#ifdef DEBUG_VFS_LOCKS");
> printc("\t"lockdata[name, "pre"]"(a);");
> printc("#endif");
100,102c102,104
< printh("#ifdef DEBUG_VFS_LOCKS");
< printh("\t"lockdata[name, "post"]"(&a, rc);");
< printh("#endif");
---
> printc("#ifdef DEBUG_VFS_LOCKS");
> printc("\t"lockdata[name, "post"]"(a, rc);");
> printc("#endif");
149c151
< " * Created from $FreeBSD: head/sys/tools/vnode_if.awk 139825 2005-01-07 02:29:27Z imp $\n" \
---
> " * Created from $FreeBSD: head/sys/tools/vnode_if.awk 140165 2005-01-13 07:53:01Z phk $\n" \
162,163d163
< printq("struct vop_generic_args;")
< printq("typedef int vop_bypass_t(struct vop_generic_args *);\n")
179d178
< " 1,\t\t\t/* special case, vop_default => 1 */\n" \
181a181
> " (void *)(uintptr_t)vop_panic,\n" \
199,200d198
< if ($3 == "vpp")
< $3 = "*vpp";
283,285c281,284
< ctrstr = "\tCTR" ctrargs "(KTR_VOP, " ctrstr ")\"";
< for (i = 0; i < ctrargs; ++i)
< ctrstr = ctrstr ", " args[i];
---
> ctrstr = "\tCTR" ctrargs "(KTR_VOP,\n\t " ctrstr ")\",\n\t ";
> ctrstr = ctrstr "a->a_" args[0];
> for (i = 1; i < ctrargs; ++i)
> ctrstr = ctrstr ", a->a_" args[i];
301a301
> printh("");
304a305
> printh("");
306c307,309
< # Print out function.
---
> # Print out function prototypes.
> printh("int " uname "_AP(struct " name "_args *);");
> printh("");
312,313c315,317
< printh("{\n\tstruct " name "_args a;");
< printh("\tint rc;");
---
> printh("{");
> printh("\tstruct " name "_args a;");
> printh("");
317,336c321
< for (i = 0; i < numargs; ++i)
< add_debug_code(name, args[i], "Entry");
< add_debug_pre(name);
< printh("\t{")
< printh("\t\tstruct vop_vector *vop = "args[0]"->v_op;")
< printh("\t\twhile(vop != NULL && vop->"name" == NULL && vop->vop_bypass == NULL)")
< printh("\t\t\tvop = vop->vop_default;")
< printh("\t\tKASSERT(vop != NULL, (\"No "name"(%p...)\", "args[0]"));")
< printh("\t\tif (vop->"name" != NULL)")
< printh("\t\t\trc = vop->"name"(&a);")
< printh("\t\telse")
< printh("\t\t\trc = vop->vop_bypass(&a.a_gen);")
< printh("\t}")
< printh(ctrstr);
< printh("if (rc == 0) {");
< for (i = 0; i < numargs; ++i)
< add_debug_code(name, args[i], "OK");
< printh("} else {");
< for (i = 0; i < numargs; ++i)
< add_debug_code(name, args[i], "Error");
---
> printh("\treturn (" uname "_AP(&a));");
338,339c323,324
< add_debug_post(name);
< printh("\treturn (rc);\n}");
---
>
> printh("");
364a350,381
> # Print out function.
> printc("\nint\n" uname "_AP(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 == VDESC(" name "),");
> printc("\t (\"Wrong a_desc in " name "(%p, %p)\", vp, 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));")
> for (i = 0; i < numargs; ++i)
> add_debug_code(name, args[i], "Entry", "\t");
> add_debug_pre(name);
> printc("\tif (vop->"name" != NULL)")
> printc("\t\trc = vop->"name"(a);")
> printc("\telse")
> printc("\t\trc = vop->vop_bypass(&a->a_gen);")
> printc(ctrstr);
> printc("\tif (rc == 0) {");
> for (i = 0; i < numargs; ++i)
> add_debug_code(name, args[i], "OK", "\t\t");
> printc("\t} else {");
> for (i = 0; i < numargs; ++i)
> add_debug_code(name, args[i], "Error", "\t\t");
> printc("\t}");
> add_debug_post(name);
> printc("\treturn (rc);");
> printc("}\n");
>
367,368d383
< # offset
< printc("\toffsetof(struct vop_vector, "name"),");
383a399,400
> # function to call
> printc("\t(void*)(uintptr_t)" uname "_AP,");