lkml.org 
[lkml]   [2008]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [TOMOYO #7 02/30] Internal functions prototypes for SAKURA andTOMOYO.
From
Date
Daniel Walker wrote:
> > +/**
> > + * list1_entry - get the struct for this entry
> > + * @ptr: the &struct list1_head pointer.
> > + * @type: the type of the struct this is embedded in.
> > + * @member: the name of the list1_struct within the struct.
> > + */
> > +#define list1_entry(ptr, type, member) container_of(ptr, type,
> > member)
> > +
> > +/**
> > + * list1_for_each - iterate over a list
> > + * @pos: the &struct list1_head to use as a loop cursor.
> > + * @head: the head for your list.
> > + */
> > +#define list1_for_each(pos,
> > head) \
> > + for (pos = (head)->next; prefetch(pos->next), pos !=
> > (head); \
> > + pos = pos->next)
> > +
>
> These should go into include/linux/list.h .. It looks like you are
> duplicate at least some of what is already in there..

I see. I'll move it on next posting.
Although people advised me to use standard doubly linked list,
TOMOYO wants to use singly linked list because the elements are append only.
If TOMOYO is allowed to use singly linked list, it can make the source code read lock free.

Thank you.


\
 
 \ /
  Last update: 2008-04-07 15:59    [W:0.118 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site