kernel list data structure
Ali Bahar
ali at internetdog.org
Sun Jun 5 21:59:14 EDT 2011
Hi Amirali,
> implemented a two-dimensioned list, using what I understood about kernel
> list. But as I debugged my code, it seems that my concept is wrong. Would
> anyone guide me how to implement a two-dimensioned list, or introduce me a
> manual to learn about it more?
I'm definitely on the newb end of things as far as kernel data
structures go. So getting another opinion would be prudent.
As for a manual, Wolfgang Mauerer's book, Professional Linux Kernel
Architecture, is an excellent resource. It does touch on double
linked-lists (LL), though I've only glanced at it.
> "noop_data" has a reference to start point of bundles list, called
> "writeQueue"
I don't think so. See below.
> struct bundle {
> struct list_head bundlesQueue;
> struct list_head reqsQueue;
What I see here is that you are putting such nodes on 2 LLs.
> struct noop_data {
> struct list_head readQueue;
> struct list_head writeQueue;
What I see here is that you are putting such nodes on 2 LLs, but
> struct bundle bun;
each node has a single node of the type 'struct bundle' ie a struct
which has
int bundleNumber;
int size;
...
int filled[8];
Likely, this is not what you want.
later,
ali
More information about the Kernelnewbies
mailing list