kernel list data structure

Amirali Shambayati amirali.shambayati at gmail.com
Mon Jun 6 02:13:20 EDT 2011


Ali thanks for your valuable comments. Would you suggest me an alternative
method to implement the structure I explained?

On Mon, Jun 6, 2011 at 10:05 AM, Ali Bahar <ali at internetdog.org> wrote:

>
> All right, let's take another stab at this.
>
> > 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
>
>
> My interpretation of what you got is as follows, based on what you've
> said you'll be assigning each list_head to:
>
> struct noop_data {
>    struct list_head readQueue; // You haven't explicitly stated which
>                                // LL this will be assigned to.
>    struct list_head writeQueue;// The head of a LL of 'struct bundle'
>                                // nodes.
>     struct bundle {
>      int bundleNumber;
>      int size;
>       struct list_head bundlesQueue; // The LL of 'struct bundle'
>      struct list_head reqsQueue; // The head of a LL of
>                                  // 'struct request'?
>      int filled[8];
>    } bun;
>    unsigned int starved;
> };
>
> Depending on how you're going to assign these, you may end up with
> spaghetti. As I indicated before, the nested inclusion of 'struct
> bundle' is likely wrong.
>
> later,
> ali
>
>
> > "noop_data" has a reference to start point of bundles list, called
> > "writeQueue"
> > "bundle" has a reference to start point of requests list, called
> > "reqsQueue".
> > "bundle" knows its related list using "bundlesQueue".
> > "request" knows its related list using "queuelist". (request struct is
> > already implemented in kernel)
> >
> > struct bundle {
> >     int bundleNumber;
> >     int size;
> >     struct list_head bundlesQueue;
> >     struct list_head reqsQueue;
> >     int filled[8];
> > };
> >
> > struct noop_data {
> >     struct list_head readQueue;
> >     struct list_head writeQueue;
> >     struct bundle bun;
> >     unsigned int starved;
> > };
>



-- 
Amirali Shambayati
Bachelor Student
Computer Engineering Department
Sharif University of Technology
Tehran, Iran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110606/4be09663/attachment.html 


More information about the Kernelnewbies mailing list