From: Johan Hedberg <johan.hedberg@gmail.com>
To: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 00/17] RFC: Simplify DBusConnection object handling
Date: Fri, 21 Sep 2012 13:55:59 +0300 [thread overview]
Message-ID: <20120921105559.GA5561@x220> (raw)
In-Reply-To: <1348050139-27883-1-git-send-email-andrzej.kaczmarek@tieto.com>
Hi Andrzej,
On Wed, Sep 19, 2012, Andrzej Kaczmarek wrote:
> Here's series of patches which makes handling of DBusConnection object
> across code simpler and more consistent.
>
> Problem with current implementation is that different modules handles
> reference to D-Bus in a different way, e.g. some use dbus_bus_get() and
> just store it in static variable, others pass this around via multiple
> calls to finally store it in per-{adapter,device,request} structure or
> some just use get_dbus_connection() call to have it immediately.
>
> This creates a lot of redundant code which only (un)refs DBusConnection
> and pass it around for no particular reason, because you can use global
> reference which is exactly the same object.
>
> What following patches do is:
> (1) prefix get_dbus_connection() with btd_ so it can be used by external
> plugins
> (2) make sure D-Bus is disconnected after all modules (agent, mamanger,
> plugins etc.) are shutdown
> (3) remove any redundant internal references and function parameters that
> pass/store DBusConnection and just use btd_get_dbus_connection() where
> need to pass valid DBusConnection object (no need to ref it, there's
> one global ref and it's always valid as per #2)
>
> This makes things with D-Bus really simple: you need to pass DBusConnection
> object somewhere - call btd_get_dbus_connection() and you have it. No need
> to store it, no need to ref it. Perhaps some downside of this approach is
> that few files (hdp.c, telephony-maemo{5,6}.c) have quite a lot of such calls
> but if this is something to avoid we can still add global static variable
> and call btd_get_dbus_connection() once in *_init(), just like dbusoob plugin
> does now.
>
> Comments are welcome.
I didn't see any major issues with this set so all patches have now been
applied. Thanks.
Johan
prev parent reply other threads:[~2012-09-21 10:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-19 10:22 [PATCH 00/17] RFC: Simplify DBusConnection object handling Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 01/17] Rename get_dbus_connection to btd_get_dbus_connection Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 02/17] core: Make D-Bus connection valid for entire bluetoothd lifetime Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 03/17] dbus-common: Remove conn parameter from emit_property_changed Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 04/17] dbus-common: Remove conn parameter from emit_array_property_changed Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 05/17] manager: Simplify DBusConnection object handling Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 06/17] agent: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 07/17] device: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 08/17] adapter: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 09/17] attrib: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 10/17] audio: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 11/17] health: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 12/17] input: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 13/17] network: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 14/17] sap: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 15/17] thermometer: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 16/17] service: " Andrzej Kaczmarek
2012-09-19 10:22 ` [PATCH 17/17] dbusoob: " Andrzej Kaczmarek
2012-09-21 10:55 ` Johan Hedberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120921105559.GA5561@x220 \
--to=johan.hedberg@gmail.com \
--cc=andrzej.kaczmarek@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).