policy: use the db->entries_hash to access the policy db entries
authorDjalal Harouni <tixxdz@opendz.org>
Fri, 20 Jun 2014 16:50:01 +0000 (17:50 +0100)
committerDaniel Mack <zonque@gmail.com>
Fri, 20 Jun 2014 17:44:03 +0000 (19:44 +0200)
Use the db->entries_hash to access the policy db entries instead of the
db->send_access_hash which is just a cache for send entries.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
policy.c

index e7e5ed9ec77b6fdc25c87f6485d1bc1c39bb2718..90db0ac60f8bfab9a5dc7d98a0d166649df24c7d 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -382,7 +382,7 @@ static void __kdbus_policy_remove_owner(struct kdbus_policy_db *db,
        struct hlist_node *tmp;
        int i;
 
-       hash_for_each_safe(db->send_access_hash, i, tmp, e, hentry)
+       hash_for_each_safe(db->entries_hash, i, tmp, e, hentry)
                if (e->owner == owner) {
                        hash_del(&e->hentry);
                        kdbus_policy_entry_free(e);
@@ -403,7 +403,8 @@ void kdbus_policy_remove_owner(struct kdbus_policy_db *db,
 }
 
 /**
- * kdbus_policy_remove_conn() - remove all entries related to a connection
+ * kdbus_policy_remove_conn() - remove all cached entries related to
+ *                             a connection
  * @db:                The policy database
  * @conn:      The connection which items to remove
  */
@@ -491,7 +492,7 @@ int kdbus_policy_set(struct kdbus_policy_db *db,
         * At the same time, the lookup mechanism won't find any collisions
         * when looking for already exising names.
         */
-       hash_for_each_safe(db->send_access_hash, i, tmp, e, hentry)
+       hash_for_each_safe(db->entries_hash, i, tmp, e, hentry)
                if (e->owner == owner) {
                        struct kdbus_policy_list_entry *l;