SELinux: more careful use of avd in avc_has_perm_noaudit
authorEric Paris <eparis@redhat.com>
Thu, 12 Feb 2009 19:50:49 +0000 (14:50 -0500)
committerJames Morris <jmorris@namei.org>
Fri, 13 Feb 2009 22:23:04 +0000 (09:23 +1100)
commit21193dcd1f3570ddfd8a04f4465e484c1f94252f
treeb6cab3861103261a3ab27ff3ea3485cb53af5a92
parent906d27d9d28fd50fb40026e56842d8f6806a7a04
SELinux: more careful use of avd in avc_has_perm_noaudit

we are often needlessly jumping through hoops when it comes to avd
entries in avc_has_perm_noaudit and we have extra initialization and memcpy
which are just wasting performance.  Try to clean the function up a bit.

This patch resulted in a 13% drop in time spent in avc_has_perm_noaudit in my
oprofile sampling of a tbench benchmark.

Signed-off-by: Eric Paris <eparis@redhat.com>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/avc.c