platform/core/system/kdbus-bus.git
10 years agotest-kdbus-monitor: open output file with O_WRONLY|O_TRUNC tizen upstream/0.20140221.145534cet
Daniel Mack [Fri, 21 Feb 2014 13:55:34 +0000 (14:55 +0100)]
test-kdbus-monitor: open output file with O_WRONLY|O_TRUNC

10 years agotest-kdbus-monitor: exit from main loop
Daniel Mack [Fri, 21 Feb 2014 13:49:23 +0000 (14:49 +0100)]
test-kdbus-monitor: exit from main loop

10 years agotest/test-kdbus-monitor: fix PAYLOAD_OFF size alignment
Daniel Mack [Fri, 21 Feb 2014 12:59:01 +0000 (13:59 +0100)]
test/test-kdbus-monitor: fix PAYLOAD_OFF size alignment

10 years agoconnection, names: flush dcache after writing to pool
Daniel Mack [Thu, 20 Feb 2014 21:20:33 +0000 (22:20 +0100)]
connection, names: flush dcache after writing to pool

10 years agoconnection: cosmetics
Daniel Mack [Thu, 20 Feb 2014 19:13:25 +0000 (20:13 +0100)]
connection: cosmetics

10 years agonames: Acquiring name by activator connection logic fixed
Michal Eljasiewicz [Thu, 20 Feb 2014 11:33:18 +0000 (12:33 +0100)]
names: Acquiring name by activator connection logic fixed

This fix allows to register activator connection when
normal connection already exists for that name.
Also, when activator connection registers for a second name
(different than first one) name lookup will
result in no entry found and checking for multiple names
will not occur. So checking needs to be done earlier.

Signed-off-by: Michal Eljasiewicz <m.eljasiewic@samsung.com>
10 years agoinclude "linux/ioctl.h"
Kay Sievers [Thu, 20 Feb 2014 02:40:24 +0000 (03:40 +0100)]
include "linux/ioctl.h"

10 years agomatch.c use div64_u64 to devide trough bloom.size
Simon Peeters [Wed, 19 Feb 2014 20:42:50 +0000 (21:42 +0100)]
match.c use div64_u64 to devide trough bloom.size

This fixes the build on 32bit systems which can't devide trough a 64 bit value.

10 years agokdbus.txt: grammatical fixes
Jason A. Donenfeld [Tue, 18 Feb 2014 19:32:47 +0000 (20:32 +0100)]
kdbus.txt: grammatical fixes

10 years agoconnection: update conn->flags before kdbus_notify_id_change uses them
Radoslaw Pajak [Tue, 18 Feb 2014 09:50:42 +0000 (10:50 +0100)]
connection: update conn->flags before kdbus_notify_id_change uses them

Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years agoCorrect linking flags: Use -pthread instead of -lpthread
Stefan Beller [Sun, 16 Feb 2014 15:43:01 +0000 (16:43 +0100)]
Correct linking flags: Use -pthread instead of -lpthread

(I am using Ubuntu 13.10, with self-compiled kernel)
Before this commit, I got the following error:
$ make
make -C /lib/modules/3.13.3/build M=/home/sb/OSS/kdbus
make -C test KBUILD_MODNAME=kdbus
make[1]: Entering directory `/home/sb/OSS/kdbus/test'
  TARGET_CC kdbus-enum.o
  TARGET_CC kdbus-util.o
  TARGET_CC test-kdbus-sync.o
  TARGET_CC test-kdbus-prio.o
  TARGET_LD test-kdbus-sync
  TARGET_LD test-kdbus-prio
test-kdbus-sync.o: In function `main':
/home/sb/OSS/kdbus/test/test-kdbus-sync.c:101: undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [test-kdbus-sync] Error 1

The man page (such as here http://linux.die.net/man/3/pthread_create)
claims:
Compile and link with -pthread.

So we need to remove the 'l', which is usually used for libraries on
linking.
This commit let's me compile this repository again.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
10 years agomatch: kdbus_match_entry_free fixed
Radoslaw Pajak [Fri, 14 Feb 2014 15:10:53 +0000 (16:10 +0100)]
match: kdbus_match_entry_free fixed

Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years agobump reply limit
Kay Sievers [Tue, 11 Feb 2014 11:42:09 +0000 (12:42 +0100)]
bump reply limit

10 years agoTODO: update
Kay Sievers [Tue, 11 Feb 2014 01:56:52 +0000 (02:56 +0100)]
TODO: update

10 years agotest: Fix receiving messages
Lukasz Skalski [Mon, 10 Feb 2014 13:40:50 +0000 (14:40 +0100)]
test: Fix receiving messages

It fixes a problem with receiving messages if they are queued in
memory pool (otherwise offset from KDBUS_CMD_MSG_RECV is ignored).

10 years agokdbus.txt: update introduction
Kay Sievers [Tue, 11 Feb 2014 01:40:10 +0000 (02:40 +0100)]
kdbus.txt: update introduction

10 years agorelease connection lock before freeing reply object
Kay Sievers [Tue, 11 Feb 2014 01:06:45 +0000 (02:06 +0100)]
release connection lock before freeing reply object

10 years agoconnection: kill stray list_del
Daniel Mack [Mon, 10 Feb 2014 11:34:08 +0000 (12:34 +0100)]
connection: kill stray list_del

kdbus_conn_reply_finish already removes the reply's list entry.

10 years agoconnection: do not re-schedule work for a disconncted connection
Kay Sievers [Sun, 9 Feb 2014 20:17:49 +0000 (21:17 +0100)]
connection: do not re-schedule work for a disconncted connection

10 years agofix URL
Kay Sievers [Sun, 9 Feb 2014 03:01:41 +0000 (04:01 +0100)]
fix URL

10 years agoconnection: walk remote lists in kdbus_cmd_msg_cancel
Daniel Mack [Thu, 6 Feb 2014 21:40:20 +0000 (22:40 +0100)]
connection: walk remote lists in kdbus_cmd_msg_cancel

This partly reverts commit 4ff527c2, but fixes the list entry
logic that was broken before.

10 years agoconnection: follow new reply_list logic in kdbus_cmd_msg_cancel
Daniel Mack [Thu, 6 Feb 2014 21:33:33 +0000 (22:33 +0100)]
connection: follow new reply_list logic in kdbus_cmd_msg_cancel

10 years agoupdate marketing text
Kay Sievers [Thu, 6 Feb 2014 18:38:31 +0000 (19:38 +0100)]
update marketing text

10 years agorelease parent lock when disconnecting children objects
Kay Sievers [Thu, 6 Feb 2014 13:58:26 +0000 (14:58 +0100)]
release parent lock when disconnecting children objects

10 years agokdbus_conn_move_messages: splice list of expected replies
Daniel Mack [Wed, 5 Feb 2014 21:44:06 +0000 (22:44 +0100)]
kdbus_conn_move_messages: splice list of expected replies

10 years agoconnection, kdbus_conn_disconnect: splice out reply list under lock
Daniel Mack [Wed, 5 Feb 2014 21:54:42 +0000 (22:54 +0100)]
connection, kdbus_conn_disconnect: splice out reply list under lock

Then walk the list without the lock held.

10 years agoconnection: let conn->reply_list keep track of allowed replies
Daniel Mack [Wed, 5 Feb 2014 20:38:15 +0000 (21:38 +0100)]
connection: let conn->reply_list keep track of allowed replies

Currently, when connection A sends a message to connection B, we store
the reply item with connection A, indicating that connection B is
allowed to reply to connection A.

This creates an ABBA locking issue with MSG_DROP, as we have to hold
both locks in order to do the list_del(reply->entry).

Let's do it the other way around and let conn->reply_list store the
reply items of allowed replies *from* the connection instead. That also
simplifies a number of all sites, as we don't have to walk all
connection on the bus anymore in order to find out whether anyone is
waiting for a reply from us.

10 years agoconnection: send dead reply on KDBUS_RECV_DROP
Daniel Mack [Wed, 5 Feb 2014 20:35:27 +0000 (21:35 +0100)]
connection: send dead reply on KDBUS_RECV_DROP

10 years agoconnection: merge kdbus_conn_msg_recv()
Kay Sievers [Wed, 5 Feb 2014 14:44:14 +0000 (15:44 +0100)]
connection: merge kdbus_conn_msg_recv()

10 years agoreplace work+timer with delayed_work
Kay Sievers [Wed, 5 Feb 2014 14:15:46 +0000 (15:15 +0100)]
replace work+timer with delayed_work

10 years agoconnection: first ref() then unref() when moving references
Kay Sievers [Wed, 5 Feb 2014 03:36:59 +0000 (04:36 +0100)]
connection: first ref() then unref() when moving references

10 years agoendpoint: fix kerneldoc
Kay Sievers [Wed, 5 Feb 2014 03:23:12 +0000 (04:23 +0100)]
endpoint: fix kerneldoc

10 years agoconnection: free notify list
Kay Sievers [Wed, 5 Feb 2014 03:20:23 +0000 (04:20 +0100)]
connection: free notify list

10 years agoconnection: pin the connection which scheduled work
Kay Sievers [Mon, 3 Feb 2014 18:55:48 +0000 (19:55 +0100)]
connection: pin the connection which scheduled work

10 years agoconnection: cancel work outside of bus lock
Kay Sievers [Mon, 3 Feb 2014 17:45:16 +0000 (18:45 +0100)]
connection: cancel work outside of bus lock

10 years agosave the bus when we fiddle with the function paramter
Kay Sievers [Mon, 3 Feb 2014 17:36:46 +0000 (18:36 +0100)]
save the bus when we fiddle with the function paramter

10 years agoupdate locking and tear-down logic at disconnect()
Kay Sievers [Mon, 3 Feb 2014 01:53:50 +0000 (02:53 +0100)]
update locking and tear-down logic at disconnect()

10 years agodirectly track bus <-> connection
Kay Sievers [Sun, 2 Feb 2014 22:18:29 +0000 (23:18 +0100)]
directly track bus <-> connection

10 years agonullify q->reply earlier in kdbus_conn_move_messages()
Daniel Mack [Sun, 2 Feb 2014 09:55:28 +0000 (10:55 +0100)]
nullify q->reply earlier in kdbus_conn_move_messages()

10 years agos/ns_make/domain_make/g
Daniel Mack [Sat, 1 Feb 2014 16:05:37 +0000 (17:05 +0100)]
s/ns_make/domain_make/g

10 years agokdbus.txt: s/ns/domain/g
Daniel Mack [Sat, 1 Feb 2014 15:44:34 +0000 (16:44 +0100)]
kdbus.txt: s/ns/domain/g

10 years agoconnection: plug memory leaks in kdbus_conn_move_messages()
Daniel Mack [Sat, 1 Feb 2014 15:22:34 +0000 (16:22 +0100)]
connection: plug memory leaks in kdbus_conn_move_messages()

10 years agoconnection: kill some blank lines
Daniel Mack [Sat, 1 Feb 2014 15:01:32 +0000 (16:01 +0100)]
connection: kill some blank lines

10 years agoRevert "connection: use list_for_each_entry"
Kay Sievers [Sat, 1 Feb 2014 13:55:52 +0000 (14:55 +0100)]
Revert "connection: use list_for_each_entry"

This reverts commit 72f98081f38fc63f6e9af351ca2fb6bbb7b9fbfa.

10 years agomore namespace -> domain renames
Daniel Mack [Sat, 1 Feb 2014 13:43:24 +0000 (14:43 +0100)]
more namespace -> domain renames

10 years agos/_NS_/_DOMAIN_/g
Daniel Mack [Sat, 1 Feb 2014 13:39:49 +0000 (14:39 +0100)]
s/_NS_/_DOMAIN_/g

10 years agostyle fixes
Daniel Mack [Sat, 1 Feb 2014 13:38:50 +0000 (14:38 +0100)]
style fixes

10 years agorename namespace to domain
Daniel Mack [Sat, 1 Feb 2014 13:33:00 +0000 (14:33 +0100)]
rename namespace to domain

10 years agokdbus.h: rename namespace to domain
Kay Sievers [Sat, 1 Feb 2014 13:29:01 +0000 (14:29 +0100)]
kdbus.h: rename namespace to domain

10 years agoconnection: use list_for_each_entry
Daniel Mack [Sat, 1 Feb 2014 13:01:09 +0000 (14:01 +0100)]
connection: use list_for_each_entry

kdbus_conn_reply_free() doesn't fiddle with the list entry anymore, so
list_for_each_entry() is safe to use.

10 years agoconnection: kill unnecessary check in kdbus_conn_reply_finish()
Daniel Mack [Sat, 1 Feb 2014 11:23:08 +0000 (12:23 +0100)]
connection: kill unnecessary check in kdbus_conn_reply_finish()

10 years agofix and add comments
Daniel Mack [Sat, 1 Feb 2014 11:10:09 +0000 (12:10 +0100)]
fix and add comments

10 years agoconnection: remove replies from list asap
Daniel Mack [Sat, 1 Feb 2014 02:29:29 +0000 (03:29 +0100)]
connection: remove replies from list asap

move list_del(&reply->entry) from kdbus_conn_reply_free() to
kdbus_conn_reply_finish(). Hence, make sure all callers of
kdbus_conn_reply_finish() iterate reply_list with
list_for_each_entry_safe() and hold a lock to the connection holding the
list.

10 years agoconnection: ensure queue.reply is NULL for moved messages
Daniel Mack [Sat, 1 Feb 2014 02:29:11 +0000 (03:29 +0100)]
connection: ensure queue.reply is NULL for moved messages

10 years agoconnection: handle return from wait_event_interruptible_timeout() correctly
Daniel Mack [Sat, 1 Feb 2014 01:49:41 +0000 (02:49 +0100)]
connection: handle return from wait_event_interruptible_timeout() correctly

10 years agoconnection: re-arm timer with lock held
Daniel Mack [Fri, 31 Jan 2014 17:14:30 +0000 (18:14 +0100)]
connection: re-arm timer with lock held

10 years agoTODO: update
Kay Sievers [Fri, 31 Jan 2014 17:08:46 +0000 (18:08 +0100)]
TODO: update

10 years agokdbus_conn_move_messages: finish reply_list entries
Daniel Mack [Fri, 31 Jan 2014 16:39:23 +0000 (17:39 +0100)]
kdbus_conn_move_messages: finish reply_list entries

10 years agoconnection: don't store conn_waiting in kdbus_conn_reply
Daniel Mack [Fri, 31 Jan 2014 16:17:54 +0000 (17:17 +0100)]
connection: don't store conn_waiting in kdbus_conn_reply

Also, keep a local flag in kdbus_conn_kmsg_send() and don't rely on
reply_wait, which can be deallocated in async cases while we hold a
pointer to it.

10 years agoconnection: add 2 FIXMEs
Daniel Mack [Fri, 31 Jan 2014 16:17:17 +0000 (17:17 +0100)]
connection: add 2 FIXMEs

10 years agoconnection: finish replies when disconnecting
Daniel Mack [Fri, 31 Jan 2014 13:23:02 +0000 (14:23 +0100)]
connection: finish replies when disconnecting

10 years agoconnection: hold conn_src->lock when checking for reply_wait->conn_waiting
Daniel Mack [Fri, 31 Jan 2014 13:22:04 +0000 (14:22 +0100)]
connection: hold conn_src->lock when checking for reply_wait->conn_waiting

10 years agoconnection: turn around cleanup logic in kdbus_conn_move_messages()
Daniel Mack [Fri, 31 Jan 2014 13:20:57 +0000 (14:20 +0100)]
connection: turn around cleanup logic in kdbus_conn_move_messages()

10 years agoconnection: use kdbus_conn_queue_remove() in kdbus_conn_disconnect()
Daniel Mack [Fri, 31 Jan 2014 08:41:57 +0000 (09:41 +0100)]
connection: use kdbus_conn_queue_remove() in kdbus_conn_disconnect()

This takes care of the prio rb tree takedown properly.

10 years agoconnection: free used reply directly
Daniel Mack [Fri, 31 Jan 2014 08:41:15 +0000 (09:41 +0100)]
connection: free used reply directly

Makes to logical flow clearer.

10 years agofix typo
Daniel Mack [Fri, 31 Jan 2014 08:40:08 +0000 (09:40 +0100)]
fix typo

10 years agoconnection: properly ref the connection in kdbus_conn_move_messages()
Daniel Mack [Fri, 31 Jan 2014 08:38:54 +0000 (09:38 +0100)]
connection: properly ref the connection in kdbus_conn_move_messages()

10 years agoRevert "connection: hold lock for kdbus_conn_reply_finish()"
Daniel Mack [Thu, 30 Jan 2014 17:01:10 +0000 (18:01 +0100)]
Revert "connection: hold lock for kdbus_conn_reply_finish()"

This reverts commit 1d3a6d1db374ca57c4c8402de12409cc5440b50c.

10 years agoconnection: hold lock for kdbus_conn_reply_finish()
Daniel Mack [Thu, 30 Jan 2014 16:41:17 +0000 (17:41 +0100)]
connection: hold lock for kdbus_conn_reply_finish()

10 years agoconnection: use del_timer_sync()
Daniel Mack [Thu, 30 Jan 2014 16:28:06 +0000 (17:28 +0100)]
connection: use del_timer_sync()

and check for disconnected connection in the worker.

10 years agoconnection: pass return code from kdbus_conn_queue_alloc() to sync waiter
Daniel Mack [Thu, 30 Jan 2014 15:42:51 +0000 (16:42 +0100)]
connection: pass return code from kdbus_conn_queue_alloc() to sync waiter

10 years agoconnection: clean up code nesting in kdbus_conn_kmsg_send
Daniel Mack [Thu, 30 Jan 2014 11:33:53 +0000 (12:33 +0100)]
connection: clean up code nesting in kdbus_conn_kmsg_send

also, closes a lock gap

10 years agoconnection: fix locking in sync message delivery
Daniel Mack [Wed, 29 Jan 2014 20:48:37 +0000 (21:48 +0100)]
connection: fix locking in sync message delivery

10 years agoconnection: fix comment
Daniel Mack [Wed, 29 Jan 2014 20:44:23 +0000 (21:44 +0100)]
connection: fix comment

10 years agoconnection: clean up queue even if kdbus_conn_msg_install() fails
Daniel Mack [Wed, 29 Jan 2014 20:42:26 +0000 (21:42 +0100)]
connection: clean up queue even if kdbus_conn_msg_install() fails

10 years agoconnection: add comments
Daniel Mack [Wed, 29 Jan 2014 19:29:05 +0000 (20:29 +0100)]
connection: add comments

10 years agoconnection: cosmetic cleanup
Daniel Mack [Wed, 29 Jan 2014 19:29:39 +0000 (20:29 +0100)]
connection: cosmetic cleanup

10 years agoconnection: avoid NULL pointer dereference
Kay Sievers [Wed, 29 Jan 2014 16:09:10 +0000 (17:09 +0100)]
connection: avoid NULL pointer dereference

10 years agoconnection: kill kdbus_conn_queue.sync
Daniel Mack [Wed, 29 Jan 2014 15:13:37 +0000 (16:13 +0100)]
connection: kill kdbus_conn_queue.sync

Use conn_waiting to signal sync reply entries.

10 years agoconnection: kill kdbus_conn_reply.expect_reply
Daniel Mack [Wed, 29 Jan 2014 15:09:09 +0000 (16:09 +0100)]
connection: kill kdbus_conn_reply.expect_reply

That's redundant information.

10 years agoconnection: rework sync logic
Daniel Mack [Wed, 29 Jan 2014 15:00:14 +0000 (16:00 +0100)]
connection: rework sync logic

Avoid real queueing and dequeueing in sync cases. To achive this,

* parts of kdbus_conn_recv_msg() are moved into kdbus_conn_msg_install()
* pass around a struct kdbus_conn_reply rather than an offset

10 years agoconnection: do not finish replies in __kdbus_conn_free(),
Daniel Mack [Tue, 28 Jan 2014 22:44:31 +0000 (23:44 +0100)]
connection: do not finish replies in __kdbus_conn_free(),

... just free them. The replies in the list are the ones the connection
which is going away is waiting for, so there's no need to finish
anything.

10 years agoconnection: nullify queue->reply in kdbus_conn_recv_msg()
Daniel Mack [Tue, 28 Jan 2014 21:56:45 +0000 (22:56 +0100)]
connection: nullify queue->reply in kdbus_conn_recv_msg()

To make sure we don't finish the same reply block more than once.

10 years agoconnection: remove locking from kdbus_conn_reply_finish()
Daniel Mack [Tue, 28 Jan 2014 21:43:20 +0000 (22:43 +0100)]
connection: remove locking from kdbus_conn_reply_finish()

There's no obvious reason to hold the connection's lock at this point.

10 years agokdbus.h: fix wrong ioctl read/write declarations (ABI break)
Kay Sievers [Tue, 28 Jan 2014 09:56:12 +0000 (10:56 +0100)]
kdbus.h: fix wrong ioctl read/write declarations (ABI break)

10 years agoincrease message queue limit to 256
Kay Sievers [Mon, 27 Jan 2014 11:34:07 +0000 (12:34 +0100)]
increase message queue limit to 256

10 years agofix off-by-one error
Kay Sievers [Sat, 25 Jan 2014 18:51:55 +0000 (19:51 +0100)]
fix off-by-one error

10 years agofix typo
Kay Sievers [Sat, 25 Jan 2014 18:36:59 +0000 (19:36 +0100)]
fix typo

10 years agoimplement bloom mask generation selection
Kay Sievers [Sat, 25 Jan 2014 18:28:12 +0000 (19:28 +0100)]
implement bloom mask generation selection

10 years agoremove some whitespace
Kay Sievers [Sat, 25 Jan 2014 13:28:18 +0000 (14:28 +0100)]
remove some whitespace

10 years agodocs: update
Kay Sievers [Sat, 25 Jan 2014 13:15:17 +0000 (14:15 +0100)]
docs: update

10 years agokdbus.h: reorder ioctls (ABI break)
Kay Sievers [Fri, 24 Jan 2014 18:25:05 +0000 (19:25 +0100)]
kdbus.h: reorder ioctls (ABI break)

10 years agoTODO: update
Kay Sievers [Fri, 24 Jan 2014 17:13:42 +0000 (18:13 +0100)]
TODO: update

10 years agoupdate bloom filter handling (ABI break)
Kay Sievers [Fri, 24 Jan 2014 16:01:44 +0000 (17:01 +0100)]
update bloom filter handling (ABI break)

10 years agonames: amend coding style
Daniel Mack [Fri, 24 Jan 2014 16:44:53 +0000 (17:44 +0100)]
names: amend coding style

10 years agoutil: clean up includes
Daniel Mack [Fri, 24 Jan 2014 16:33:31 +0000 (17:33 +0100)]
util: clean up includes

10 years agoorder include files alphabetically
Daniel Mack [Fri, 24 Jan 2014 16:21:56 +0000 (17:21 +0100)]
order include files alphabetically

10 years agomemfd: fix multi-line comment
Daniel Mack [Fri, 24 Jan 2014 16:03:43 +0000 (17:03 +0100)]
memfd: fix multi-line comment

10 years agofix some kernel doc
Daniel Mack [Fri, 24 Jan 2014 15:58:07 +0000 (16:58 +0100)]
fix some kernel doc

10 years agoreorder, cleanup and consolidate variable declarations
Daniel Mack [Fri, 24 Jan 2014 15:52:15 +0000 (16:52 +0100)]
reorder, cleanup and consolidate variable declarations