aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Taylor <rob.taylor@codethink.co.uk>2007-11-08 10:29:23 +0000
committerRob Taylor <rob.taylor@codethink.co.uk>2008-03-12 20:11:09 +0100
commit99122f71f31466c1010cbe7aa95a8860ebc688d7 (patch)
tree53dc5c7f31b77186071d6b62a932f68eead98e96
parentuse g_slice for hotplug events (diff)
downloadgentoo-hal-99122f71f31466c1010cbe7aa95a8860ebc688d7.tar.gz
gentoo-hal-99122f71f31466c1010cbe7aa95a8860ebc688d7.tar.bz2
gentoo-hal-99122f71f31466c1010cbe7aa95a8860ebc688d7.zip
process coldplug events as soon as they're generated
By processing coldplug events as soon as their generated and enqueued we can save some memory usage now that hotplug events are allocated using g_slice rather than in a pool.
-rw-r--r--hald/linux/coldplug.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/hald/linux/coldplug.c b/hald/linux/coldplug.c
index 5538afff..3ad7199b 100644
--- a/hald/linux/coldplug.c
+++ b/hald/linux/coldplug.c
@@ -468,7 +468,7 @@ static void scan_class(void)
}
}
-static void queue_events(void)
+static void process_coldplug_events(void)
{
GSList *dev;
@@ -481,6 +481,7 @@ static void queue_events(void)
sysfs_dev->subsystem,
sysfs_dev->type);
hotplug_event_enqueue (hotplug_event);
+ hotplug_event_process_queue();
g_free (sysfs_dev->path);
g_free (sysfs_dev->subsystem);
@@ -519,22 +520,22 @@ coldplug_synthesize_events (void)
if (stat("/sys/subsystem", &statbuf) == 0) {
scan_subsystem ("subsystem");
device_list = g_slist_sort (device_list, _device_order);
- queue_events ();
+ process_coldplug_events ();
} else {
scan_subsystem ("bus");
device_list = g_slist_sort (device_list, _device_order);
- queue_events ();
+ process_coldplug_events ();
scan_class ();
scan_single_bus ("bluetooth");
device_list = g_slist_sort (device_list, _device_order);
- queue_events ();
+ process_coldplug_events ();
/* scan /sys/block, if it isn't already a class */
if (stat("/sys/class/block", &statbuf) != 0) {
scan_block ();
device_list = g_slist_sort (device_list, _device_order);
- queue_events ();
+ process_coldplug_events ();
}
/* add events from reading /proc/mdstat */