diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-19 21:22:53 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-19 21:22:53 -0700 |
commit | 257313b2a87795e07a0bdf58d0fffbdba8b31051 (patch) | |
tree | ff5043526b0381cdc1f1f68d3c6f8ed3635e0ddb /security/selinux/selinuxfs.c | |
parent | 044aea9b83614948c98564000db07d1d32b2d29b (diff) | |
download | op-kernel-dev-257313b2a87795e07a0bdf58d0fffbdba8b31051.zip op-kernel-dev-257313b2a87795e07a0bdf58d0fffbdba8b31051.tar.gz |
selinux: avoid unnecessary avc cache stat hit count
There is no point in counting hits - we can calculate it from the number
of lookups and misses.
This makes the avc statistics a bit smaller, and makes the code
generation better too.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/selinux/selinuxfs.c')
-rw-r--r-- | security/selinux/selinuxfs.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index ea39cb7..c0e1a0f 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -1380,10 +1380,14 @@ static int sel_avc_stats_seq_show(struct seq_file *seq, void *v) if (v == SEQ_START_TOKEN) seq_printf(seq, "lookups hits misses allocations reclaims " "frees\n"); - else - seq_printf(seq, "%u %u %u %u %u %u\n", st->lookups, - st->hits, st->misses, st->allocations, + else { + unsigned int lookups = st->lookups; + unsigned int misses = st->misses; + unsigned int hits = lookups - misses; + seq_printf(seq, "%u %u %u %u %u %u\n", lookups, + hits, misses, st->allocations, st->reclaims, st->frees); + } return 0; } |