Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132625
b: refs/heads/master
c: 906d27d
h: refs/heads/master
i:
  132623: 69a2550
v: v3
  • Loading branch information
Eric Paris authored and James Morris committed Feb 13, 2009
1 parent 38c19b3 commit fe8a520
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a5dda683328f99c781f92c66cc52ffc0639bef58
refs/heads/master: 906d27d9d28fd50fb40026e56842d8f6806a7a04
28 changes: 7 additions & 21 deletions trunk/security/selinux/avc.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ struct avc_entry {
u32 tsid;
u16 tclass;
struct av_decision avd;
atomic_t used; /* used recently */
};

struct avc_node {
Expand Down Expand Up @@ -316,16 +315,13 @@ static inline int avc_reclaim_node(void)

rcu_read_lock();
list_for_each_entry(node, &avc_cache.slots[hvalue], list) {
if (atomic_dec_and_test(&node->ae.used)) {
/* Recently Unused */
avc_node_delete(node);
avc_cache_stats_incr(reclaims);
ecx++;
if (ecx >= AVC_CACHE_RECLAIM) {
rcu_read_unlock();
spin_unlock_irqrestore(&avc_cache.slots_lock[hvalue], flags);
goto out;
}
avc_node_delete(node);
avc_cache_stats_incr(reclaims);
ecx++;
if (ecx >= AVC_CACHE_RECLAIM) {
rcu_read_unlock();
spin_unlock_irqrestore(&avc_cache.slots_lock[hvalue], flags);
goto out;
}
}
rcu_read_unlock();
Expand All @@ -345,7 +341,6 @@ static struct avc_node *avc_alloc_node(void)

INIT_RCU_HEAD(&node->rhead);
INIT_LIST_HEAD(&node->list);
atomic_set(&node->ae.used, 1);
avc_cache_stats_incr(allocations);

if (atomic_inc_return(&avc_cache.active_nodes) > avc_cache_threshold)
Expand Down Expand Up @@ -378,15 +373,6 @@ static inline struct avc_node *avc_search_node(u32 ssid, u32 tsid, u16 tclass)
}
}

if (ret == NULL) {
/* cache miss */
goto out;
}

/* cache hit */
if (atomic_read(&ret->ae.used) != 1)
atomic_set(&ret->ae.used, 1);
out:
return ret;
}

Expand Down

0 comments on commit fe8a520

Please sign in to comment.