avc.c (9cdf083f981b8d37b3212400a359368661385099) avc.c (c376222960ae91d5ffb9197ee36771aaed1d9f90)
1/*
2 * Implementation of the kernel access vector cache (AVC).
3 *
4 * Authors: Stephen Smalley, <sds@epoch.ncsc.mil>
5 * James Morris <jmorris@redhat.com>
6 *
7 * Update: KaiGai, Kohei <kaigai@ak.jp.nec.com>
8 * Replaced the avc_lock spinlock by RCU.

--- 318 unchanged lines hidden (view full) ---

327out:
328 return ecx;
329}
330
331static struct avc_node *avc_alloc_node(void)
332{
333 struct avc_node *node;
334
1/*
2 * Implementation of the kernel access vector cache (AVC).
3 *
4 * Authors: Stephen Smalley, <sds@epoch.ncsc.mil>
5 * James Morris <jmorris@redhat.com>
6 *
7 * Update: KaiGai, Kohei <kaigai@ak.jp.nec.com>
8 * Replaced the avc_lock spinlock by RCU.

--- 318 unchanged lines hidden (view full) ---

327out:
328 return ecx;
329}
330
331static struct avc_node *avc_alloc_node(void)
332{
333 struct avc_node *node;
334
335 node = kmem_cache_alloc(avc_node_cachep, GFP_ATOMIC);
335 node = kmem_cache_zalloc(avc_node_cachep, GFP_ATOMIC);
336 if (!node)
337 goto out;
338
336 if (!node)
337 goto out;
338
339 memset(node, 0, sizeof(*node));
340 INIT_RCU_HEAD(&node->rhead);
341 INIT_LIST_HEAD(&node->list);
342 atomic_set(&node->ae.used, 1);
343 avc_cache_stats_incr(allocations);
344
345 if (atomic_inc_return(&avc_cache.active_nodes) > avc_cache_threshold)
346 avc_reclaim_node();
347

--- 567 unchanged lines hidden ---
339 INIT_RCU_HEAD(&node->rhead);
340 INIT_LIST_HEAD(&node->list);
341 atomic_set(&node->ae.used, 1);
342 avc_cache_stats_incr(allocations);
343
344 if (atomic_inc_return(&avc_cache.active_nodes) > avc_cache_threshold)
345 avc_reclaim_node();
346

--- 567 unchanged lines hidden ---