SELinux: generic hashtab entry counter
authorEric Paris <eparis@redhat.com>
Thu, 28 Apr 2011 19:11:21 +0000 (15:11 -0400)
committerEric Paris <eparis@redhat.com>
Thu, 28 Apr 2011 19:15:52 +0000 (15:15 -0400)
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>
security/selinux/ss/policydb.c

index 70c863bf715eb4da710c29e6284ba4969767dd13..ca7a7231b5a23f249dc9a74322ce9f38865a5a56 100644 (file)
@@ -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;
 
This page took 0.029466 seconds and 5 git commands to generate.