···11361136 struct audit_watch *watch = entry->rule.watch;11371137 struct nameidata *ndp, *ndw;11381138 int h, err, putnd_needed = 0;11391139+#ifdef CONFIG_AUDITSYSCALL11401140+ int dont_count = 0;11411141+11421142+ /* If either of these, don't count towards total */11431143+ if (entry->rule.listnr == AUDIT_FILTER_USER ||11441144+ entry->rule.listnr == AUDIT_FILTER_TYPE)11451145+ dont_count = 1;11461146+#endif1139114711401148 if (inode_f) {11411149 h = audit_hash_ino(inode_f->val);···11841176 } else {11851177 list_add_tail_rcu(&entry->list, list);11861178 }11791179+#ifdef CONFIG_AUDITSYSCALL11801180+ if (!dont_count)11811181+ audit_n_rules++;11821182+#endif11871183 mutex_unlock(&audit_filter_mutex);1188118411891185 if (putnd_needed)···12121200 struct audit_watch *watch, *tmp_watch = entry->rule.watch;12131201 LIST_HEAD(inotify_list);12141202 int h, ret = 0;12031203+#ifdef CONFIG_AUDITSYSCALL12041204+ int dont_count = 0;12051205+12061206+ /* If either of these, don't count towards total */12071207+ if (entry->rule.listnr == AUDIT_FILTER_USER ||12081208+ entry->rule.listnr == AUDIT_FILTER_TYPE)12091209+ dont_count = 1;12101210+#endif1215121112161212 if (inode_f) {12171213 h = audit_hash_ino(inode_f->val);···12571237 list_del_rcu(&e->list);12581238 call_rcu(&e->rcu, audit_free_rule_rcu);1259123912401240+#ifdef CONFIG_AUDITSYSCALL12411241+ if (!dont_count)12421242+ audit_n_rules--;12431243+#endif12601244 mutex_unlock(&audit_filter_mutex);1261124512621246 if (!list_empty(&inotify_list))
+3
kernel/auditsc.c
···8585/* Indicates that audit should log the full pathname. */8686#define AUDIT_NAME_FULL -187878888+/* number of audit rules */8989+int audit_n_rules;9090+8891/* When fs/namei.c:getname() is called, we store the pointer in name and8992 * we don't let putname() free it (instead we free all of the saved9093 * pointers at syscall exit time).