verify: Start introducing flags to control what to verify
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 4f21456..89578da 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -126,7 +126,7 @@
 		}
 	}
 
-	verify_file_operations(new_fops);
+	verify_file_operations(new_fops, VERIFY_OWNER | VERIFY_ALWAYS);
 		
 	if (!new_fops) {
 		mutex_unlock(&misc_mtx);
@@ -190,7 +190,7 @@
 	dev_t dev;
 	int err = 0;
 
-	verify_file_operations(misc->fops);
+	verify_file_operations(misc->fops, VERIFY_OWNER | VERIFY_ALWAYS);
 
 	INIT_LIST_HEAD(&misc->list);
 
diff --git a/fs/char_dev.c b/fs/char_dev.c
index d99850d..ecd3013 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -270,7 +270,7 @@
 	struct cdev *cdev;
 	int err = -ENOMEM;
 
-	verify_file_operations(fops);
+	verify_file_operations(fops, VERIFY_OWNER | VERIFY_ALWAYS);
 
 	cd = __register_chrdev_region(major, baseminor, count, name);
 	if (IS_ERR(cd))
@@ -546,7 +546,7 @@
 {
 	memset(cdev, 0, sizeof *cdev);
 	INIT_LIST_HEAD(&cdev->list);
-	verify_file_operations(fops);
+	verify_file_operations(fops, VERIFY_OWNER | VERIFY_ALWAYS);
 	kobject_init(&cdev->kobj, &ktype_cdev_default);
 	cdev->ops = fops;
 }
diff --git a/include/linux/verify.h b/include/linux/verify.h
index 3453ced..8f0c27d 100644
--- a/include/linux/verify.h
+++ b/include/linux/verify.h
@@ -7,11 +7,19 @@
 struct super_block;
 struct file;
 
+
+/* Various flags that control the verification behavior */
+
+/* Disable statistical verification */
+#define VERIFY_ALWAYS	1
+/* verify the .owner field of structures */
+#define VERIFY_OWNER	2
+
 #ifdef CONFIG_VERIFY
 
 
 int verify_super_block(const struct super_block *sb);
-int verify_file_operations(const struct file_operations *fops); 
+int verify_file_operations(const struct file_operations *fops, unsigned long flags); 
 int verify_struct_file(struct file *filp);
 int verify_address_space(const struct address_space *as);
 int verify_function_ptr(void *ptr);
@@ -20,7 +28,7 @@
 #else 
 
 static inline int verify_super_block(const struct super_block *sb) { return 0; }
-static inline int verify_file_operations(const struct file_operations *fops) { return 0; }
+static inline int verify_file_operations(const struct file_operations *fops, unsigned long flags) { return 0; }
 static inline int verify_struct_file(struct file *filp) { return 0; }
 static inline int verify_address_space(const struct address_space *as) { return 0; }
 static inline int verify_function_ptr(void *ptr) { return 0; }
diff --git a/lib/verify.c b/lib/verify.c
index f57e754..74d4b3c 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -16,7 +16,7 @@
 	return ret;
 }
 
-int verify_file_operations(const struct file_operations *fops)
+int verify_file_operations(const struct file_operations *fops, unsigned long flags)
 {
 	int ret = 0;
 
@@ -29,7 +29,7 @@
 	}
 
 	/* check if owner is set correctly */
-	if (fops->owner != __module_address((unsigned long)fops)) {
+	if (flags & VERIFY_OWNER && fops->owner != __module_address((unsigned long)fops)) {
 		WARN_ONCE(1, "struct file_operations %pS has .owner not set correctly", fops);
 		ret = -EINVAL;
 	}
@@ -44,7 +44,7 @@
 	if (IS_ERR_OR_NULL(filp))
 		return 0;
 
-	if (verify_file_operations(filp->f_op)) {
+	if (verify_file_operations(filp->f_op, VERIFY_ALWAYS)) {
 		WARN_ONCE(1, "struct file %pS does not have a const f_ops %pS\n", filp, filp->f_op);
 		ret = -EINVAL;
 	}