kdbus.h: rename kdbus_{cmd,}_conn_info → kdbus_{cmd,}_info
authorDaniel Mack <daniel@zonque.org>
Wed, 22 Oct 2014 16:36:45 +0000 (18:36 +0200)
committerDaniel Mack <daniel@zonque.org>
Wed, 22 Oct 2014 16:36:45 +0000 (18:36 +0200)
As we now use kdbus_cmd_conn_info and kdbus_conn_info for bus creator
information as well, rename the structs to a more generic term.

Signed-off-by: Daniel Mack <daniel@zonque.org>
12 files changed:
bus.c
bus.h
connection.c
connection.h
handle.c
kdbus.h
kdbus.txt
test/kdbus-util.c
test/kdbus-util.h
test/test-bus.c
test/test-connection.c
test/test-endpoint.c

diff --git a/bus.c b/bus.c
index 919a243d1e115eadc1858ff78195f0bc4049093b..6dcaf22f5d59d895bdb794a9fc8926d2fbac2a85 100644 (file)
--- a/bus.c
+++ b/bus.c
@@ -219,11 +219,11 @@ static struct kdbus_bus *kdbus_bus_find(struct kdbus_domain *domain,
  * Return: 0 on success, error otherwise.
  */
 int kdbus_cmd_bus_creator_info(struct kdbus_conn *conn,
-                              struct kdbus_cmd_conn_info *cmd_info)
+                              struct kdbus_cmd_info *cmd_info)
 {
        struct kdbus_bus *bus = conn->bus;
        struct kdbus_pool_slice *slice;
-       struct kdbus_conn_info info = {};
+       struct kdbus_info info = {};
        int ret;
 
        info.size = sizeof(info) + bus->meta->size;
diff --git a/bus.h b/bus.h
index 5891c80709615b3c2993244b4a9a2eaa23a3f2d4..fd9d8431b8862e3c1f411de98e7c777b1adb3d53 100644 (file)
--- a/bus.h
+++ b/bus.h
@@ -95,7 +95,7 @@ int kdbus_bus_new(struct kdbus_domain *domain,
                  umode_t mode, kuid_t uid, kgid_t gid,
                  struct kdbus_bus **bus);
 int kdbus_cmd_bus_creator_info(struct kdbus_conn *conn,
-                              struct kdbus_cmd_conn_info *cmd_info);
+                              struct kdbus_cmd_info *cmd_info);
 struct kdbus_bus *kdbus_bus_ref(struct kdbus_bus *bus);
 struct kdbus_bus *kdbus_bus_unref(struct kdbus_bus *bus);
 void kdbus_bus_disconnect(struct kdbus_bus *bus);
index b1458f614d969950a243afe9fc863f3f46709725..d40b6ae6bc49df490febfe94f06787f48a9b11f6 100644 (file)
@@ -1199,18 +1199,18 @@ int kdbus_conn_move_messages(struct kdbus_conn *conn_dst,
 }
 
 /**
- * kdbus_cmd_conn_info() - retrieve info about a connection
+ * kdbus_cmd_info() - retrieve info about a connection
  * @conn:              Connection
  * @cmd_info:          The command as passed in by the ioctl
  *
  * Return: 0 on success, negative errno on failure.
  */
-int kdbus_cmd_conn_info(struct kdbus_conn *conn,
-                       struct kdbus_cmd_conn_info *cmd_info)
+int kdbus_cmd_info(struct kdbus_conn *conn,
+                       struct kdbus_cmd_info *cmd_info)
 {
        struct kdbus_name_entry *entry = NULL;
        struct kdbus_conn *owner_conn = NULL;
-       struct kdbus_conn_info info = {};
+       struct kdbus_info info = {};
        struct kdbus_meta *meta = NULL;
        struct kdbus_pool_slice *slice;
        size_t pos;
index 4fdf334dacd8f08b036d8fb9efe0151d7ab2c5fb..01a5bd8feda7c0a6f88cc7ba42de844bee1f22e3 100644 (file)
@@ -119,8 +119,8 @@ int kdbus_cmd_msg_recv(struct kdbus_conn *conn,
                       struct kdbus_cmd_recv *recv);
 int kdbus_cmd_msg_cancel(struct kdbus_conn *conn,
                         u64 cookie);
-int kdbus_cmd_conn_info(struct kdbus_conn *conn,
-                       struct kdbus_cmd_conn_info *cmd_info);
+int kdbus_cmd_info(struct kdbus_conn *conn,
+                       struct kdbus_cmd_info *cmd_info);
 int kdbus_cmd_conn_update(struct kdbus_conn *conn,
                          const struct kdbus_cmd_update *cmd_update);
 int kdbus_conn_kmsg_send(struct kdbus_ep *ep,
index 08645fcb3fd416c8471698504544a4ac5ced277c..12f132f834142f69b115ce7117638329d629123b 100644 (file)
--- a/handle.c
+++ b/handle.c
@@ -845,7 +845,7 @@ static long kdbus_handle_ioctl_ep_connected(struct file *file, unsigned int cmd,
 
        case KDBUS_CMD_CONN_INFO:
        case KDBUS_CMD_BUS_CREATOR_INFO: {
-               struct kdbus_cmd_conn_info *cmd_info;
+               struct kdbus_cmd_info *cmd_info;
 
                /* return the properties of a connection */
                ret = kdbus_memdup_user(buf, &p, sizeof(*cmd_info),
@@ -862,7 +862,7 @@ static long kdbus_handle_ioctl_ep_connected(struct file *file, unsigned int cmd,
                        break;
 
                if (cmd == KDBUS_CMD_CONN_INFO)
-                       ret = kdbus_cmd_conn_info(conn, cmd_info);
+                       ret = kdbus_cmd_info(conn, cmd_info);
                else
                        ret = kdbus_cmd_bus_creator_info(conn, cmd_info);
 
@@ -870,7 +870,7 @@ static long kdbus_handle_ioctl_ep_connected(struct file *file, unsigned int cmd,
                        break;
 
                if (kdbus_offset_set_user(&cmd_info->offset, buf,
-                                         struct kdbus_cmd_conn_info))
+                                         struct kdbus_cmd_info))
                        ret = -EFAULT;
 
                break;
diff --git a/kdbus.h b/kdbus.h
index 5d2526cfdbcd162d261df95aa00a20031a10d180..53a4d2143a30a888e994bbba05a483c5fcf6f938 100644 (file)
--- a/kdbus.h
+++ b/kdbus.h
@@ -721,7 +721,7 @@ struct kdbus_name_list {
 };
 
 /**
- * struct kdbus_cmd_conn_info - struct used for KDBUS_CMD_CONN_INFO ioctl
+ * struct kdbus_cmd_info - struct used for KDBUS_CMD_CONN_INFO ioctl
  * @size:              The total size of the struct
  * @flags:             KDBUS_ATTACH_* flags, userspace → kernel
  * @kernel_flags:      Supported KDBUS_ATTACH_* flags, kernel → userspace
@@ -729,16 +729,16 @@ struct kdbus_name_list {
  *                     @name is required. kdbus will look up the name to
  *                     determine the ID in this case.
  * @offset:            Returned offset in the caller's pool buffer where the
- *                     kdbus_conn_info struct result is stored. The user must
+ *                     kdbus_info struct result is stored. The user must
  *                     use KDBUS_CMD_FREE to free the allocated memory.
  * @name:              The optional well-known name to look up. Only needed in
  *                     case @id is zero.
  *
  * On success, the KDBUS_CMD_CONN_INFO ioctl will return 0 and @offset will
  * tell the user the offset in the connection pool buffer at which to find the
- * result in a struct kdbus_conn_info.
+ * result in a struct kdbus_info.
  */
-struct kdbus_cmd_conn_info {
+struct kdbus_cmd_info {
        __u64 size;
        __u64 flags;
        __u64 kernel_flags;
@@ -748,16 +748,16 @@ struct kdbus_cmd_conn_info {
 } __attribute__((aligned(8)));
 
 /**
- * struct kdbus_conn_info - information returned by KDBUS_CMD_CONN_INFO
+ * struct kdbus_info - information returned by KDBUS_CMD_*_INFO
  * @size:              The total size of the struct
- * @id:                        The connection's 64-bit ID
- * @flags:             The connection's flags
+ * @id:                        The connection's or bus' 64-bit ID
+ * @flags:             The connection's or bus' flags
  * @items:             A list of struct kdbus_item
  *
  * Note that the user is responsible for freeing the allocated memory with
  * the KDBUS_CMD_FREE ioctl.
  */
-struct kdbus_conn_info {
+struct kdbus_info {
        __u64 size;
        __u64 id;
        __u64 flags;
@@ -893,11 +893,11 @@ enum kdbus_ioctl_type {
                                              struct kdbus_cmd_name_list),
 
        KDBUS_CMD_CONN_INFO =           _IOWR(KDBUS_IOCTL_MAGIC, 0x60,
-                                             struct kdbus_cmd_conn_info),
+                                             struct kdbus_cmd_info),
        KDBUS_CMD_CONN_UPDATE =         _IOW(KDBUS_IOCTL_MAGIC, 0x61,
                                             struct kdbus_cmd_update),
        KDBUS_CMD_BUS_CREATOR_INFO =    _IOWR(KDBUS_IOCTL_MAGIC, 0x62,
-                                             struct kdbus_cmd_conn_info),
+                                             struct kdbus_cmd_info),
 
        KDBUS_CMD_ENDPOINT_UPDATE =     _IOW(KDBUS_IOCTL_MAGIC, 0x71,
                                             struct kdbus_cmd_update),
index dfe665b860a53480f208c088e2b378fa33f2c09c..d5079aa51aaba2595cfeb1de1338d07187040557 100644 (file)
--- a/kdbus.txt
+++ b/kdbus.txt
@@ -537,7 +537,7 @@ The KDBUS_CMD_CONN_INFO ioctl can be used to retrieve credentials and
 properties of the initial creator of a connection. This ioctl uses the
 following struct:
 
-struct kdbus_cmd_conn_info {
+struct kdbus_cmd_info {
   __u64 size;
     The overall size of the struct, including the name with its 0-byte string
     terminator.
@@ -576,7 +576,7 @@ struct kdbus_cmd_conn_info {
 After the ioctl returns, the following struct  will be stored in the caller's
 pool at 'offset'.
 
-struct kdbus_conn_info {
+struct kdbus_info {
   __u64 size;
     The overall size of the struct, including all its items.
 
@@ -590,7 +590,7 @@ struct kdbus_conn_info {
     Valid flags for this command, returned by the kernel upon each call.
 
   struct kdbus_item items[0];
-    Depending on the 'flags' field in struct kdbus_cmd_conn_info, items of
+    Depending on the 'flags' field in struct kdbus_cmd_info, items of
     types KDBUS_ITEM_NAME and KDBUS_ITEM_CONN_NAME are followed here.
 };
 
@@ -609,10 +609,10 @@ it provides pristine information on the task that created the bus, at the
 moment when it did so.
 
 In response to this call, a slice in the connection's pool is allocated and
-filled with an object of type struct kdbus_conn_info, pointed to by the ioctl's
+filled with an object of type struct kdbus_info, pointed to by the ioctl's
 'offset' field.
 
-struct kdbus_conn_info {
+struct kdbus_info {
   __u64 size;
     The overall size of the struct, including all its items.
 
index c05c211c5c73f63a868642d1fe13efd88ef52dba..c0c01d3a34beda705535bc22523a93706e656e67 100644 (file)
@@ -223,10 +223,10 @@ struct kdbus_conn *kdbus_hello_activator(const char *path, const char *name,
                                     KDBUS_HELLO_ACTIVATOR);
 }
 
-int kdbus_conn_info(struct kdbus_conn *conn, uint64_t id,
+int kdbus_info(struct kdbus_conn *conn, uint64_t id,
                    const char *name, uint64_t *offset)
 {
-       struct kdbus_cmd_conn_info *cmd;
+       struct kdbus_cmd_info *cmd;
        size_t size = sizeof(*cmd);
        int ret;
 
index 6dc262335b92dd2ffa9e40bb09f9e9b4da7a6366..173e1705eea6c39066f54923533587a22806d7d1 100644 (file)
@@ -121,7 +121,7 @@ struct kdbus_conn *kdbus_hello_registrar(const char *path, const char *name,
 struct kdbus_conn *kdbus_hello_activator(const char *path, const char *name,
                                         const struct kdbus_policy_access *access,
                                         size_t num_access);
-int kdbus_conn_info(struct kdbus_conn *conn, uint64_t id,
+int kdbus_info(struct kdbus_conn *conn, uint64_t id,
                    const char *name, uint64_t *offset);
 void kdbus_conn_free(struct kdbus_conn *conn);
 int kdbus_conn_update_attach_flags(struct kdbus_conn *conn, uint64_t flags);
index f74baa99133ba2295460424887c003c6417c9a89..dd5074f5fb131fc92b260974cce9af1331715a24 100644 (file)
@@ -20,7 +20,7 @@ static int test_bus_creator_info(const char *bus_path)
 {
        int ret;
        struct kdbus_conn *conn;
-       struct kdbus_cmd_conn_info cmd = {};
+       struct kdbus_cmd_info cmd = {};
 
        cmd.size = sizeof(cmd);
 
index 2e024e2ea6e2492a9b49700f8dd2022e4b6819d0..a7c33c15f1814b99829a8dd811d2beee2db2f966 100644 (file)
@@ -132,7 +132,7 @@ int kdbus_test_conn_info(struct kdbus_test_env *env)
 {
        int ret;
        struct {
-               struct kdbus_cmd_conn_info cmd_info;
+               struct kdbus_cmd_info cmd_info;
 
                struct {
                        uint64_t size;
@@ -141,7 +141,7 @@ int kdbus_test_conn_info(struct kdbus_test_env *env)
                } name;
        } buf;
 
-       buf.cmd_info.size = sizeof(struct kdbus_cmd_conn_info);
+       buf.cmd_info.size = sizeof(struct kdbus_cmd_info);
        buf.cmd_info.flags = 0;
        buf.cmd_info.id = env->conn->id;
 
index 5c72ca532c4f32024bdc330edfedb96231d33b77..05382e88753f8146aed0f4c0ecd8cc0a1388e0c3 100644 (file)
@@ -180,10 +180,10 @@ int kdbus_test_custom_endpoint(struct kdbus_test_env *env)
        ret = kdbus_msg_recv(ep_conn, NULL, NULL);
        ASSERT_RETURN(ret == -EAGAIN);
 
-       ret = kdbus_conn_info(ep_conn, 0, name, NULL);
+       ret = kdbus_info(ep_conn, 0, name, NULL);
        ASSERT_RETURN(ret == -ENOENT);
 
-       ret = kdbus_conn_info(ep_conn, env->conn->id, NULL, NULL);
+       ret = kdbus_info(ep_conn, env->conn->id, NULL, NULL);
        ASSERT_RETURN(ret == -ENOENT);
 
        /*
@@ -208,10 +208,10 @@ int kdbus_test_custom_endpoint(struct kdbus_test_env *env)
        ASSERT_RETURN(strcmp(msg->items[0].name_change.name, name) == 0);
        kdbus_msg_free(msg);
 
-       ret = kdbus_conn_info(ep_conn, 0, name, NULL);
+       ret = kdbus_info(ep_conn, 0, name, NULL);
        ASSERT_RETURN(ret == 0);
 
-       ret = kdbus_conn_info(ep_conn, env->conn->id, NULL, NULL);
+       ret = kdbus_info(ep_conn, env->conn->id, NULL, NULL);
        ASSERT_RETURN(ret == 0);
 
        kdbus_conn_free(ep_conn);