bus: improve user quota accounting and domain locking
Currently kdbus_bus_new() execution path might take the domain lock
three times on success, four times on failure.
kdbus_bus_new():
=> kdbus_domain_user_find_or_new(): takes it 2 times (and it is racy)
+
kdbus_bus_new(): take it an extra time to account the user and link
the bus into the domain bus_list.
And as discussed in the previous patch kdbus_domain_user_find_or_new()
is racy, so convert to __kdbus_domain_user_account()
This allows also to improve the execution path to take the domain lock
only one time in case of success. On failure the domain lock will be
taken two times.
kdbus_bus_new():
=> take domain lock
=> check if domain is still active/connected
=> __kdbus_domain_user_account()
...
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>