\doxysection{Simple doubly linked list implementation}
\label{group__linuxlist}\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ linuxlist.\+h}
\begin{DoxyCompactList}\small\item\em Simple doubly linked list implementation. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ llist\+\_\+head}
\begin{DoxyCompactList}\small\item\em (double) linked list header structure \end{DoxyCompactList}\item 
struct \textbf{ hlist\+\_\+head}
\begin{DoxyCompactList}\small\item\em Double linked lists with a single pointer list head. \end{DoxyCompactList}\item 
struct \textbf{ hlist\+\_\+node}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ inline}~\+\_\+\+\_\+inline\+\_\+\+\_\+
\item 
\#define \textbf{ container\+\_\+of}(ptr,  \textbf{ type},  member)
\begin{DoxyCompactList}\small\item\em Cast a member of a structure out to the containing structure. \end{DoxyCompactList}\item 
\#define \textbf{ LLIST\+\_\+\+POISON1}~((void $\ast$) 0x00100100)
\begin{DoxyCompactList}\small\item\em These are non-\/\+NULL pointers that will result in page faults under normal circumstances, used to verify that nobody uses non-\/initialized llist entries. \end{DoxyCompactList}\item 
\#define \textbf{ LLIST\+\_\+\+POISON2}~((void $\ast$) 0x00200200)
\item 
\#define \textbf{ LLIST\+\_\+\+HEAD\+\_\+\+INIT}(\textbf{ name})~\{ \&(\textbf{ name}), \&(\textbf{ name}) \}
\begin{DoxyCompactList}\small\item\em Define a new \doxyref{llist\+\_\+head}{p.}{structllist__head} pointing to a given \doxyref{llist\+\_\+head}{p.}{structllist__head}. \end{DoxyCompactList}\item 
\#define \textbf{ LLIST\+\_\+\+HEAD}(\textbf{ name})~ struct \textbf{ llist\+\_\+head} \textbf{ name} = \textbf{ LLIST\+\_\+\+HEAD\+\_\+\+INIT}(\textbf{ name})
\begin{DoxyCompactList}\small\item\em Define a statically-\/initialized variable of type \doxyref{llist\+\_\+head}{p.}{structllist__head}. \end{DoxyCompactList}\item 
\#define \textbf{ INIT\+\_\+\+LLIST\+\_\+\+HEAD}(ptr)
\begin{DoxyCompactList}\small\item\em Initialize a \doxyref{llist\+\_\+head}{p.}{structllist__head} to point back to itself. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+entry}(ptr,  \textbf{ type},  member)~ \textbf{ container\+\_\+of}(ptr, \textbf{ type}, member)
\begin{DoxyCompactList}\small\item\em Get the struct containing this list entry. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+first\+\_\+entry}(ptr,  \textbf{ type},  member)~ \textbf{ llist\+\_\+entry}((ptr)-\/$>$next, \textbf{ type}, member)
\begin{DoxyCompactList}\small\item\em Get the first element from a linked list. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+last\+\_\+entry}(ptr,  \textbf{ type},  member)~ \textbf{ llist\+\_\+entry}((ptr)-\/$>$prev, \textbf{ type}, member)
\begin{DoxyCompactList}\small\item\em Get the last element from a list. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+last}(head)~(head)-\/$>$prev
\begin{DoxyCompactList}\small\item\em Return the last element of the list. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+first\+\_\+entry\+\_\+or\+\_\+null}(ptr,  \textbf{ type},  member)~ (!\textbf{ llist\+\_\+empty}(ptr) ? \textbf{ llist\+\_\+first\+\_\+entry}(ptr, \textbf{ type}, member) \+: NULL)
\begin{DoxyCompactList}\small\item\em Get the first element from a list, or NULL. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+last\+\_\+entry\+\_\+or\+\_\+null}(ptr,  \textbf{ type},  member)~ (!\textbf{ llist\+\_\+empty}(ptr) ? \textbf{ llist\+\_\+last\+\_\+entry}(ptr, \textbf{ type}, member) \+: NULL)
\begin{DoxyCompactList}\small\item\em Get the last element from a list, or NULL. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each}(pos,  head)
\begin{DoxyCompactList}\small\item\em Iterate over a linked list. \end{DoxyCompactList}\item 
\#define \textbf{ \+\_\+\+\_\+llist\+\_\+for\+\_\+each}(pos,  head)~ \textbf{ for} (pos = (head)-\/$>$next; pos != (head); pos = pos-\/$>$next)
\begin{DoxyCompactList}\small\item\em Iterate over a linked list (no prefetch). \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+prev}(pos,  head)
\begin{DoxyCompactList}\small\item\em Iterate over a linked list backwards. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+safe}(pos,  \textbf{ n},  head)
\begin{DoxyCompactList}\small\item\em Iterate over a linked list, safe against removal of llist entry. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}(pos,  head,  member)
\begin{DoxyCompactList}\small\item\em Iterate over a linked list of a given type. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+reverse}(pos,  head,  member)
\begin{DoxyCompactList}\small\item\em Iterate backwards over a linked list of a given type. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+continue}(pos,  head,  member)
\begin{DoxyCompactList}\small\item\em Iterate over a linked list of a given type, continuing after an existing point. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+safe}(pos,  \textbf{ n},  head,  member)
\begin{DoxyCompactList}\small\item\em Iterate over llist of given type, safe against removal of llist entry. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+rcu}(pos,  head)
\begin{DoxyCompactList}\small\item\em Iterate over an rcu-\/protected llist. \end{DoxyCompactList}\item 
\#define \textbf{ \+\_\+\+\_\+llist\+\_\+for\+\_\+each\+\_\+rcu}(pos,  head)
\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+safe\+\_\+rcu}(pos,  \textbf{ n},  head)
\begin{DoxyCompactList}\small\item\em Iterate over an rcu-\/protected llist, safe against removal of llist entry. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+rcu}(pos,  head,  member)
\begin{DoxyCompactList}\small\item\em Iterate over an rcu-\/protected llist of a given type. \end{DoxyCompactList}\item 
\#define \textbf{ llist\+\_\+for\+\_\+each\+\_\+continue\+\_\+rcu}(pos,  head)
\begin{DoxyCompactList}\small\item\em Iterate over an rcu-\/protected llist, continuing after existing point. \end{DoxyCompactList}\item 
\#define \textbf{ HLIST\+\_\+\+HEAD\+\_\+\+INIT}~\{ .first = NULL \}
\item 
\#define \textbf{ HLIST\+\_\+\+HEAD}(\textbf{ name})~struct \textbf{ hlist\+\_\+head} \textbf{ name} = \{  .first = NULL \}
\item 
\#define \textbf{ INIT\+\_\+\+HLIST\+\_\+\+HEAD}(ptr)~((ptr)-\/$>$first = NULL)
\item 
\#define \textbf{ READ\+\_\+\+ONCE}(\textbf{ x})~\textbf{ x}
\item 
\#define \textbf{ WRITE\+\_\+\+ONCE}(a,  b)~a = b
\item 
\#define \textbf{ hlist\+\_\+entry}(ptr,  \textbf{ type},  member)~\textbf{ container\+\_\+of}(ptr,\textbf{ type},member)
\item 
\#define \textbf{ hlist\+\_\+for\+\_\+each}(pos,  head)~ \textbf{ for} (pos = (head)-\/$>$first; pos ; pos = pos-\/$>$next)
\item 
\#define \textbf{ hlist\+\_\+for\+\_\+each\+\_\+safe}(pos,  \textbf{ n},  head)
\item 
\#define \textbf{ hlist\+\_\+entry\+\_\+safe}(ptr,  \textbf{ type},  member)
\item 
\#define \textbf{ hlist\+\_\+for\+\_\+each\+\_\+entry}(pos,  head,  member)
\begin{DoxyCompactList}\small\item\em iterate over list of given type. \end{DoxyCompactList}\item 
\#define \textbf{ hlist\+\_\+for\+\_\+each\+\_\+entry\+\_\+continue}(pos,  member)
\begin{DoxyCompactList}\small\item\em iterate over a hlist continuing after current point. \end{DoxyCompactList}\item 
\#define \textbf{ hlist\+\_\+for\+\_\+each\+\_\+entry\+\_\+from}(pos,  member)
\begin{DoxyCompactList}\small\item\em iterate over a hlist continuing from current point. \end{DoxyCompactList}\item 
\#define \textbf{ hlist\+\_\+for\+\_\+each\+\_\+entry\+\_\+safe}(pos,  \textbf{ n},  head,  member)
\begin{DoxyCompactList}\small\item\em hlist\+\_\+for\+\_\+each\+\_\+entry\+\_\+safe -\/ iterate over list of given type safe against removal of list entry. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static void \textbf{ prefetch} (const void $\ast$\textbf{ x})
\item 
static void \textbf{ \+\_\+\+\_\+llist\+\_\+add} (struct \textbf{ llist\+\_\+head} $\ast$\+\_\+new, struct \textbf{ llist\+\_\+head} $\ast$prev, struct \textbf{ llist\+\_\+head} $\ast$next)
\item 
static void \textbf{ llist\+\_\+add} (struct \textbf{ llist\+\_\+head} $\ast$\+\_\+new, struct \textbf{ llist\+\_\+head} $\ast$head)
\begin{DoxyCompactList}\small\item\em Add a new entry into a linked list (at head). \end{DoxyCompactList}\item 
static void \textbf{ llist\+\_\+add\+\_\+tail} (struct \textbf{ llist\+\_\+head} $\ast$\+\_\+new, struct \textbf{ llist\+\_\+head} $\ast$head)
\begin{DoxyCompactList}\small\item\em Add a new entry into a linked list (at tail). \end{DoxyCompactList}\item 
static void \textbf{ \+\_\+\+\_\+llist\+\_\+del} (struct \textbf{ llist\+\_\+head} $\ast$prev, struct \textbf{ llist\+\_\+head} $\ast$next)
\item 
static void \textbf{ llist\+\_\+del} (struct \textbf{ llist\+\_\+head} $\ast$entry)
\begin{DoxyCompactList}\small\item\em Delete a single entry from a linked list. \end{DoxyCompactList}\item 
static void \textbf{ llist\+\_\+del\+\_\+init} (struct \textbf{ llist\+\_\+head} $\ast$entry)
\begin{DoxyCompactList}\small\item\em Delete a single entry from a linked list and reinitialize it. \end{DoxyCompactList}\item 
static void \textbf{ llist\+\_\+move} (struct \textbf{ llist\+\_\+head} $\ast$llist, struct \textbf{ llist\+\_\+head} $\ast$head)
\begin{DoxyCompactList}\small\item\em Delete from one llist and add as another\textquotesingle{}s head. \end{DoxyCompactList}\item 
static void \textbf{ llist\+\_\+move\+\_\+tail} (struct \textbf{ llist\+\_\+head} $\ast$llist, struct \textbf{ llist\+\_\+head} $\ast$head)
\begin{DoxyCompactList}\small\item\em Delete from one llist and add as another\textquotesingle{}s tail. \end{DoxyCompactList}\item 
static int \textbf{ llist\+\_\+empty} (const struct \textbf{ llist\+\_\+head} $\ast$head)
\begin{DoxyCompactList}\small\item\em Test whether a linked list is empty. \end{DoxyCompactList}\item 
static void \textbf{ \+\_\+\+\_\+llist\+\_\+splice} (struct \textbf{ llist\+\_\+head} $\ast$llist, struct \textbf{ llist\+\_\+head} $\ast$head)
\item 
static void \textbf{ llist\+\_\+splice} (struct \textbf{ llist\+\_\+head} $\ast$llist, struct \textbf{ llist\+\_\+head} $\ast$head)
\begin{DoxyCompactList}\small\item\em Join two linked lists. \end{DoxyCompactList}\item 
static void \textbf{ llist\+\_\+splice\+\_\+init} (struct \textbf{ llist\+\_\+head} $\ast$llist, struct \textbf{ llist\+\_\+head} $\ast$head)
\begin{DoxyCompactList}\small\item\em Join two llists and reinitialise the emptied llist. \end{DoxyCompactList}\item 
static unsigned int \textbf{ llist\+\_\+count} (const struct \textbf{ llist\+\_\+head} $\ast$head)
\begin{DoxyCompactList}\small\item\em Count number of llist items by iterating. \end{DoxyCompactList}\item 
static void \textbf{ INIT\+\_\+\+HLIST\+\_\+\+NODE} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ h})
\item 
static int \textbf{ hlist\+\_\+unhashed} (const struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ h})
\begin{DoxyCompactList}\small\item\em Has node been removed from list and reinitialized?. \end{DoxyCompactList}\item 
static int \textbf{ hlist\+\_\+unhashed\+\_\+lockless} (const struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ h})
\begin{DoxyCompactList}\small\item\em Version of hlist\+\_\+unhashed for lockless use. \end{DoxyCompactList}\item 
static int \textbf{ hlist\+\_\+empty} (const struct \textbf{ hlist\+\_\+head} $\ast$\textbf{ h})
\begin{DoxyCompactList}\small\item\em Is the specified \doxyref{hlist\+\_\+head}{p.}{structhlist__head} structure an empty hlist?. \end{DoxyCompactList}\item 
static void \textbf{ \+\_\+\+\_\+hlist\+\_\+del} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ n})
\item 
static void \textbf{ hlist\+\_\+del} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ n})
\begin{DoxyCompactList}\small\item\em Delete the specified \doxyref{hlist\+\_\+node}{p.}{structhlist__node} from its list. \end{DoxyCompactList}\item 
static void \textbf{ hlist\+\_\+del\+\_\+init} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ n})
\begin{DoxyCompactList}\small\item\em Delete the specified \doxyref{hlist\+\_\+node}{p.}{structhlist__node} from its list and initialize. \end{DoxyCompactList}\item 
static void \textbf{ hlist\+\_\+add\+\_\+head} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ n}, struct \textbf{ hlist\+\_\+head} $\ast$\textbf{ h})
\begin{DoxyCompactList}\small\item\em add a new entry at the beginning of the hlist. \end{DoxyCompactList}\item 
static void \textbf{ hlist\+\_\+add\+\_\+before} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ n}, struct \textbf{ hlist\+\_\+node} $\ast$next)
\begin{DoxyCompactList}\small\item\em add a new entry before the one specified. \end{DoxyCompactList}\item 
static void \textbf{ hlist\+\_\+add\+\_\+behind} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ n}, struct \textbf{ hlist\+\_\+node} $\ast$prev)
\begin{DoxyCompactList}\small\item\em add a new entry after the one specified \end{DoxyCompactList}\item 
static void \textbf{ hlist\+\_\+add\+\_\+fake} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ n})
\begin{DoxyCompactList}\small\item\em create a fake hlist consisting of a single headless node. \end{DoxyCompactList}\item 
static bool \textbf{ hlist\+\_\+fake} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ h})
\begin{DoxyCompactList}\small\item\em Is this node a fake hlist?. \end{DoxyCompactList}\item 
static bool \textbf{ hlist\+\_\+is\+\_\+singular\+\_\+node} (struct \textbf{ hlist\+\_\+node} $\ast$\textbf{ n}, struct \textbf{ hlist\+\_\+head} $\ast$\textbf{ h})
\begin{DoxyCompactList}\small\item\em is node the only element of the specified hlist?. \end{DoxyCompactList}\item 
static void \textbf{ hlist\+\_\+move\+\_\+list} (struct \textbf{ hlist\+\_\+head} $\ast$old, struct \textbf{ hlist\+\_\+head} $\ast$\+\_\+new)
\begin{DoxyCompactList}\small\item\em Move an hlist. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{group__linuxlist_ga2a514bf76d1cb343501cdd9cca2417f9}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!\_\_llist\_for\_each@{\_\_llist\_for\_each}}
\index{\_\_llist\_for\_each@{\_\_llist\_for\_each}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{\_\_llist\_for\_each}
{\footnotesize\ttfamily \#define \+\_\+\+\_\+llist\+\_\+for\+\_\+each(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head }\end{DoxyParamCaption})~ \textbf{ for} (pos = (head)-\/$>$next; pos != (head); pos = pos-\/$>$next)}



Iterate over a linked list (no prefetch). 


\begin{DoxyParams}{Parameters}
{\em pos} & the \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate.\\
\hline
\end{DoxyParams}
This variant differs from \doxyref{llist\+\_\+for\+\_\+each()}{p.}{group__linuxlist_gad96d676e71584c976305ee8a2e4dab8f} in that it\textquotesingle{}s the simplest possible llist iteration code, no prefetching is done. Use this for code that knows the llist to be very short (empty or 1 entry) most of the time. \mbox{\label{group__linuxlist_ga475083462225f0e64d957390b42e85b0}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!\_\_llist\_for\_each\_rcu@{\_\_llist\_for\_each\_rcu}}
\index{\_\_llist\_for\_each\_rcu@{\_\_llist\_for\_each\_rcu}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{\_\_llist\_for\_each\_rcu}
{\footnotesize\ttfamily \#define \+\_\+\+\_\+llist\+\_\+for\+\_\+each\+\_\+rcu(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = (head)-\/>next; pos != (head); \(\backslash\)}
\DoxyCodeLine{                pos = pos-\/>next, (\{ smp\_read\_barrier\_depends(); 0;\}))}

\end{DoxyCode}
\mbox{\label{group__linuxlist_gaf8c317a42292b61c93aae91e59118a46}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!container\_of@{container\_of}}
\index{container\_of@{container\_of}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{container\_of}
{\footnotesize\ttfamily \#define container\+\_\+of(\begin{DoxyParamCaption}\item[{}]{ptr,  }\item[{}]{\textbf{ type},  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        (\{                      \(\backslash\)}
\DoxyCodeLine{        const typeof( ((type *)0)-\/>member ) *\_\_mptr = (ptr);        \(\backslash\)}
\DoxyCodeLine{        (type *)( (\textcolor{keywordtype}{char} *)\_\_mptr -\/ offsetof(type, member) );\})}

\end{DoxyCode}


Cast a member of a structure out to the containing structure. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ptr} & the pointer to the member. \\
\hline
\mbox{\texttt{ in}}  & {\em type} & the type of the container struct this is embedded in. \\
\hline
\mbox{\texttt{ in}}  & {\em member} & the name of the member within the struct. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_gae6c5fc3a7207aad6b8ea756eaa8bb043}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_entry@{hlist\_entry}}
\index{hlist\_entry@{hlist\_entry}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_entry}
{\footnotesize\ttfamily \#define hlist\+\_\+entry(\begin{DoxyParamCaption}\item[{}]{ptr,  }\item[{}]{\textbf{ type},  }\item[{}]{member }\end{DoxyParamCaption})~\textbf{ container\+\_\+of}(ptr,\textbf{ type},member)}

\mbox{\label{group__linuxlist_ga9aba32f6dc43ee54db1eebd61df58fb0}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_entry\_safe@{hlist\_entry\_safe}}
\index{hlist\_entry\_safe@{hlist\_entry\_safe}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_entry\_safe}
{\footnotesize\ttfamily \#define hlist\+\_\+entry\+\_\+safe(\begin{DoxyParamCaption}\item[{}]{ptr,  }\item[{}]{\textbf{ type},  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        (\{ typeof(ptr) \_\_\_\_ptr = (ptr); \(\backslash\)}
\DoxyCodeLine{           \_\_\_\_ptr ? hlist\_entry(\_\_\_\_ptr, type, member) : NULL; \(\backslash\)}
\DoxyCodeLine{        \})}

\end{DoxyCode}
\mbox{\label{group__linuxlist_gac971440486bd1084a2b110f53a9ad3b7}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_for\_each@{hlist\_for\_each}}
\index{hlist\_for\_each@{hlist\_for\_each}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_for\_each}
{\footnotesize\ttfamily \#define hlist\+\_\+for\+\_\+each(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head }\end{DoxyParamCaption})~ \textbf{ for} (pos = (head)-\/$>$first; pos ; pos = pos-\/$>$next)}

\mbox{\label{group__linuxlist_ga3782c1eea66f5cacadce6e0175e4650a}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_for\_each\_entry@{hlist\_for\_each\_entry}}
\index{hlist\_for\_each\_entry@{hlist\_for\_each\_entry}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_for\_each\_entry}
{\footnotesize\ttfamily \#define hlist\+\_\+for\+\_\+each\+\_\+entry(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = hlist\_entry\_safe((head)-\/>first, typeof(*(pos)), member);\(\backslash\)}
\DoxyCodeLine{             pos;                                                       \(\backslash\)}
\DoxyCodeLine{             pos = hlist\_entry\_safe((pos)-\/>member.next, typeof(*(pos)), member))}

\end{DoxyCode}


iterate over list of given type. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em pos} & the type $\ast$ to use as a loop cursor. \\
\hline
\mbox{\texttt{ in}}  & {\em head} & the head for your list. \\
\hline
\mbox{\texttt{ in}}  & {\em member} & the name of the \doxyref{hlist\+\_\+node}{p.}{structhlist__node} within the struct. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga14191525c74317c1eac2b2384f4027e4}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_for\_each\_entry\_continue@{hlist\_for\_each\_entry\_continue}}
\index{hlist\_for\_each\_entry\_continue@{hlist\_for\_each\_entry\_continue}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_for\_each\_entry\_continue}
{\footnotesize\ttfamily \#define hlist\+\_\+for\+\_\+each\+\_\+entry\+\_\+continue(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = hlist\_entry\_safe((pos)-\/>member.next, typeof(*(pos)), member);\(\backslash\)}
\DoxyCodeLine{             pos;                                                       \(\backslash\)}
\DoxyCodeLine{             pos = hlist\_entry\_safe((pos)-\/>member.next, typeof(*(pos)), member))}

\end{DoxyCode}


iterate over a hlist continuing after current point. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em pos} & the type $\ast$ to use as a loop cursor. \\
\hline
\mbox{\texttt{ in}}  & {\em member} & the name of the \doxyref{hlist\+\_\+node}{p.}{structhlist__node} within the struct. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_gac2dd974efde450fd9c400aa45b39cee5}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_for\_each\_entry\_from@{hlist\_for\_each\_entry\_from}}
\index{hlist\_for\_each\_entry\_from@{hlist\_for\_each\_entry\_from}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_for\_each\_entry\_from}
{\footnotesize\ttfamily \#define hlist\+\_\+for\+\_\+each\+\_\+entry\+\_\+from(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (; pos;                                                     \(\backslash\)}
\DoxyCodeLine{             pos = hlist\_entry\_safe((pos)-\/>member.next, typeof(*(pos)), member))}

\end{DoxyCode}


iterate over a hlist continuing from current point. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em pos} & the type $\ast$ to use as a loop cursor. \\
\hline
\mbox{\texttt{ in}}  & {\em member} & the name of the \doxyref{hlist\+\_\+node}{p.}{structhlist__node} within the struct. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_gae2f7dd7dbbe2f13fa51aca9fcb31a03f}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_for\_each\_entry\_safe@{hlist\_for\_each\_entry\_safe}}
\index{hlist\_for\_each\_entry\_safe@{hlist\_for\_each\_entry\_safe}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_for\_each\_entry\_safe}
{\footnotesize\ttfamily \#define hlist\+\_\+for\+\_\+each\+\_\+entry\+\_\+safe(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{\textbf{ n},  }\item[{}]{head,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = hlist\_entry\_safe((head)-\/>first, typeof(*pos), member);\(\backslash\)}
\DoxyCodeLine{             pos \&\& (\{ n = pos-\/>member.next; 1; \});                    \(\backslash\)}
\DoxyCodeLine{             pos = hlist\_entry\_safe(n, typeof(*pos), member))}

\end{DoxyCode}


hlist\+\_\+for\+\_\+each\+\_\+entry\+\_\+safe -\/ iterate over list of given type safe against removal of list entry. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em pos} & the type $\ast$ to use as a loop cursor. \\
\hline
\mbox{\texttt{ out}}  & {\em n} & a \&struct \doxyref{hlist\+\_\+node}{p.}{structhlist__node} to use as temporary storage \\
\hline
\mbox{\texttt{ in}}  & {\em head} & the head for your list. \\
\hline
\mbox{\texttt{ in}}  & {\em member} & the name of the \doxyref{hlist\+\_\+node}{p.}{structhlist__node} within the struct \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga0ac51eeb1d38e770546acbe88d566211}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_for\_each\_safe@{hlist\_for\_each\_safe}}
\index{hlist\_for\_each\_safe@{hlist\_for\_each\_safe}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_for\_each\_safe}
{\footnotesize\ttfamily \#define hlist\+\_\+for\+\_\+each\+\_\+safe(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{\textbf{ n},  }\item[{}]{head }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = (head)-\/>first; pos \&\& (\{ n = pos-\/>next; 1; \}); \(\backslash\)}
\DoxyCodeLine{             pos = n)}

\end{DoxyCode}
\mbox{\label{group__linuxlist_ga5110612fedc3e1b54fce4c2143c4c788}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!HLIST\_HEAD@{HLIST\_HEAD}}
\index{HLIST\_HEAD@{HLIST\_HEAD}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{HLIST\_HEAD}
{\footnotesize\ttfamily \#define HLIST\+\_\+\+HEAD(\begin{DoxyParamCaption}\item[{}]{\textbf{ name} }\end{DoxyParamCaption})~struct \textbf{ hlist\+\_\+head} \textbf{ name} = \{  .first = NULL \}}

\mbox{\label{group__linuxlist_ga68283f4abad271853d5b25ad697b1b06}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!HLIST\_HEAD\_INIT@{HLIST\_HEAD\_INIT}}
\index{HLIST\_HEAD\_INIT@{HLIST\_HEAD\_INIT}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{HLIST\_HEAD\_INIT}
{\footnotesize\ttfamily \#define HLIST\+\_\+\+HEAD\+\_\+\+INIT~\{ .first = NULL \}}

\mbox{\label{group__linuxlist_ga502bdfb9a4a5a0d922363ea1708bf081}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!INIT\_HLIST\_HEAD@{INIT\_HLIST\_HEAD}}
\index{INIT\_HLIST\_HEAD@{INIT\_HLIST\_HEAD}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{INIT\_HLIST\_HEAD}
{\footnotesize\ttfamily \#define INIT\+\_\+\+HLIST\+\_\+\+HEAD(\begin{DoxyParamCaption}\item[{}]{ptr }\end{DoxyParamCaption})~((ptr)-\/$>$first = NULL)}

\mbox{\label{group__linuxlist_gaf2e921d75d05e3a076227eda0bbd178e}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!INIT\_LLIST\_HEAD@{INIT\_LLIST\_HEAD}}
\index{INIT\_LLIST\_HEAD@{INIT\_LLIST\_HEAD}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{INIT\_LLIST\_HEAD}
{\footnotesize\ttfamily \#define INIT\+\_\+\+LLIST\+\_\+\+HEAD(\begin{DoxyParamCaption}\item[{}]{ptr }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{do} \{ \(\backslash\)}
\DoxyCodeLine{        (ptr)-\/>next = (ptr); (ptr)-\/>prev = (ptr); \(\backslash\)}
\DoxyCodeLine{\} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}


Initialize a \doxyref{llist\+\_\+head}{p.}{structllist__head} to point back to itself. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ptr} & \doxyref{llist\+\_\+head}{p.}{structllist__head} to be initialized. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga00d24c7231be28dbaf71f5408f30e44c}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!inline@{inline}}
\index{inline@{inline}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{inline}
{\footnotesize\ttfamily \#define inline~\+\_\+\+\_\+inline\+\_\+\+\_\+}

\mbox{\label{group__linuxlist_ga1f84e98f938d62c8fbef26c9c7ec65c2}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_entry@{llist\_entry}}
\index{llist\_entry@{llist\_entry}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_entry}
{\footnotesize\ttfamily \#define llist\+\_\+entry(\begin{DoxyParamCaption}\item[{}]{ptr,  }\item[{}]{\textbf{ type},  }\item[{}]{member }\end{DoxyParamCaption})~ \textbf{ container\+\_\+of}(ptr, \textbf{ type}, member)}



Get the struct containing this list entry. 


\begin{DoxyParams}{Parameters}
{\em ptr} & the \doxyref{llist\+\_\+head}{p.}{structllist__head} pointer. \\
\hline
{\em type} & the type of the struct this is embedded in. \\
\hline
{\em member} & the name of the \doxyref{llist\+\_\+head}{p.}{structllist__head} within the struct. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga240a0e12a637f199fb292a768b405de1}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_first\_entry@{llist\_first\_entry}}
\index{llist\_first\_entry@{llist\_first\_entry}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_first\_entry}
{\footnotesize\ttfamily \#define llist\+\_\+first\+\_\+entry(\begin{DoxyParamCaption}\item[{}]{ptr,  }\item[{}]{\textbf{ type},  }\item[{}]{member }\end{DoxyParamCaption})~ \textbf{ llist\+\_\+entry}((ptr)-\/$>$next, \textbf{ type}, member)}



Get the first element from a linked list. 


\begin{DoxyParams}{Parameters}
{\em ptr} & the list head to take the element from. \\
\hline
{\em type} & the type of the struct this is embedded in. \\
\hline
{\em member} & the name of the list\+\_\+head within the struct.\\
\hline
\end{DoxyParams}
Note, that list is expected to be not empty. \mbox{\label{group__linuxlist_ga187d083598595d78dc75e8041f21a665}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_first\_entry\_or\_null@{llist\_first\_entry\_or\_null}}
\index{llist\_first\_entry\_or\_null@{llist\_first\_entry\_or\_null}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_first\_entry\_or\_null}
{\footnotesize\ttfamily \#define llist\+\_\+first\+\_\+entry\+\_\+or\+\_\+null(\begin{DoxyParamCaption}\item[{}]{ptr,  }\item[{}]{\textbf{ type},  }\item[{}]{member }\end{DoxyParamCaption})~ (!\textbf{ llist\+\_\+empty}(ptr) ? \textbf{ llist\+\_\+first\+\_\+entry}(ptr, \textbf{ type}, member) \+: NULL)}



Get the first element from a list, or NULL. 


\begin{DoxyParams}{Parameters}
{\em ptr} & the list head to take the element from. \\
\hline
{\em type} & the type of the struct this is embedded in. \\
\hline
{\em member} & the name of the list\+\_\+head within the struct.\\
\hline
\end{DoxyParams}
Note that if the list is empty, it returns NULL. \mbox{\label{group__linuxlist_gad96d676e71584c976305ee8a2e4dab8f}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each@{llist\_for\_each}}
\index{llist\_for\_each@{llist\_for\_each}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = (head)-\/>next, prefetch(pos-\/>next); pos != (head); \(\backslash\)}
\DoxyCodeLine{                pos = pos-\/>next, prefetch(pos-\/>next))}

\end{DoxyCode}


Iterate over a linked list. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_gaa7b1ce77d0c251afd378010c89eeda72}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_continue\_rcu@{llist\_for\_each\_continue\_rcu}}
\index{llist\_for\_each\_continue\_rcu@{llist\_for\_each\_continue\_rcu}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_continue\_rcu}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+continue\+\_\+rcu(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} ((pos) = (pos)-\/>next, prefetch((pos)-\/>next); (pos) != (head); \(\backslash\)}
\DoxyCodeLine{                (pos) = (pos)-\/>next, (\{ smp\_read\_barrier\_depends(); 0;\}), prefetch((pos)-\/>next))}

\end{DoxyCode}


Iterate over an rcu-\/protected llist, continuing after existing point. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga97345a3f2569e1fcc0948706602cedd8}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_entry@{llist\_for\_each\_entry}}
\index{llist\_for\_each\_entry@{llist\_for\_each\_entry}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_entry}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+entry(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = llist\_entry((head)-\/>next, typeof(*pos), member),  \(\backslash\)}
\DoxyCodeLine{                     prefetch(pos-\/>member.next);                        \(\backslash\)}
\DoxyCodeLine{             \&pos-\/>member != (head);                                    \(\backslash\)}
\DoxyCodeLine{             pos = llist\_entry(pos-\/>member.next, typeof(*pos), member),      \(\backslash\)}
\DoxyCodeLine{                     prefetch(pos-\/>member.next))}

\end{DoxyCode}


Iterate over a linked list of a given type. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \textquotesingle{}type $\ast$\textquotesingle{} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
{\em member} & the name of the \doxyref{llist\+\_\+head}{p.}{structllist__head} within the struct pos. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga19392005a8891cc3bc6919f0d9109d40}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_entry\_continue@{llist\_for\_each\_entry\_continue}}
\index{llist\_for\_each\_entry\_continue@{llist\_for\_each\_entry\_continue}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_entry\_continue}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+continue(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = llist\_entry(pos-\/>member.next, typeof(*pos), member),      \(\backslash\)}
\DoxyCodeLine{                     prefetch(pos-\/>member.next);                        \(\backslash\)}
\DoxyCodeLine{             \&pos-\/>member != (head);                                    \(\backslash\)}
\DoxyCodeLine{             pos = llist\_entry(pos-\/>member.next, typeof(*pos), member),      \(\backslash\)}
\DoxyCodeLine{                     prefetch(pos-\/>member.next))}

\end{DoxyCode}


Iterate over a linked list of a given type, continuing after an existing point. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \textquotesingle{}type $\ast$\textquotesingle{} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
{\em member} & the name of the \doxyref{llist\+\_\+head}{p.}{structllist__head} within the struct pos. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_gad6b23cdc35214b094c05b12bf5e2f6bc}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_entry\_rcu@{llist\_for\_each\_entry\_rcu}}
\index{llist\_for\_each\_entry\_rcu@{llist\_for\_each\_entry\_rcu}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_entry\_rcu}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+rcu(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = llist\_entry((head)-\/>next, typeof(*pos), member),  \(\backslash\)}
\DoxyCodeLine{                     prefetch(pos-\/>member.next);                        \(\backslash\)}
\DoxyCodeLine{             \&pos-\/>member != (head);                                    \(\backslash\)}
\DoxyCodeLine{             pos = llist\_entry(pos-\/>member.next, typeof(*pos), member),      \(\backslash\)}
\DoxyCodeLine{                     (\{ smp\_read\_barrier\_depends(); 0;\}),               \(\backslash\)}
\DoxyCodeLine{                     prefetch(pos-\/>member.next))}

\end{DoxyCode}


Iterate over an rcu-\/protected llist of a given type. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \textquotesingle{}type $\ast$\textquotesingle{} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
{\em member} & the name of the llist\+\_\+struct within the struct. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga7a24286ee8e7fb99316d4f9e4c700869}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_entry\_reverse@{llist\_for\_each\_entry\_reverse}}
\index{llist\_for\_each\_entry\_reverse@{llist\_for\_each\_entry\_reverse}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_entry\_reverse}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+reverse(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = llist\_entry((head)-\/>prev, typeof(*pos), member),  \(\backslash\)}
\DoxyCodeLine{                     prefetch(pos-\/>member.prev);                        \(\backslash\)}
\DoxyCodeLine{             \&pos-\/>member != (head);                                    \(\backslash\)}
\DoxyCodeLine{             pos = llist\_entry(pos-\/>member.prev, typeof(*pos), member),      \(\backslash\)}
\DoxyCodeLine{                     prefetch(pos-\/>member.prev))}

\end{DoxyCode}


Iterate backwards over a linked list of a given type. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \textquotesingle{}type $\ast$\textquotesingle{} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
{\em member} & the name of the \doxyref{llist\+\_\+head}{p.}{structllist__head} within the struct pos. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga50f1dafb9de33a121a8fc253634d14ca}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_entry\_safe@{llist\_for\_each\_entry\_safe}}
\index{llist\_for\_each\_entry\_safe@{llist\_for\_each\_entry\_safe}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_entry\_safe}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+safe(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{\textbf{ n},  }\item[{}]{head,  }\item[{}]{member }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = llist\_entry((head)-\/>next, typeof(*pos), member),  \(\backslash\)}
\DoxyCodeLine{                n = llist\_entry(pos-\/>member.next, typeof(*pos), member);    \(\backslash\)}
\DoxyCodeLine{             \&pos-\/>member != (head);                                    \(\backslash\)}
\DoxyCodeLine{             pos = n, n = llist\_entry(n-\/>member.next, typeof(*n), member))}

\end{DoxyCode}


Iterate over llist of given type, safe against removal of llist entry. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \textquotesingle{}type $\ast$\textquotesingle{} to use as a loop counter. \\
\hline
{\em n} & another \textquotesingle{}type $\ast$\textquotesingle{} to use as temporary storage. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
{\em member} & the name of the \doxyref{llist\+\_\+head}{p.}{structllist__head} within the struct pos. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga77afb9242115b298e62d1bfd46b66588}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_prev@{llist\_for\_each\_prev}}
\index{llist\_for\_each\_prev@{llist\_for\_each\_prev}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_prev}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+prev(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = (head)-\/>prev, prefetch(pos-\/>prev); pos != (head); \(\backslash\)}
\DoxyCodeLine{                pos = pos-\/>prev, prefetch(pos-\/>prev))}

\end{DoxyCode}


Iterate over a linked list backwards. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga6c63172418c37e36295c76256b5bfa22}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_rcu@{llist\_for\_each\_rcu}}
\index{llist\_for\_each\_rcu@{llist\_for\_each\_rcu}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_rcu}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+rcu(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{head }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = (head)-\/>next, prefetch(pos-\/>next); pos != (head); \(\backslash\)}
\DoxyCodeLine{                pos = pos-\/>next, (\{ smp\_read\_barrier\_depends(); 0;\}), prefetch(pos-\/>next))}

\end{DoxyCode}


Iterate over an rcu-\/protected llist. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as a loop counter. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga6cf45244851380bd1bb556e22390a792}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_safe@{llist\_for\_each\_safe}}
\index{llist\_for\_each\_safe@{llist\_for\_each\_safe}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_safe}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+safe(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{\textbf{ n},  }\item[{}]{head }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = (head)-\/>next, n = pos-\/>next; pos != (head); \(\backslash\)}
\DoxyCodeLine{                pos = n, n = pos-\/>next)}

\end{DoxyCode}


Iterate over a linked list, safe against removal of llist entry. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as a loop counter. \\
\hline
{\em n} & another \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as temporary storage. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga46585966f20fc18b5646c6ae7c199bbf}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_for\_each\_safe\_rcu@{llist\_for\_each\_safe\_rcu}}
\index{llist\_for\_each\_safe\_rcu@{llist\_for\_each\_safe\_rcu}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_for\_each\_safe\_rcu}
{\footnotesize\ttfamily \#define llist\+\_\+for\+\_\+each\+\_\+safe\+\_\+rcu(\begin{DoxyParamCaption}\item[{}]{pos,  }\item[{}]{\textbf{ n},  }\item[{}]{head }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (pos = (head)-\/>next, n = pos-\/>next; pos != (head); \(\backslash\)}
\DoxyCodeLine{                pos = n, (\{ smp\_read\_barrier\_depends(); 0;\}), n = pos-\/>next)}

\end{DoxyCode}


Iterate over an rcu-\/protected llist, safe against removal of llist entry. 


\begin{DoxyParams}{Parameters}
{\em pos} & the \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as a loop counter. \\
\hline
{\em n} & another \doxyref{llist\+\_\+head}{p.}{structllist__head} to use as temporary storage. \\
\hline
{\em head} & the head of the list over which to iterate. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_gadff448c2a512f7f3b1189890d6d6c18a}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!LLIST\_HEAD@{LLIST\_HEAD}}
\index{LLIST\_HEAD@{LLIST\_HEAD}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{LLIST\_HEAD}
{\footnotesize\ttfamily \#define LLIST\+\_\+\+HEAD(\begin{DoxyParamCaption}\item[{}]{\textbf{ name} }\end{DoxyParamCaption})~ struct \textbf{ llist\+\_\+head} \textbf{ name} = \textbf{ LLIST\+\_\+\+HEAD\+\_\+\+INIT}(\textbf{ name})}



Define a statically-\/initialized variable of type \doxyref{llist\+\_\+head}{p.}{structllist__head}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em name} & variable (symbol) name. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_ga01c9f49fcdc7c0b638ad0ff036a2844b}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!LLIST\_HEAD\_INIT@{LLIST\_HEAD\_INIT}}
\index{LLIST\_HEAD\_INIT@{LLIST\_HEAD\_INIT}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{LLIST\_HEAD\_INIT}
{\footnotesize\ttfamily \#define LLIST\+\_\+\+HEAD\+\_\+\+INIT(\begin{DoxyParamCaption}\item[{}]{\textbf{ name} }\end{DoxyParamCaption})~\{ \&(\textbf{ name}), \&(\textbf{ name}) \}}



Define a new \doxyref{llist\+\_\+head}{p.}{structllist__head} pointing to a given \doxyref{llist\+\_\+head}{p.}{structllist__head}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em name} & another \doxyref{llist\+\_\+head}{p.}{structllist__head} to be pointed. \\
\hline
\end{DoxyParams}
\mbox{\label{group__linuxlist_gad7a9c2c7851364a00ccdbf43fe3ff3ef}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_last@{llist\_last}}
\index{llist\_last@{llist\_last}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_last}
{\footnotesize\ttfamily \#define llist\+\_\+last(\begin{DoxyParamCaption}\item[{}]{head }\end{DoxyParamCaption})~(head)-\/$>$prev}



Return the last element of the list. 


\begin{DoxyParams}{Parameters}
{\em head} & the llist head of the list. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
last element of the list, head if the list is empty. 
\end{DoxyReturn}
\mbox{\label{group__linuxlist_ga79bdc7c0caf3ce7897d70f68959e437f}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_last\_entry@{llist\_last\_entry}}
\index{llist\_last\_entry@{llist\_last\_entry}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_last\_entry}
{\footnotesize\ttfamily \#define llist\+\_\+last\+\_\+entry(\begin{DoxyParamCaption}\item[{}]{ptr,  }\item[{}]{\textbf{ type},  }\item[{}]{member }\end{DoxyParamCaption})~ \textbf{ llist\+\_\+entry}((ptr)-\/$>$prev, \textbf{ type}, member)}



Get the last element from a list. 


\begin{DoxyParams}{Parameters}
{\em ptr} & the list head to take the element from. \\
\hline
{\em type} & the type of the struct this is embedded in. \\
\hline
{\em member} & the name of the \doxyref{llist\+\_\+head}{p.}{structllist__head} within the struct.\\
\hline
\end{DoxyParams}
Note, that list is expected to be not empty. \mbox{\label{group__linuxlist_ga68f8b64fb9c4b47214edeed13d9fc284}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_last\_entry\_or\_null@{llist\_last\_entry\_or\_null}}
\index{llist\_last\_entry\_or\_null@{llist\_last\_entry\_or\_null}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_last\_entry\_or\_null}
{\footnotesize\ttfamily \#define llist\+\_\+last\+\_\+entry\+\_\+or\+\_\+null(\begin{DoxyParamCaption}\item[{}]{ptr,  }\item[{}]{\textbf{ type},  }\item[{}]{member }\end{DoxyParamCaption})~ (!\textbf{ llist\+\_\+empty}(ptr) ? \textbf{ llist\+\_\+last\+\_\+entry}(ptr, \textbf{ type}, member) \+: NULL)}



Get the last element from a list, or NULL. 


\begin{DoxyParams}{Parameters}
{\em ptr} & the list head to take the element from. \\
\hline
{\em type} & the type of the struct this is embedded in. \\
\hline
{\em member} & the name of the list\+\_\+head within the struct.\\
\hline
\end{DoxyParams}
Note that if the list is empty, it returns NULL. \mbox{\label{group__linuxlist_ga0945ceecfc9982e1de4da25f22f180a3}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!LLIST\_POISON1@{LLIST\_POISON1}}
\index{LLIST\_POISON1@{LLIST\_POISON1}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{LLIST\_POISON1}
{\footnotesize\ttfamily \#define LLIST\+\_\+\+POISON1~((void $\ast$) 0x00100100)}



These are non-\/\+NULL pointers that will result in page faults under normal circumstances, used to verify that nobody uses non-\/initialized llist entries. 

\mbox{\label{group__linuxlist_ga0fe7e42a7c409f572ce9b990cc77f5e7}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!LLIST\_POISON2@{LLIST\_POISON2}}
\index{LLIST\_POISON2@{LLIST\_POISON2}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{LLIST\_POISON2}
{\footnotesize\ttfamily \#define LLIST\+\_\+\+POISON2~((void $\ast$) 0x00200200)}

\mbox{\label{group__linuxlist_ga940c919f63536812538bdd9bfab47267}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!READ\_ONCE@{READ\_ONCE}}
\index{READ\_ONCE@{READ\_ONCE}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{READ\_ONCE}
{\footnotesize\ttfamily \#define READ\+\_\+\+ONCE(\begin{DoxyParamCaption}\item[{}]{\textbf{ x} }\end{DoxyParamCaption})~\textbf{ x}}

\mbox{\label{group__linuxlist_ga866ec3a3adc4638dcef76dbf3d365331}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!WRITE\_ONCE@{WRITE\_ONCE}}
\index{WRITE\_ONCE@{WRITE\_ONCE}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{WRITE\_ONCE}
{\footnotesize\ttfamily \#define WRITE\+\_\+\+ONCE(\begin{DoxyParamCaption}\item[{}]{a,  }\item[{}]{b }\end{DoxyParamCaption})~a = b}



\doxysubsection{Function Documentation}
\mbox{\label{group__linuxlist_ga167c5c3fe3b88a3e499210033585c6d8}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!\_\_hlist\_del@{\_\_hlist\_del}}
\index{\_\_hlist\_del@{\_\_hlist\_del}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{\_\_hlist\_del()}
{\footnotesize\ttfamily static void \+\_\+\+\_\+hlist\+\_\+del (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ n}, \textbf{ hlist\+\_\+node\+::next}, \textbf{ hlist\+\_\+node\+::pprev}, and \textbf{ WRITE\+\_\+\+ONCE}.



Referenced by \textbf{ hlist\+\_\+del()}, and \textbf{ hlist\+\_\+del\+\_\+init()}.

\mbox{\label{group__linuxlist_ga27748bed605feed610e4cabb92cc69a8}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!\_\_llist\_add@{\_\_llist\_add}}
\index{\_\_llist\_add@{\_\_llist\_add}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{\_\_llist\_add()}
{\footnotesize\ttfamily static void \+\_\+\+\_\+llist\+\_\+add (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{\+\_\+new,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{prev,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{next }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ llist\+\_\+head\+::next}, and \textbf{ llist\+\_\+head\+::prev}.



Referenced by \textbf{ llist\+\_\+add()}, and \textbf{ llist\+\_\+add\+\_\+tail()}.

\mbox{\label{group__linuxlist_gafd6d2db9c63110be04db5421e66a64d6}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!\_\_llist\_del@{\_\_llist\_del}}
\index{\_\_llist\_del@{\_\_llist\_del}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{\_\_llist\_del()}
{\footnotesize\ttfamily static void \+\_\+\+\_\+llist\+\_\+del (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{prev,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{next }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ llist\+\_\+head\+::next}, and \textbf{ llist\+\_\+head\+::prev}.



Referenced by \textbf{ llist\+\_\+del()}, \textbf{ llist\+\_\+del\+\_\+init()}, \textbf{ llist\+\_\+move()}, and \textbf{ llist\+\_\+move\+\_\+tail()}.

\mbox{\label{group__linuxlist_ga86930ef85d10c1acd97d858354bd5895}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!\_\_llist\_splice@{\_\_llist\_splice}}
\index{\_\_llist\_splice@{\_\_llist\_splice}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{\_\_llist\_splice()}
{\footnotesize\ttfamily static void \+\_\+\+\_\+llist\+\_\+splice (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{llist,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ llist\+\_\+head\+::next}, and \textbf{ llist\+\_\+head\+::prev}.



Referenced by \textbf{ llist\+\_\+splice()}, and \textbf{ llist\+\_\+splice\+\_\+init()}.

\mbox{\label{group__linuxlist_ga254a79dcc8e7dd5662a4e67fcd04ed10}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_add\_before@{hlist\_add\_before}}
\index{hlist\_add\_before@{hlist\_add\_before}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_add\_before()}
{\footnotesize\ttfamily static void hlist\+\_\+add\+\_\+before (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{n,  }\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{next }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



add a new entry before the one specified. 

~\newline
\+: new entry to be added @next\+: hlist node to add it before, which must be non-\/\+NULL 

References \textbf{ n}, \textbf{ hlist\+\_\+node\+::next}, \textbf{ hlist\+\_\+node\+::pprev}, and \textbf{ WRITE\+\_\+\+ONCE}.

\mbox{\label{group__linuxlist_ga1fbe29c1c50047605c98a600f98e5d2b}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_add\_behind@{hlist\_add\_behind}}
\index{hlist\_add\_behind@{hlist\_add\_behind}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_add\_behind()}
{\footnotesize\ttfamily static void hlist\+\_\+add\+\_\+behind (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{n,  }\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{prev }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



add a new entry after the one specified 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & new entry to be added \\
\hline
\mbox{\texttt{ in}}  & {\em prev} & hlist node to add it after, which must be non-\/\+NULL \\
\hline
\end{DoxyParams}


References \textbf{ n}, \textbf{ hlist\+\_\+node\+::next}, and \textbf{ WRITE\+\_\+\+ONCE}.

\mbox{\label{group__linuxlist_ga747b74cb99ecd18d18cc564449082121}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_add\_fake@{hlist\_add\_fake}}
\index{hlist\_add\_fake@{hlist\_add\_fake}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_add\_fake()}
{\footnotesize\ttfamily static void hlist\+\_\+add\+\_\+fake (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



create a fake hlist consisting of a single headless node. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & Node to make a fake list out of\\
\hline
\end{DoxyParams}
This makes ~\newline
 appear to be its own predecessor on a headless hlist. The point of this is to allow things like \doxyref{hlist\+\_\+del()}{p.}{group__linuxlist_gaa7bb9806633e74fad4c0f4ba8d3ac850} to work correctly in cases where there is no list. 

References \textbf{ n}.

\mbox{\label{group__linuxlist_gad7a242949abf03ff2ae417686a4451cd}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_add\_head@{hlist\_add\_head}}
\index{hlist\_add\_head@{hlist\_add\_head}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_add\_head()}
{\footnotesize\ttfamily static void hlist\+\_\+add\+\_\+head (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{n,  }\item[{struct \textbf{ hlist\+\_\+head} $\ast$}]{h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



add a new entry at the beginning of the hlist. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & new entry to be added \\
\hline
\mbox{\texttt{ in}}  & {\em h} & hlist head to add it after\\
\hline
\end{DoxyParams}
Insert a new entry after the specified head. This is good for implementing stacks. 

References \textbf{ h}, \textbf{ n}, \textbf{ hlist\+\_\+node\+::pprev}, and \textbf{ WRITE\+\_\+\+ONCE}.

\mbox{\label{group__linuxlist_gaa7bb9806633e74fad4c0f4ba8d3ac850}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_del@{hlist\_del}}
\index{hlist\_del@{hlist\_del}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_del()}
{\footnotesize\ttfamily static void hlist\+\_\+del (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Delete the specified \doxyref{hlist\+\_\+node}{p.}{structhlist__node} from its list. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & Node to delete.\\
\hline
\end{DoxyParams}
Note that this function leaves the node in hashed state. Use \doxyref{hlist\+\_\+del\+\_\+init()}{p.}{group__linuxlist_ga2e00d6f98de0c25c46a7645a0b6f4d5f} or similar instead to unhash ~\newline
. 

References \textbf{ \+\_\+\+\_\+hlist\+\_\+del()}, \textbf{ LLIST\+\_\+\+POISON1}, \textbf{ LLIST\+\_\+\+POISON2}, and \textbf{ n}.

\mbox{\label{group__linuxlist_ga2e00d6f98de0c25c46a7645a0b6f4d5f}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_del\_init@{hlist\_del\_init}}
\index{hlist\_del\_init@{hlist\_del\_init}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_del\_init()}
{\footnotesize\ttfamily static void hlist\+\_\+del\+\_\+init (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Delete the specified \doxyref{hlist\+\_\+node}{p.}{structhlist__node} from its list and initialize. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & Node to delete.\\
\hline
\end{DoxyParams}
Note that this function leaves the node in unhashed state. 

References \textbf{ \+\_\+\+\_\+hlist\+\_\+del()}, \textbf{ hlist\+\_\+unhashed()}, \textbf{ INIT\+\_\+\+HLIST\+\_\+\+NODE()}, and \textbf{ n}.



Referenced by \textbf{ hash\+\_\+del()}.

\mbox{\label{group__linuxlist_gaf610dde21167bf116937c81c393a229f}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_empty@{hlist\_empty}}
\index{hlist\_empty@{hlist\_empty}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_empty()}
{\footnotesize\ttfamily static int hlist\+\_\+empty (\begin{DoxyParamCaption}\item[{const struct \textbf{ hlist\+\_\+head} $\ast$}]{h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Is the specified \doxyref{hlist\+\_\+head}{p.}{structhlist__head} structure an empty hlist?. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em h} & Structure to check. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if hlist is empty; 0 if not 
\end{DoxyReturn}


References \textbf{ h}, and \textbf{ READ\+\_\+\+ONCE}.



Referenced by \textbf{ \+\_\+\+\_\+hash\+\_\+empty()}.

\mbox{\label{group__linuxlist_ga31635d5a90d316dc84c467035cf1faa5}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_fake@{hlist\_fake}}
\index{hlist\_fake@{hlist\_fake}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_fake()}
{\footnotesize\ttfamily static bool hlist\+\_\+fake (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Is this node a fake hlist?. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em h} & Node to check for being a self-\/referential fake hlist. \\
\hline
\end{DoxyParams}


References \textbf{ h}.

\mbox{\label{group__linuxlist_ga731ab779ea3e4cd83b30d426343c4004}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_is\_singular\_node@{hlist\_is\_singular\_node}}
\index{hlist\_is\_singular\_node@{hlist\_is\_singular\_node}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_is\_singular\_node()}
{\footnotesize\ttfamily static bool hlist\+\_\+is\+\_\+singular\+\_\+node (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{n,  }\item[{struct \textbf{ hlist\+\_\+head} $\ast$}]{h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



is node the only element of the specified hlist?. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & Node to check for singularity. \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Header for potentially singular list.\\
\hline
\end{DoxyParams}
Check whether the node is the only node of the head without accessing head, thus avoiding unnecessary cache misses. 

References \textbf{ h}, and \textbf{ n}.

\mbox{\label{group__linuxlist_gaf02cef831e71a3b292a603e8e79947c5}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_move\_list@{hlist\_move\_list}}
\index{hlist\_move\_list@{hlist\_move\_list}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_move\_list()}
{\footnotesize\ttfamily static void hlist\+\_\+move\+\_\+list (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+head} $\ast$}]{old,  }\item[{struct \textbf{ hlist\+\_\+head} $\ast$}]{\+\_\+new }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Move an hlist. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em old} & \doxyref{hlist\+\_\+head}{p.}{structhlist__head} for old list. \\
\hline
\mbox{\texttt{ in}}  & {\em new} & \doxyref{hlist\+\_\+head}{p.}{structhlist__head} for new list.\\
\hline
\end{DoxyParams}
Move a list from one list head to another. Fixup the pprev reference of the first entry if it exists. 

References \textbf{ hlist\+\_\+head\+::first}, and \textbf{ hlist\+\_\+node\+::pprev}.

\mbox{\label{group__linuxlist_ga7f946d296ab41ce808e96d529a4106d6}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_unhashed@{hlist\_unhashed}}
\index{hlist\_unhashed@{hlist\_unhashed}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_unhashed()}
{\footnotesize\ttfamily static int hlist\+\_\+unhashed (\begin{DoxyParamCaption}\item[{const struct \textbf{ hlist\+\_\+node} $\ast$}]{h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Has node been removed from list and reinitialized?. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em h} & Node to be checked \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if node is unhashed; 0 if not
\end{DoxyReturn}
Not that not all removal functions will leave a node in unhashed state. For example, hlist\+\_\+nulls\+\_\+del\+\_\+init\+\_\+rcu() does leave the node in unhashed state, but hlist\+\_\+nulls\+\_\+del() does not. 

References \textbf{ h}.



Referenced by \textbf{ hash\+\_\+hashed()}, and \textbf{ hlist\+\_\+del\+\_\+init()}.

\mbox{\label{group__linuxlist_gae3985ebce1eb0d0793c579a93a26d0d3}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!hlist\_unhashed\_lockless@{hlist\_unhashed\_lockless}}
\index{hlist\_unhashed\_lockless@{hlist\_unhashed\_lockless}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{hlist\_unhashed\_lockless()}
{\footnotesize\ttfamily static int hlist\+\_\+unhashed\+\_\+lockless (\begin{DoxyParamCaption}\item[{const struct \textbf{ hlist\+\_\+node} $\ast$}]{h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Version of hlist\+\_\+unhashed for lockless use. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & Node to be checked \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if node is unhashed; 0 if not
\end{DoxyReturn}
This variant of \doxyref{hlist\+\_\+unhashed()}{p.}{group__linuxlist_ga7f946d296ab41ce808e96d529a4106d6} must be used in lockless contexts to avoid potential load-\/tearing. The \doxyref{READ\+\_\+\+ONCE()}{p.}{group__linuxlist_ga940c919f63536812538bdd9bfab47267} is paired with the various \doxyref{WRITE\+\_\+\+ONCE()}{p.}{group__linuxlist_ga866ec3a3adc4638dcef76dbf3d365331} in hlist helpers that are defined below. 

References \textbf{ h}, and \textbf{ READ\+\_\+\+ONCE}.

\mbox{\label{group__linuxlist_ga51c087ca2431577ad4f6f8cc77349b0c}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!INIT\_HLIST\_NODE@{INIT\_HLIST\_NODE}}
\index{INIT\_HLIST\_NODE@{INIT\_HLIST\_NODE}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{INIT\_HLIST\_NODE()}
{\footnotesize\ttfamily static void INIT\+\_\+\+HLIST\+\_\+\+NODE (\begin{DoxyParamCaption}\item[{struct \textbf{ hlist\+\_\+node} $\ast$}]{h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ h}.



Referenced by \textbf{ hlist\+\_\+del\+\_\+init()}.

\mbox{\label{group__linuxlist_ga5f132e77289bdaac056f40281dad2158}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_add@{llist\_add}}
\index{llist\_add@{llist\_add}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_add()}
{\footnotesize\ttfamily static void llist\+\_\+add (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{\+\_\+new,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Add a new entry into a linked list (at head). 


\begin{DoxyParams}{Parameters}
{\em \+\_\+new} & the entry to be added. \\
\hline
{\em head} & \doxyref{llist\+\_\+head}{p.}{structllist__head} to prepend the element to.\\
\hline
\end{DoxyParams}
Insert a new entry after the specified head. This is good for implementing stacks. 

References \textbf{ \+\_\+\+\_\+llist\+\_\+add()}, and \textbf{ llist\+\_\+head\+::next}.



Referenced by \textbf{ iofd\+\_\+txqueue\+\_\+enqueue\+\_\+front()}, \textbf{ llist\+\_\+move()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+alloc()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+change\+\_\+parent()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+alloc()}, \textbf{ osmo\+\_\+timers\+\_\+update()}, \textbf{ osmo\+\_\+wqueue\+\_\+bfd\+\_\+cb()}, and \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+alloc()}.

\mbox{\label{group__linuxlist_gaf20ef02827bff46a825aee413b8817ad}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_add\_tail@{llist\_add\_tail}}
\index{llist\_add\_tail@{llist\_add\_tail}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_add\_tail()}
{\footnotesize\ttfamily static void llist\+\_\+add\+\_\+tail (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{\+\_\+new,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Add a new entry into a linked list (at tail). 


\begin{DoxyParams}{Parameters}
{\em \+\_\+new} & the entry to be added. \\
\hline
{\em head} & \doxyref{llist\+\_\+head}{p.}{structllist__head} to append the element to.\\
\hline
\end{DoxyParams}
Insert a new entry before the specified head. This is useful for implementing queues. 

References \textbf{ \+\_\+\+\_\+llist\+\_\+add()}, and \textbf{ llist\+\_\+head\+::prev}.



Referenced by \textbf{ \+\_\+osmo\+\_\+use\+\_\+count\+\_\+get\+\_\+put()}, \textbf{ alloc\+\_\+entry()}, \textbf{ iofd\+\_\+txqueue\+\_\+enqueue()}, \textbf{ llist\+\_\+move\+\_\+tail()}, \textbf{ log\+\_\+add\+\_\+target()}, \textbf{ msgb\+\_\+enqueue()}, \textbf{ netdev\+\_\+netns\+\_\+ctx\+\_\+alloc()}, \textbf{ osmo\+\_\+counter\+\_\+alloc()}, \textbf{ osmo\+\_\+fsm\+\_\+register()}, \textbf{ osmo\+\_\+netdev\+\_\+alloc()}, \textbf{ osmo\+\_\+signal\+\_\+register\+\_\+handler()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+alloc()}, \textbf{ osmo\+\_\+use\+\_\+count\+\_\+create()}, and \textbf{ osmo\+\_\+use\+\_\+count\+\_\+make\+\_\+static\+\_\+entries()}.

\mbox{\label{group__linuxlist_ga00add30f39d6a125d5685dd666f30db0}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_count@{llist\_count}}
\index{llist\_count@{llist\_count}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_count()}
{\footnotesize\ttfamily static unsigned int llist\+\_\+count (\begin{DoxyParamCaption}\item[{const struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Count number of llist items by iterating. 


\begin{DoxyParams}{Parameters}
{\em head} & the llist head to count items of. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Number of items.
\end{DoxyReturn}
This function is not efficient, mostly useful for small lists and non time critical cases like unit tests. 

References \textbf{ llist\+\_\+for\+\_\+each}.



Referenced by \textbf{ osmo\+\_\+counters\+\_\+count()}.

\mbox{\label{group__linuxlist_gad17c7ec79e2cfd08c7d7f5a455065d3f}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_del@{llist\_del}}
\index{llist\_del@{llist\_del}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_del()}
{\footnotesize\ttfamily static void llist\+\_\+del (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{entry }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Delete a single entry from a linked list. 


\begin{DoxyParams}{Parameters}
{\em entry} & the element to delete.\\
\hline
\end{DoxyParams}
Note\+: llist\+\_\+empty on entry does not return true after this, the entry is in an undefined state. 

References \textbf{ \+\_\+\+\_\+llist\+\_\+del()}, \textbf{ LLIST\+\_\+\+POISON1}, \textbf{ LLIST\+\_\+\+POISON2}, \textbf{ llist\+\_\+head\+::next}, and \textbf{ llist\+\_\+head\+::prev}.



Referenced by \textbf{ \+\_\+osmo\+\_\+fsm\+\_\+inst\+\_\+term()}, \textbf{ \+\_\+osmo\+\_\+use\+\_\+count\+\_\+get\+\_\+put()}, \textbf{ iofd\+\_\+txqueue\+\_\+dequeue()}, \textbf{ log\+\_\+del\+\_\+target()}, \textbf{ msgb\+\_\+dequeue()}, \textbf{ netdev\+\_\+netns\+\_\+ctx\+\_\+free()}, \textbf{ osmo\+\_\+counter\+\_\+free()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+free()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+unlink\+\_\+parent()}, \textbf{ osmo\+\_\+fsm\+\_\+unregister()}, \textbf{ osmo\+\_\+netdev\+\_\+free()}, \textbf{ osmo\+\_\+signal\+\_\+unregister\+\_\+handler()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+free()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+free()}, \textbf{ osmo\+\_\+use\+\_\+count\+\_\+free()}, and \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+free()}.

\mbox{\label{group__linuxlist_ga34cd312e2bd3c6a9d6c2ee9f0edd614d}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_del\_init@{llist\_del\_init}}
\index{llist\_del\_init@{llist\_del\_init}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_del\_init()}
{\footnotesize\ttfamily static void llist\+\_\+del\+\_\+init (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{entry }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Delete a single entry from a linked list and reinitialize it. 


\begin{DoxyParams}{Parameters}
{\em entry} & the element to delete and reinitialize. \\
\hline
\end{DoxyParams}


References \textbf{ \+\_\+\+\_\+llist\+\_\+del()}, \textbf{ INIT\+\_\+\+LLIST\+\_\+\+HEAD}, \textbf{ llist\+\_\+head\+::next}, and \textbf{ llist\+\_\+head\+::prev}.



Referenced by \textbf{ osmo\+\_\+timer\+\_\+del()}.

\mbox{\label{group__linuxlist_gac458d7d13167c67bc3591038ef23405d}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_empty@{llist\_empty}}
\index{llist\_empty@{llist\_empty}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_empty()}
{\footnotesize\ttfamily static int llist\+\_\+empty (\begin{DoxyParamCaption}\item[{const struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Test whether a linked list is empty. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em head} & the llist to test. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if the list is empty, 0 otherwise. 
\end{DoxyReturn}


References \textbf{ llist\+\_\+head\+::next}.



Referenced by \textbf{ \+\_\+osmo\+\_\+fsm\+\_\+inst\+\_\+term\+\_\+children()}, \textbf{ llist\+\_\+splice()}, \textbf{ llist\+\_\+splice\+\_\+init()}, \textbf{ msgb\+\_\+dequeue()}, \textbf{ osmo\+\_\+stats\+\_\+timer\+\_\+cb()}, \textbf{ osmo\+\_\+timer\+\_\+del()}, \textbf{ osmo\+\_\+wqueue\+\_\+bfd\+\_\+cb()}, \textbf{ osmo\+\_\+wqueue\+\_\+clear()}, and \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+free()}.

\mbox{\label{group__linuxlist_gacb13d12e3ffb0a19db837b56c4df39f9}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_move@{llist\_move}}
\index{llist\_move@{llist\_move}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_move()}
{\footnotesize\ttfamily static void llist\+\_\+move (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{llist,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Delete from one llist and add as another\textquotesingle{}s head. 


\begin{DoxyParams}{Parameters}
{\em llist} & the entry to move. \\
\hline
{\em head} & the head that will precede our entry. \\
\hline
\end{DoxyParams}


References \textbf{ \+\_\+\+\_\+llist\+\_\+del()}, \textbf{ llist\+\_\+add()}, \textbf{ llist\+\_\+head\+::next}, and \textbf{ llist\+\_\+head\+::prev}.

\mbox{\label{group__linuxlist_ga4486dca126d71c055b4871bbed8e8b83}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_move\_tail@{llist\_move\_tail}}
\index{llist\_move\_tail@{llist\_move\_tail}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_move\_tail()}
{\footnotesize\ttfamily static void llist\+\_\+move\+\_\+tail (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{llist,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Delete from one llist and add as another\textquotesingle{}s tail. 


\begin{DoxyParams}{Parameters}
{\em llist} & the entry to move. \\
\hline
{\em head} & the head that will follow our entry. \\
\hline
\end{DoxyParams}


References \textbf{ \+\_\+\+\_\+llist\+\_\+del()}, \textbf{ llist\+\_\+add\+\_\+tail()}, \textbf{ llist\+\_\+head\+::next}, and \textbf{ llist\+\_\+head\+::prev}.

\mbox{\label{group__linuxlist_ga2ce1fd536f10818240abdfe08a6d9385}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_splice@{llist\_splice}}
\index{llist\_splice@{llist\_splice}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_splice()}
{\footnotesize\ttfamily static void llist\+\_\+splice (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{llist,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Join two linked lists. 


\begin{DoxyParams}{Parameters}
{\em llist} & the new linked list to add. \\
\hline
{\em head} & the place to add llist within the other list. \\
\hline
\end{DoxyParams}


References \textbf{ \+\_\+\+\_\+llist\+\_\+splice()}, and \textbf{ llist\+\_\+empty()}.

\mbox{\label{group__linuxlist_ga53109ddcf1c7c415bbec076e40ee5145}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!llist\_splice\_init@{llist\_splice\_init}}
\index{llist\_splice\_init@{llist\_splice\_init}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{llist\_splice\_init()}
{\footnotesize\ttfamily static void llist\+\_\+splice\+\_\+init (\begin{DoxyParamCaption}\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{llist,  }\item[{struct \textbf{ llist\+\_\+head} $\ast$}]{head }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Join two llists and reinitialise the emptied llist. 


\begin{DoxyParams}{Parameters}
{\em llist} & the new linked list to add. \\
\hline
{\em head} & the place to add it within the first llist.\\
\hline
\end{DoxyParams}
The llist is reinitialised. 

References \textbf{ \+\_\+\+\_\+llist\+\_\+splice()}, \textbf{ INIT\+\_\+\+LLIST\+\_\+\+HEAD}, and \textbf{ llist\+\_\+empty()}.

\mbox{\label{group__linuxlist_gae275c0b0ac104e39bc5980a08925ecee}} 
\index{Simple doubly linked list implementation@{Simple doubly linked list implementation}!prefetch@{prefetch}}
\index{prefetch@{prefetch}!Simple doubly linked list implementation@{Simple doubly linked list implementation}}
\doxysubsubsection{prefetch()}
{\footnotesize\ttfamily static void prefetch (\begin{DoxyParamCaption}\item[{const void $\ast$}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

