From 776d1cf80bd80db51f507b46744c7e4d16ce6ad1 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Thu, 14 Aug 2014 22:14:49 +0200 Subject: [PATCH] policy: rename send_access_hash to talk_access_hash We've already renamed the SEND policy to TALK for more clarity, so let's do the same with the access hash. --- policy.c | 10 +++++----- policy.h | 4 ++-- test/test-kdbus-policy.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/policy.c b/policy.c index a946a6c..da27dc8 100644 --- a/policy.c +++ b/policy.c @@ -149,7 +149,7 @@ void kdbus_policy_db_free(struct kdbus_policy_db *db) /* purge cache */ mutex_lock(&db->cache_lock); - hash_for_each_safe(db->send_access_hash, i, tmp, ce, hentry) { + hash_for_each_safe(db->talk_access_hash, i, tmp, ce, hentry) { hash_del(&ce->hentry); kfree(ce); } @@ -175,7 +175,7 @@ int kdbus_policy_db_new(struct kdbus_policy_db **db) return -ENOMEM; hash_init(d->entries_hash); - hash_init(d->send_access_hash); + hash_init(d->talk_access_hash); mutex_init(&d->entries_lock); mutex_init(&d->cache_lock); @@ -327,7 +327,7 @@ int kdbus_policy_check_talk_access(struct kdbus_policy_db *db, hash ^= hash_ptr(conn_dst, KDBUS_POLICY_HASH_SIZE); mutex_lock(&db->cache_lock); - hash_for_each_possible(db->send_access_hash, ce, hentry, hash) + hash_for_each_possible(db->talk_access_hash, ce, hentry, hash) if (ce->conn_a == conn_src && ce->conn_b == conn_dst) { mutex_unlock(&db->cache_lock); return 0; @@ -348,7 +348,7 @@ int kdbus_policy_check_talk_access(struct kdbus_policy_db *db, } mutex_lock(&db->cache_lock); - hash_add(db->send_access_hash, &ce->hentry, hash); + hash_add(db->talk_access_hash, &ce->hentry, hash); mutex_unlock(&db->cache_lock); } @@ -416,7 +416,7 @@ void kdbus_policy_remove_conn(struct kdbus_policy_db *db, int i; mutex_lock(&db->cache_lock); - hash_for_each_safe(db->send_access_hash, i, tmp, ce, hentry) + hash_for_each_safe(db->talk_access_hash, i, tmp, ce, hentry) if (ce->conn_a == conn || ce->conn_b == conn) { hash_del(&ce->hentry); kfree(ce); diff --git a/policy.h b/policy.h index a9ff07b..4c8d48d 100644 --- a/policy.h +++ b/policy.h @@ -18,13 +18,13 @@ struct kdbus_conn; /** * struct kdbus_policy_db - policy database * @entries_hash: Hashtable of entries - * @send_access_hash: Hashtable of send access elements + * @talk_access_hash: Hashtable of send access elements * @entries_lock: Mutex to protect the database's access entries * @cache_lock: Mutex to protect the database's cache */ struct kdbus_policy_db { DECLARE_HASHTABLE(entries_hash, 6); - DECLARE_HASHTABLE(send_access_hash, 6); + DECLARE_HASHTABLE(talk_access_hash, 6); struct mutex entries_lock; struct mutex cache_lock; }; diff --git a/test/test-kdbus-policy.c b/test/test-kdbus-policy.c index 4f8e763..8d7bcb5 100644 --- a/test/test-kdbus-policy.c +++ b/test/test-kdbus-policy.c @@ -33,7 +33,7 @@ /** * The purpose of these tests: * 1) Check KDBUS_POLICY_TALK - * 2) Check the cache state: kdbus_policy_db->send_access_hash + * 2) Check the cache state: kdbus_policy_db->talk_access_hash * Should be extended */ -- 2.34.1