[systemd-devel] [PATCH 07/12] policy: use the db->entries_hash to access the policy db entries

Djalal Harouni tixxdz at opendz.org
Fri Jun 20 09:50:01 PDT 2014


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 at opendz.org>
---
 policy.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/policy.c b/policy.c
index bf49f68..79d6fa4 100644
--- a/policy.c
+++ b/policy.c
@@ -373,7 +373,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);
@@ -394,7 +394,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
  */
@@ -482,7 +483,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;
 
-- 
1.9.0



More information about the systemd-devel mailing list