diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-05-20 14:06:24 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-05-20 14:08:05 -0400 |
commit | 250f972d85effad5b6e10da4bbd877e6a4b503b6 (patch) | |
tree | 007393a6fc6439af7e0121dd99a6f9f9fb8405bc /security/selinux/avc.c | |
parent | 7372b0b122af0f6675f3ab65bfd91c8a438e0480 (diff) | |
parent | bbe7b8bef48c567f5ff3f6041c1fb011292e8f12 (diff) |
Merge branch 'timers/urgent' into timers/core
Reason: Get upstream fixes and kfree_rcu which is necessary for a
follow up patch.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'security/selinux/avc.c')
-rw-r--r-- | security/selinux/avc.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 1d027e29ce8d..3d2715fd35ea 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c | |||
@@ -38,11 +38,7 @@ | |||
38 | #define AVC_CACHE_RECLAIM 16 | 38 | #define AVC_CACHE_RECLAIM 16 |
39 | 39 | ||
40 | #ifdef CONFIG_SECURITY_SELINUX_AVC_STATS | 40 | #ifdef CONFIG_SECURITY_SELINUX_AVC_STATS |
41 | #define avc_cache_stats_incr(field) \ | 41 | #define avc_cache_stats_incr(field) this_cpu_inc(avc_cache_stats.field) |
42 | do { \ | ||
43 | per_cpu(avc_cache_stats, get_cpu()).field++; \ | ||
44 | put_cpu(); \ | ||
45 | } while (0) | ||
46 | #else | 42 | #else |
47 | #define avc_cache_stats_incr(field) do {} while (0) | 43 | #define avc_cache_stats_incr(field) do {} while (0) |
48 | #endif | 44 | #endif |
@@ -347,11 +343,10 @@ static struct avc_node *avc_lookup(u32 ssid, u32 tsid, u16 tclass) | |||
347 | node = avc_search_node(ssid, tsid, tclass); | 343 | node = avc_search_node(ssid, tsid, tclass); |
348 | 344 | ||
349 | if (node) | 345 | if (node) |
350 | avc_cache_stats_incr(hits); | 346 | return node; |
351 | else | ||
352 | avc_cache_stats_incr(misses); | ||
353 | 347 | ||
354 | return node; | 348 | avc_cache_stats_incr(misses); |
349 | return NULL; | ||
355 | } | 350 | } |
356 | 351 | ||
357 | static int avc_latest_notif_update(int seqno, int is_insert) | 352 | static int avc_latest_notif_update(int seqno, int is_insert) |
@@ -769,7 +764,7 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, | |||
769 | rcu_read_lock(); | 764 | rcu_read_lock(); |
770 | 765 | ||
771 | node = avc_lookup(ssid, tsid, tclass); | 766 | node = avc_lookup(ssid, tsid, tclass); |
772 | if (!node) { | 767 | if (unlikely(!node)) { |
773 | rcu_read_unlock(); | 768 | rcu_read_unlock(); |
774 | 769 | ||
775 | if (in_avd) | 770 | if (in_avd) |