From 7b6388c7c6cdd2015dde360506cabfaacf9646e6 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 25 Dec 2013 17:59:07 +0100 Subject: [PATCH] fix kernel doc --- TODO | 21 ++++++++++++++------- bus.c | 1 + connection.c | 2 +- handle.c | 21 ++++++++++----------- kdbus.h | 10 ++++++++-- match.c | 4 ++-- message.c | 4 ++-- message.h | 3 ++- 8 files changed, 40 insertions(+), 26 deletions(-) diff --git a/TODO b/TODO index aacaef5..5f206bb 100644 --- a/TODO +++ b/TODO @@ -1,20 +1,27 @@ Features: + - account and limit number of messages a connection can have in-flight + for another connection, like a connection can have a maximum of 100 + messages in-flight, but only 10 of them to the same connection + - make kdbus.ko loadable a second time with a different: /dev/kdbus/, /sys/bus/kdbus/ name to be able to run test environments while the first one is in use by the system + - allow to update the metadata subscription bit mask + - support the creation of anonymous buses - - implement the EP_MAKE logic -External API: + - limit the number of connections per uid + + - memfd's file pos is shared, document pread/pwrite + - actually return compatible/incompatible flags to users + +External API: - rules for: -unknown items to ignore in userspace lib? -unknown items to ignore if SEND sees them? - - review all different structures of custom ioctls and items if they - can be somehow unified -Internal: - - limit the number of connections per uid - - memfd's file pos is shared, document pread/pwrite + - review all different structures of custom ioctls and items if they + can be further unified diff --git a/bus.c b/bus.c index c8fba71..0b859ea 100644 --- a/bus.c +++ b/bus.c @@ -163,6 +163,7 @@ static struct kdbus_bus *kdbus_bus_find(struct kdbus_ns *ns, const char *name) * @make: Pointer to a struct kdbus_cmd_make containing the * details for the bus creation * @name: Name of the bus + * @bloom_size: Size of the bloom filter on this bus * @mode: The access mode for the device node * @uid: The uid of the device node * @gid: The gid of the device node diff --git a/connection.c b/connection.c index 08f8905..f62a959 100644 --- a/connection.c +++ b/connection.c @@ -52,7 +52,7 @@ * @fds_count: Number of files * @src_id: The ID of the sender * @cookie: Message cookie, used for replies - * @src_name_id: The sequence number of the name this message is + * @dst_name_id: The sequence number of the name this message is * addressed to, 0 for messages sent to an ID */ struct kdbus_conn_queue { diff --git a/handle.c b/handle.c index d80af93..e2e6c10 100644 --- a/handle.c +++ b/handle.c @@ -38,14 +38,14 @@ /** * enum kdbus_handle_type - type a handle can be of - * @_KDBUS_HANDLE_NULL: internal null marker - * @KDBUS_HANDLE_CONTROL: new fd of a control node - * @KDBUS_HANDLE_CONTROL_NS_OWNER: fd to hold a namespace - * @KDBUS_HANDLE_CONTROL_BUS_OWNER: fd to hold a bus - * @KDBUS_HANDLE_EP: new fd of a bus node - * @KDBUS_HANDLE_EP_CONNECTED: connection after HELLO - * @KDBUS_HANDLE_EP_OWNER: fd to hold an endpoint - * @KDBUS_HANDLE_DISCONNECTED: handle is disconnected + * @_KDBUS_HANDLE_NULL: Uninitialized/invalid + * @KDBUS_HANDLE_CONTROL: New file descriptor of a control node + * @KDBUS_HANDLE_CONTROL_NS_OWNER: File descriptor to hold a namespace + * @KDBUS_HANDLE_CONTROL_BUS_OWNER: File descriptor to hold a bus + * @KDBUS_HANDLE_EP: New file descriptor of a bus node + * @KDBUS_HANDLE_EP_CONNECTED: A bus connection after HELLO + * @KDBUS_HANDLE_EP_OWNER: File descriptor to hold an endpoint + * @KDBUS_HANDLE_DISCONNECTED: Handle is disconnected */ enum kdbus_handle_type { _KDBUS_HANDLE_NULL, @@ -63,7 +63,7 @@ enum kdbus_handle_type { * @type: Type of this handle (KDBUS_HANDLE_*) * @ns: Namespace for this handle * @meta: Cached connection creator's metadata/credentials - * @ep The endpoint this handle owns, in case @type + * @ep: The endpoint this handle owns, in case @type * is KDBUS_HANDLE_EP * @ns_owner: The namespace this handle owns, in case @type * is KDBUS_HANDLE_CONTROL_NS_OWNER @@ -344,7 +344,6 @@ static long kdbus_handle_ioctl_ep(struct file *file, unsigned int cmd, gid = current_fsgid(); } - //FIXME: what to do with the holder connection now? ret = kdbus_ep_new(handle->ep->bus, handle->ep->bus->ns, n, mode, current_fsuid(), gid, make->flags & KDBUS_MAKE_POLICY_OPEN); @@ -617,7 +616,7 @@ static unsigned int kdbus_handle_poll(struct file *file, unsigned int mask = 0; bool disconnected; - /* Only an endpoint can read/write data */ + /* Only a connected endpoint can read/write data */ if (handle->type != KDBUS_HANDLE_EP_CONNECTED) return POLLERR | POLLHUP; diff --git a/kdbus.h b/kdbus.h index 71cfe06..e1ef1a3 100644 --- a/kdbus.h +++ b/kdbus.h @@ -193,6 +193,8 @@ struct kdbus_policy { /** * enum kdbus_item_type - item types to chain data in a list + * @_KDBUS_ITEM_NULL: Uninitialized/invalid + * @_KDBUS_ITEM_USER_BASE: Start of user items * @KDBUS_ITEM_PAYLOAD_VEC: Vector to data * @KDBUS_ITEM_PAYLOAD_OFF: Data at returned offset to message head * @KDBUS_ITEM_PAYLOAD_MEMFD: Data as sealed memfd @@ -202,8 +204,10 @@ struct kdbus_policy { * @KDBUS_ITEM_DST_NAME: Destination's well-known name * @KDBUS_ITEM_PRIORITY: Queue priority for message * @KDBUS_ITEM_MAKE_NAME: Name of namespace, bus, endpoint + * @_KDBUS_ITEM_POLICY_BASE: Start of policy items * @KDBUS_ITEM_POLICY_NAME: Policy in struct kdbus_policy * @KDBUS_ITEM_POLICY_ACCESS: Policy in struct kdbus_policy + * @_KDBUS_ITEM_ATTACH_BASE: Start of metadata attach items * @KDBUS_ITEM_NAME: Well-know name with flags * @KDBUS_ITEM_ID: Connection ID * @KDBUS_ITEM_TIMESTAMP: Timestamp @@ -216,6 +220,7 @@ struct kdbus_policy { * @KDBUS_ITEM_CAPS: The process capabilities * @KDBUS_ITEM_SECLABEL: The security label * @KDBUS_ITEM_AUDIT: The audit IDs + * @_KDBUS_ITEM_KERNEL_BASE: Start of kernel-generated message items * @KDBUS_ITEM_NAME_ADD: Notify in struct kdbus_notify_name_change * @KDBUS_ITEM_NAME_REMOVE: Notify in struct kdbus_notify_name_change * @KDBUS_ITEM_NAME_CHANGE: Notify in struct kdbus_notify_name_change @@ -329,11 +334,11 @@ enum kdbus_msg_flags { /** * enum kdbus_payload_type - type of payload carried by message * @KDBUS_PAYLOAD_KERNEL: Kernel-generated simple message - * @KDBUS_PAYLOAD_DBUS: D-Bus marshalling + * @KDBUS_PAYLOAD_DBUS: D-Bus marshalling "DBusDBus" */ enum kdbus_payload_type { KDBUS_PAYLOAD_KERNEL, - KDBUS_PAYLOAD_DBUS = 0x4442757344427573ULL, /* 'DBusDBus' */ + KDBUS_PAYLOAD_DBUS = 0x4442757344427573ULL, }; /** @@ -370,6 +375,7 @@ struct kdbus_msg { /** * enum kdbus_policy_access_type - permissions of a policy record + * @_KDBUS_POLICY_ACCESS_NULL: Uninitialized/invalid * @KDBUS_POLICY_ACCESS_USER: Grant access to a uid * @KDBUS_POLICY_ACCESS_GROUP: Grant access to gid * @KDBUS_POLICY_ACCESS_WORLD: World-accessible diff --git a/match.c b/match.c index 482acbb..03e1037 100644 --- a/match.c +++ b/match.c @@ -247,11 +247,11 @@ static bool kdbus_match_rules(const struct kdbus_match_entry *entry, * @conn_src: The connection object originating the message * @kmsg: The kmsg to perform the match on * - * Returns true in if there was a matching database entry, false otherwise. - * This function will walk through all the database entries previously uploaded * with kdbus_match_db_add(). As soon as any of them has an all-satisfied rule * set, this function will return true. + * + * Returns true in if there was a matching database entry, false otherwise. */ bool kdbus_match_db_match_kmsg(struct kdbus_match_db *db, struct kdbus_conn *conn_src, diff --git a/message.c b/message.c index 2bbcc40..16db583 100644 --- a/message.c +++ b/message.c @@ -46,7 +46,7 @@ void kdbus_kmsg_free(struct kdbus_kmsg *kmsg) /** * kdbus_kmsg_new() - allocate message * @extra_size: additional size to reserve for data - * @m: Returned Message + * @kmsg: Returned Message * * Returns: 0 on success, negative errno on failure. */ @@ -234,7 +234,7 @@ static int kdbus_msg_scan_items(struct kdbus_conn *conn, * kdbus_kmsg_new_from_user() - copy message from user memory * @conn: Connection * @msg: User-provided message - * @m: Copy of message + * @kmsg: Copy of message * * Returns: 0 on success, negative errno on failure. */ diff --git a/message.h b/message.h index d49a764..1fc6f2e 100644 --- a/message.h +++ b/message.h @@ -19,7 +19,8 @@ /** * struct kdbus_kmsg - internal message handling data * @notify_type: Short-cut for faster lookup - * @notify_id: Short-cut for faster lookup + * @notify_old_id: Short-cut for faster lookup + * @notify_new_id: Short-cut for faster lookup * @notify_name: Short-cut for faster lookup * @dst_name: Short-cut to msg for faster lookup * @dst_name_id: Short-cut to msg for faster lookup -- 2.34.1