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, 4 Apr 2016 01:12:23 +0000 (10:12 +0900)
commit8bcefd8ac10f8a621fa7eb06fd2db12a6080eab9
tree0ddca76e7de9cbffef393b30c0fbb49aa23a536e
parentb495946f7a8a5e0f3575ee3bcfbd688d18171b35
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]