Magellan Linux

Annotation of /trunk/hal/patches/hal-0.5.10-process-coldplug-events-as-soon-as-they-re-generated.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 597 - (hide annotations) (download)
Mon May 19 19:05:19 2008 UTC (16 years ago) by niro
File size: 1945 byte(s)
-gentoo patches

1 niro 597 From e773388329213475a81c0ecbacb045e21d27857d Mon Sep 17 00:00:00 2001
2     From: Rob Taylor <rob.taylor@codethink.co.uk>
3     Date: Mon, 19 Nov 2007 16:17:54 +0000
4     Subject: [PATCH] process coldplug events as soon as they're generated
5    
6     By processing coldplug events as soon as their generated and enqueued we
7     cansave some memory usage now that hotplug events are allocated using
8     g_slice rather than in a pool.
9     ---
10     hald/linux/coldplug.c | 11 ++++++-----
11     1 files changed, 6 insertions(+), 5 deletions(-)
12    
13     diff --git a/hald/linux/coldplug.c b/hald/linux/coldplug.c
14     index 5538aff..3ad7199 100644
15     --- a/hald/linux/coldplug.c
16     +++ b/hald/linux/coldplug.c
17     @@ -468,7 +468,7 @@ static void scan_class(void)
18     }
19     }
20    
21     -static void queue_events(void)
22     +static void process_coldplug_events(void)
23     {
24     GSList *dev;
25    
26     @@ -481,6 +481,7 @@ static void queue_events(void)
27     sysfs_dev->subsystem,
28     sysfs_dev->type);
29     hotplug_event_enqueue (hotplug_event);
30     + hotplug_event_process_queue();
31    
32     g_free (sysfs_dev->path);
33     g_free (sysfs_dev->subsystem);
34     @@ -519,22 +520,22 @@ coldplug_synthesize_events (void)
35     if (stat("/sys/subsystem", &statbuf) == 0) {
36     scan_subsystem ("subsystem");
37     device_list = g_slist_sort (device_list, _device_order);
38     - queue_events ();
39     + process_coldplug_events ();
40     } else {
41     scan_subsystem ("bus");
42     device_list = g_slist_sort (device_list, _device_order);
43     - queue_events ();
44     + process_coldplug_events ();
45    
46     scan_class ();
47     scan_single_bus ("bluetooth");
48     device_list = g_slist_sort (device_list, _device_order);
49     - queue_events ();
50     + process_coldplug_events ();
51    
52     /* scan /sys/block, if it isn't already a class */
53     if (stat("/sys/class/block", &statbuf) != 0) {
54     scan_block ();
55     device_list = g_slist_sort (device_list, _device_order);
56     - queue_events ();
57     + process_coldplug_events ();
58     }
59    
60     /* add events from reading /proc/mdstat */
61     --
62     1.5.3.7
63