Re: Fwd: [PATCH] [-mm] ACPI: export ACPI events via netlink

Patrick McHardy
2007-06-29T11:52:07Z

Johannes Berg wrote:
> On Wed, 2007-06-27 at 19:24 -0400, jamal wrote:
>
>>c) Use a global hash table to store all the genl_multicast_groups;
>>I think this (handwaving) should be searchable by i) name ii)ID and iii)
>>family.
>
>
> Yeah, makes sense, I never liked the bitmap stuff I did there.

Do multicast groups have to have a seperate name? Or would it suffice
to have them associated with the genl family and be able to find out
the starting group number? In that case something like

struct genl_mc_groups {
struct genl_family *family or char *family_name or similar;
unsigned int group_off;
unsigned int group_num;
unsigned long groups[];
};

seems to make more sense since you only need a single struct
per family.

>>>+static unsigned long mcast_group_start = 0x3;
>>>+static unsigned long *multicast_groups = &mcast_group_start;
>>>+static unsigned long multicast_group_bits = BITS_PER_LONG;

That looks pretty similar.

>>I think if you used a hash table you wont need to keep track of the
>>above; maybe not - You may still need the above to keep track of which
>>IDs are in use and where holes in multicast group ID space exist
>>(assuming some are going to be unregistered over time etc)

Why would you care about holes? If you really want to use sparse
bitmaps that would complicate the code a lot.