<div dir="ltr">I forgot to say that I use INIT_LIST_HEAD(&nd->writeQueue) and when I malloc a bundle, I use INIT_LIST_HEAD(&bun->reqsQueue)<br>to make them as list heads. "nd" and "bun" are instantiations for noop_data and bundle.<br>
<br><div class="gmail_quote">On Mon, Jun 6, 2011 at 11:01 AM, Amirali Shambayati <span dir="ltr"><<a href="mailto:amirali.shambayati@gmail.com">amirali.shambayati@gmail.com</a>></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;">
<div dir="ltr">As I have read this pdf, I think I have assigned them right. I don't know what's wrong? :-?<br><span><cite><a href="https://prof.hti.bfh.ch/myf1/adv-linux/courseNotes/" target="_blank">https://prof.hti.bfh.ch/myf1/adv-linux/courseNotes/</a><b>klist</b>-<b>intro</b>-1.3.<b>pdf</b></cite></span><div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Mon, Jun 6, 2011 at 10:52 AM, Amirali Shambayati <span dir="ltr"><<a href="mailto:amirali.shambayati@gmail.com" target="_blank">amirali.shambayati@gmail.com</a>></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;">
<div dir="ltr">As I have read the attached pdf, I think I have assigned them right. I don't know what's wrong? :-?<div><div></div><div><br><br><div class="gmail_quote">On Mon, Jun 6, 2011 at 10:43 AM, Amirali Shambayati <span dir="ltr"><<a href="mailto:amirali.shambayati@gmail.com" target="_blank">amirali.shambayati@gmail.com</a>></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;"><div dir="ltr">Ali thanks for your valuable comments. Would you suggest me an alternative method to implement the structure I explained?<div>
<div></div><div><br><br><div class="gmail_quote">On Mon, Jun 6, 2011 at 10:05 AM, Ali Bahar <span dir="ltr"><<a href="mailto:ali@internetdog.org" target="_blank">ali@internetdog.org</a>></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's take another stab at this.<br>
<div><br>
> list. But as I debugged my code, it seems that my concept is wrong. Would<br>
> 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've<br>
said you'll be assigning each list_head to:<br>
<br>
struct noop_data {<br>
struct list_head readQueue; // You haven't explicitly stated which<br>
// LL this will be assigned to.<br>
struct list_head writeQueue;// The head of a LL of 'struct bundle'<br>
// nodes.<br>
<div> struct bundle {<br>
int bundleNumber;<br>
int size;<br>
</div> struct list_head bundlesQueue; // The LL of 'struct bundle'<br>
struct list_head reqsQueue; // The head of a LL of<br>
// 'struct request'?<br>
int filled[8];<br>
} bun;<br>
unsigned int starved;<br>
};<br>
<br>
Depending on how you're going to assign these, you may end up with<br>
spaghetti. As I indicated before, the nested inclusion of 'struct<br>
bundle' is likely wrong.<br>
<br>
later,<br>
<font color="#888888">ali<br>
</font><div><div></div><div><br>
<br>
> "noop_data" has a reference to start point of bundles list, called<br>
> "writeQueue"<br>
> "bundle" has a reference to start point of requests list, called<br>
> "reqsQueue".<br>
> "bundle" knows its related list using "bundlesQueue".<br>
> "request" knows its related list using "queuelist". (request struct is<br>
> already implemented in kernel)<br>
><br>
> struct bundle {<br>
> int bundleNumber;<br>
> int size;<br>
> struct list_head bundlesQueue;<br>
> struct list_head reqsQueue;<br>
> int filled[8];<br>
> };<br>
><br>
> struct noop_data {<br>
> struct list_head readQueue;<br>
> struct list_head writeQueue;<br>
> struct bundle bun;<br>
> unsigned int starved;<br>
> };<br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><div>-- <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></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></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></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>