kdbus: add connection pool implementation
authorDaniel Mack <daniel@zonque.org>
Thu, 11 Sep 2014 16:56:41 +0000 (18:56 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 29 Jun 2015 10:50:35 +0000 (19:50 +0900)
commit784bdb3782ac7e6743a7dd8af7904f776362eaef
tree4b1d8a3fb7f4d1866921c4b3a1ba7a45c05ccb06
parentceede7303d5b7ee0bbf1bae18c32d9e014e30aec
kdbus: add connection pool implementation

A pool for data received from the kernel is installed for every
connection of the bus, and it is used to copy data from the kernel to
userspace clients, for messages and other information.

It is accessed when one of the following ioctls is issued:

  * KDBUS_CMD_MSG_RECV, to receive a message
  * KDBUS_CMD_NAME_LIST, to dump the name registry
  * KDBUS_CMD_CONN_INFO, to retrieve information on a connection

The offsets returned by either one of the aforementioned ioctls
describe offsets inside the pool. Internally, the pool is organized in
slices, that are dynamically allocated on demand. The overall size of
the pool is chosen by the connection when it connects to the bus with
KDBUS_CMD_HELLO.

In order to make the slice available for subsequent calls,
KDBUS_CMD_FREE has to be called on the offset.

To access the memory, the caller is expected to mmap() it to its task.

Change-Id: If4c201f8c0e20cfe403be0f0e76c966112260dd4
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
ipc/kdbus/pool.c [new file with mode: 0644]
ipc/kdbus/pool.h [new file with mode: 0644]