<div dir="ltr">Ali thanks for your valuable comments. Would you suggest me an alternative method to implement the structure I explained?<br><br><div class="gmail_quote">On Mon, Jun 6, 2011 at 10:05 AM, Ali Bahar <span dir="ltr">&lt;<a href="mailto:ali@internetdog.org">ali@internetdog.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
All right, let&#39;s take another stab at this.<br>
<div class="im"><br>
&gt; list.  But as I debugged my code, it seems that my concept is wrong. Would<br>
&gt; anyone guide me how to implement a two-dimensioned list, or introduce me a<br>
<br>
<br>
</div>My interpretation of what you got is as follows, based on what you&#39;ve<br>
said you&#39;ll be assigning each list_head to:<br>
<br>
struct noop_data {<br>
    struct list_head readQueue; // You haven&#39;t explicitly stated which<br>
                                // LL this will be assigned to.<br>
    struct list_head writeQueue;// The head of a LL of &#39;struct bundle&#39;<br>
                                // nodes.<br>
<div class="im">    struct bundle {<br>
      int bundleNumber;<br>
      int size;<br>
</div>      struct list_head bundlesQueue; // The LL of &#39;struct bundle&#39;<br>
      struct list_head reqsQueue; // The head of a LL of<br>
                                  // &#39;struct request&#39;?<br>
      int filled[8];<br>
    } bun;<br>
    unsigned int starved;<br>
};<br>
<br>
Depending on how you&#39;re going to assign these, you may end up with<br>
spaghetti. As I indicated before, the nested inclusion of &#39;struct<br>
bundle&#39; is likely wrong.<br>
<br>
later,<br>
<font color="#888888">ali<br>
</font><div><div></div><div class="h5"><br>
<br>
&gt; &quot;noop_data&quot; has a reference to start point of bundles list, called<br>
&gt; &quot;writeQueue&quot;<br>
&gt; &quot;bundle&quot; has a reference to start point of requests list, called<br>
&gt; &quot;reqsQueue&quot;.<br>
&gt; &quot;bundle&quot; knows its related list using &quot;bundlesQueue&quot;.<br>
&gt; &quot;request&quot; knows its related list using &quot;queuelist&quot;. (request struct is<br>
&gt; already implemented in kernel)<br>
&gt;<br>
&gt; struct bundle {<br>
&gt;     int bundleNumber;<br>
&gt;     int size;<br>
&gt;     struct list_head bundlesQueue;<br>
&gt;     struct list_head reqsQueue;<br>
&gt;     int filled[8];<br>
&gt; };<br>
&gt;<br>
&gt; struct noop_data {<br>
&gt;     struct list_head readQueue;<br>
&gt;     struct list_head writeQueue;<br>
&gt;     struct bundle bun;<br>
&gt;     unsigned int starved;<br>
&gt; };<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><font style="font-family: arial,helvetica,sans-serif;" size="2">Amirali Shambayati<br>Bachelor Student<br>Computer Engineering Department<br>Sharif University of Technology<br>

Tehran, Iran</font><br style="font-family: arial,helvetica,sans-serif;"><input type="hidden"><input type="hidden"><div style="font-family: arial,helvetica,sans-serif;"></div></div><br>
</div>