Commit 3f058ef7 authored by Eric Paris's avatar Eric Paris

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: default avatarEric Paris <eparis@redhat.com>
Reviewed-by: default avatarJames Morris <jmorris@namei.org>
parent be30b16d
...@@ -3066,7 +3066,7 @@ static int genfs_write(struct policydb *p, void *fp) ...@@ -3066,7 +3066,7 @@ static int genfs_write(struct policydb *p, void *fp)
return 0; return 0;
} }
static int range_count(void *key, void *data, void *ptr) static int hashtab_cnt(void *key, void *data, void *ptr)
{ {
int *cnt = ptr; int *cnt = ptr;
*cnt = *cnt + 1; *cnt = *cnt + 1;
...@@ -3114,7 +3114,7 @@ static int range_write(struct policydb *p, void *fp) ...@@ -3114,7 +3114,7 @@ static int range_write(struct policydb *p, void *fp)
/* count the number of entries in the hashtab */ /* count the number of entries in the hashtab */
nel = 0; nel = 0;
rc = hashtab_map(p->range_tr, range_count, &nel); rc = hashtab_map(p->range_tr, hashtab_cnt, &nel);
if (rc) if (rc)
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment