From: Eric Paris Date: Thu, 28 Apr 2011 19:11:21 +0000 (-0400) Subject: SELinux: generic hashtab entry counter X-Git-Tag: tegra-l4t-r15-er2~4566^2^2~10 X-Git-Url: http://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git;a=commitdiff_plain;h=3f058ef7787e1b48720622346de9a5317aeb749a;hp=be30b16d43f4781406de0c08c96501dae4cc5a77 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 Reviewed-by: James Morris --- diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 70c863b..ca7a723 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -3066,7 +3066,7 @@ static int genfs_write(struct policydb *p, void *fp) 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; *cnt = *cnt + 1; @@ -3114,7 +3114,7 @@ static int range_write(struct policydb *p, void *fp) /* count the number of entries in the hashtab */ nel = 0; - rc = hashtab_map(p->range_tr, range_count, &nel); + rc = hashtab_map(p->range_tr, hashtab_cnt, &nel); if (rc) return rc;