summaryrefslogtreecommitdiff
path: root/security/selinux/ss/avtab.h
diff options
context:
space:
mode:
authorStephen Smalley <sds@tycho.nsa.gov>2015-03-24 16:54:16 -0400
committerPaul Moore <pmoore@redhat.com>2015-04-06 20:16:20 -0400
commitba39db6e0519aa8362dbda6523ceb69349a18dc3 (patch)
tree0111ac00baee2c56dafd947f989264fa798b2c72 /security/selinux/ss/avtab.h
parentda8026fa0f9154b1c571c4d160dd51a7b8c34495 (diff)
selinux: convert avtab hash table to flex_array
Previously we shrank the avtab max hash buckets to avoid high order memory allocations, but this causes avtab lookups to degenerate to very long linear searches for the Fedora policy. Convert to using a flex_array instead so that we can increase the buckets without such limitations. This change does not alter the max hash buckets; that is left to a separate follow-on change. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'security/selinux/ss/avtab.h')
-rw-r--r--security/selinux/ss/avtab.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/selinux/ss/avtab.h b/security/selinux/ss/avtab.h
index 63ce2f9e441d..9318b2b8f6c9 100644
--- a/security/selinux/ss/avtab.h
+++ b/security/selinux/ss/avtab.h
@@ -23,6 +23,8 @@
#ifndef _SS_AVTAB_H_
#define _SS_AVTAB_H_
+#include <linux/flex_array.h>
+
struct avtab_key {
u16 source_type; /* source type */
u16 target_type; /* target type */
@@ -51,7 +53,7 @@ struct avtab_node {
};
struct avtab {
- struct avtab_node **htable;
+ struct flex_array *htable;
u32 nel; /* number of elements */
u32 nslot; /* number of hash slots */
u16 mask; /* mask to compute hash func */