From 0835f7b4a9a7e80823912ce250d4082b5a23a401 Mon Sep 17 00:00:00 2001 From: ssouhlal Date: Thu, 9 Jun 2005 20:20:31 +0000 Subject: Allow EVFILT_VNODE events to work on every filesystem type, not just UFS by: - Making the pre and post hooks for the VOP functions work even when DEBUG_VFS_LOCKS is not defined. - Moving the KNOTE activations into the corresponding VOP hooks. - Creating a MNTK_NOKNOTE flag for the mnt_kern_flag field of struct mount that permits filesystems to disable the new behavior. - Creating a default VOP_KQFILTER function: vfs_kqfilter() My benchmarks have not revealed any performance degradation. Reviewed by: jeff, bde Approved by: rwatson, jmg (kqueue changes), grehan (mentor) --- sys/tools/vnode_if.awk | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'sys/tools') diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index 2d6d1e1..8c992fe 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -89,21 +89,17 @@ function add_debug_code(name, arg, pos, ind) } } -function add_debug_pre(name) +function add_pre(name) { if (lockdata[name, "pre"]) { - printc("#ifdef DEBUG_VFS_LOCKS"); printc("\t"lockdata[name, "pre"]"(a);"); - printc("#endif"); } } -function add_debug_post(name) +function add_post(name) { if (lockdata[name, "post"]) { - printc("#ifdef DEBUG_VFS_LOCKS"); printc("\t"lockdata[name, "post"]"(a, rc);"); - printc("#endif"); } } @@ -174,9 +170,10 @@ if (hfile) { if (cfile) { printc(common_head \ "#include \n" \ + "#include \n" \ + "#include \n" \ "#include \n" \ "#include \n" \ - "#include \n" \ "\n" \ "struct vnodeop_desc vop_default_desc = {\n" \ " \"default\",\n" \ @@ -369,7 +366,7 @@ while ((getline < srcfile) > 0) { 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); + add_pre(name); printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") @@ -382,7 +379,7 @@ while ((getline < srcfile) > 0) { for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Error", "\t\t"); printc("\t}"); - add_debug_post(name); + add_post(name); printc("\treturn (rc);"); printc("}\n"); -- cgit v1.1