summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-05-31 08:40:49 +0200
committerKay Sievers <kay@vrfy.org>2013-06-06 00:49:10 +0200
commitb5d9a58ac9e5c6e7c7b49803ee556bd0b9d040d7 (patch)
tree8731d582d9e8c5b2c4aa1e1481325b1c912df08d
parentd59e18aa66a2d17714c0ec9b60d1a2a2e81e6c24 (diff)
downloadkdbus-bus-b5d9a58ac9e5c6e7c7b49803ee556bd0b9d040d7.tar.gz
kdbus-bus-b5d9a58ac9e5c6e7c7b49803ee556bd0b9d040d7.tar.bz2
kdbus-bus-b5d9a58ac9e5c6e7c7b49803ee556bd0b9d040d7.zip
prefix all functions with kdbus_
-rw-r--r--TODO1
-rw-r--r--connection.c14
-rw-r--r--memfd.c4
-rw-r--r--memfd.h4
-rw-r--r--policy.c14
5 files changed, 18 insertions, 19 deletions
diff --git a/TODO b/TODO
index 05034560522..e8ec0db6f60 100644
--- a/TODO
+++ b/TODO
@@ -5,7 +5,6 @@ Internal:
- update/rethink kdbus_conn_accounting_sub_size() use, we don't allocate
kernel memory anymore
- memfd's file pos is shared, which can be confusing, document pread/pwrite
- - prefix all functions with kdbus_
- conn->ep->bus ==> conn->bus
Kernel Core:
diff --git a/connection.c b/connection.c
index 6b6dc35d104..66daa8a43eb 100644
--- a/connection.c
+++ b/connection.c
@@ -147,14 +147,14 @@ static int kdbus_conn_memfd_ref(const struct kdbus_item *item,
/* We only accept kdbus_memfd files as payload, other files need to
* be passed with KDBUS_MSG_FDS. */
- if (!is_kdbus_memfd(fp)) {
+ if (!kdbus_is_memfd(fp)) {
ret = -EMEDIUMTYPE;
goto exit_unref;
}
/* We only accept a sealed memfd file whose content cannot be altered
* by the sender or anybody else while it is shared or in-flight. */
- if (!is_kdbus_memfd_sealed(fp)) {
+ if (!kdbus_is_memfd_sealed(fp)) {
ret = -ETXTBSY;
goto exit_unref;
}
@@ -1003,7 +1003,7 @@ static int kdbus_conn_release(struct inode *inode, struct file *file)
return 0;
}
-static bool check_flags(u64 kernel_flags)
+static bool kdbus_check_flags(u64 kernel_flags)
{
/* The higher 32bit are considered 'incompatible
* flags'. Refuse them all for now */
@@ -1035,7 +1035,7 @@ static long kdbus_conn_ioctl_control(struct file *file, unsigned int cmd,
if (ret < 0)
break;
- if (!check_flags(bus_kmake->make.flags)) {
+ if (!kdbus_check_flags(bus_kmake->make.flags)) {
ret = -ENOTSUPP;
break;
}
@@ -1068,7 +1068,7 @@ static long kdbus_conn_ioctl_control(struct file *file, unsigned int cmd,
if (ret < 0)
break;
- if (!check_flags(ns_kmake->make.flags)) {
+ if (!kdbus_check_flags(ns_kmake->make.flags)) {
ret = -ENOTSUPP;
break;
}
@@ -1132,7 +1132,7 @@ static long kdbus_conn_ioctl_ep(struct file *file, unsigned int cmd,
if (ret < 0)
break;
- if (!check_flags(kmake->make.flags)) {
+ if (!kdbus_check_flags(kmake->make.flags)) {
ret = -ENOTSUPP;
break;
}
@@ -1180,7 +1180,7 @@ static long kdbus_conn_ioctl_ep(struct file *file, unsigned int cmd,
}
hello = v;
- if (!check_flags(hello->conn_flags)) {
+ if (!kdbus_check_flags(hello->conn_flags)) {
ret = -ENOTSUPP;
break;
}
diff --git a/memfd.c b/memfd.c
index 8d38361e377..4d95b0498c4 100644
--- a/memfd.c
+++ b/memfd.c
@@ -35,12 +35,12 @@ struct kdbus_memfile {
struct file *fp;
};
-bool is_kdbus_memfd(const struct file *fp)
+bool kdbus_is_memfd(const struct file *fp)
{
return fp->f_op == &kdbus_memfd_fops;
}
-bool is_kdbus_memfd_sealed(const struct file *fp)
+bool kdbus_is_memfd_sealed(const struct file *fp)
{
struct kdbus_memfile *mf = fp->private_data;
bool sealed;
diff --git a/memfd.h b/memfd.h
index 4a2b39e1031..92929dc5d0d 100644
--- a/memfd.h
+++ b/memfd.h
@@ -15,8 +15,8 @@
#include "internal.h"
-bool is_kdbus_memfd(const struct file *fp);
-bool is_kdbus_memfd_sealed(const struct file *fp);
+bool kdbus_is_memfd(const struct file *fp);
+bool kdbus_is_memfd_sealed(const struct file *fp);
u64 kdbus_memfd_size(const struct file *fp);
int kdbus_memfd_new(int *fd);
#endif
diff --git a/policy.c b/policy.c
index e1aacda02d0..8364ba7b323 100644
--- a/policy.c
+++ b/policy.c
@@ -161,7 +161,7 @@ struct kdbus_policy_db *kdbus_policy_db_new(void)
return db;
}
-static inline u64 collect_entry_accesses(struct kdbus_policy_db_entry *db_entry,
+static inline u64 kdbus_collect_entry_accesses(struct kdbus_policy_db_entry *db_entry,
struct kdbus_conn *conn)
{
struct kdbus_policy_db_entry_access *a;
@@ -208,7 +208,7 @@ static int __kdbus_policy_db_check_send_access(struct kdbus_policy_db *db,
if (strcmp(db_entry->name, name_entry->name) != 0)
continue;
- access = collect_entry_accesses(db_entry, conn_src);
+ access = kdbus_collect_entry_accesses(db_entry, conn_src);
if (access & KDBUS_POLICY_SEND)
return 0;
}
@@ -220,7 +220,7 @@ static int __kdbus_policy_db_check_send_access(struct kdbus_policy_db *db,
if (strcmp(db_entry->name, name_entry->name) != 0)
continue;
- access = collect_entry_accesses(db_entry, conn_dst);
+ access = kdbus_collect_entry_accesses(db_entry, conn_dst);
if (access & KDBUS_POLICY_RECV)
return 0;
}
@@ -246,7 +246,7 @@ kdbus_policy_cache_entry_new(struct kdbus_conn *conn_a,
return ce;
}
-static int add_reverse_cache_entry(struct kdbus_policy_db *db,
+static int kdbus_add_reverse_cache_entry(struct kdbus_policy_db *db,
struct kdbus_policy_db_cache_entry *ce,
u64 reply_deadline_ns)
{
@@ -291,7 +291,7 @@ int kdbus_policy_db_check_send_access(struct kdbus_policy_db *db,
mutex_unlock(&db->cache_lock);
/* do we need a temporaty rule for replies? */
if (reply_deadline_ns)
- ret = add_reverse_cache_entry(db, ce, reply_deadline_ns);
+ ret = kdbus_add_reverse_cache_entry(db, ce, reply_deadline_ns);
return ret;
}
mutex_unlock(&db->cache_lock);
@@ -312,7 +312,7 @@ int kdbus_policy_db_check_send_access(struct kdbus_policy_db *db,
/* do we need a temporaty rule for replies? */
if (reply_deadline_ns)
- ret = add_reverse_cache_entry(db, ce, reply_deadline_ns);
+ ret = kdbus_add_reverse_cache_entry(db, ce, reply_deadline_ns);
}
exit_unlock_entries:
@@ -354,7 +354,7 @@ int kdbus_policy_db_check_own_access(struct kdbus_policy_db *db,
if (strcmp(db_entry->name, name) != 0)
continue;
- access = collect_entry_accesses(db_entry, conn);
+ access = kdbus_collect_entry_accesses(db_entry, conn);
if (access & KDBUS_POLICY_OWN) {
ret = 0;
goto exit_unlock;