diff options
author | Ondrej Mosnacek <[email protected]> | 2020-04-17 10:11:56 +0200 |
---|---|---|
committer | Paul Moore <[email protected]> | 2020-04-17 16:04:34 -0400 |
commit | 50077289804c9bd4e6cfd5b3a10d4da0487f7e42 (patch) | |
tree | d0eec42d8fa215c2a80419f934159286d5d025d5 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | e67b2ec9f6171895e774f6543626913960e019df (diff) |
selinux: hash context structure directly
Always hashing the string representation is inefficient. Just hash the
contents of the structure directly (using jhash). If the context is
invalid (str & len are set), then hash the string as before, otherwise
hash the structured data.
Since the context hashing function is now faster (about 10 times), this
patch decreases the overhead of security_transition_sid(), which is
called from many hooks.
The jhash function seemed as a good choice, since it is used as the
default hashing algorithm in rhashtable.
Signed-off-by: Ondrej Mosnacek <[email protected]>
Reviewed-by: Jeff Vander Stoep <[email protected]>
Tested-by: Jeff Vander Stoep <[email protected]>
[PM: fixed some spelling errors in the comments pointed out by JVS]
Signed-off-by: Paul Moore <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions