RE: crap, i think LKD3 explains linked list head nodes incorrectly ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
>   that also suggests that a passage on p. 91 of LKD3 is 
> inaccurate, where it claims that "because the lists are 
> circular, you can generally pass any element for head."  but 
> that can't be right, since you must *always* keep track of 
> the head node for any list, to avoid processing it normally.  
> if you simply drop someone into the middle of a circular, 
> doubly-linked kernel list, there is no way that i can see to 
> know which node in that list is the head node when you run 
> across it during iteration.
> 
>   does this make sense?
> 

I think you are assuming that all lists have a separate list_head structure
to locate the head of the list. I am not sure that is correct. For example,
the task structures are linked toghether in a curcular list with no separate
list_head structure.  The init_task->tasks.next field is usually the
starting point, but current->tasks.next should work just as well.

Bruce


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux