Commit 3f058ef7787e1b48720622346de9a5317aeb749a

Authored by Eric Paris
1 parent be30b16d43

SELinux: generic hashtab entry counter

Instead of a hashtab entry counter function only useful for range
transition rules make a function generic for any hashtable to use.

Signed-off-by: Eric Paris <eparis@redhat.com>
Reviewed-by: James Morris <jmorris@namei.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

security/selinux/ss/policydb.c
... ... @@ -3066,7 +3066,7 @@
3066 3066 return 0;
3067 3067 }
3068 3068  
3069   -static int range_count(void *key, void *data, void *ptr)
  3069 +static int hashtab_cnt(void *key, void *data, void *ptr)
3070 3070 {
3071 3071 int *cnt = ptr;
3072 3072 *cnt = *cnt + 1;
... ... @@ -3114,7 +3114,7 @@
3114 3114  
3115 3115 /* count the number of entries in the hashtab */
3116 3116 nel = 0;
3117   - rc = hashtab_map(p->range_tr, range_count, &nel);
  3117 + rc = hashtab_map(p->range_tr, hashtab_cnt, &nel);
3118 3118 if (rc)
3119 3119 return rc;
3120 3120