policy: rename send_access_hash to talk_access_hash
authorDaniel Mack <zonque@gmail.com>
Thu, 14 Aug 2014 20:14:49 +0000 (22:14 +0200)
committerDaniel Mack <zonque@gmail.com>
Thu, 14 Aug 2014 20:16:02 +0000 (22:16 +0200)
We've already renamed the SEND policy to TALK for more clarity,
so let's do the same with the access hash.

policy.c
policy.h
test/test-kdbus-policy.c

index a946a6cebbf8977e1b2e20a9b1707e0d5e8e2b83..da27dc87105fa58f6014c42ec7d4eebe9cfdddd1 100644 (file)
--- 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);
index a9ff07b99bfd92092c844c08b8a6468cc1413df2..4c8d48d3784cfe6029e0e1bef3f9873b22b267d5 100644 (file)
--- 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;
 };
index 4f8e7636f8a8d045eacfc1dfeacf8b97980ba0ce..8d7bcb55c4625d1f37755b0dd53c948ebd3f241a 100644 (file)
@@ -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
  */