Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
plist.h File Reference
#include <linux/kernel.h>
#include <linux/list.h>

Go to the source code of this file.

Data Structures

struct  plist_head
 
struct  plist_node
 

Macros

#define PLIST_HEAD_INIT(head)
 
#define PLIST_NODE_INIT(node, __prio)
 
#define plist_for_each(pos, head)   list_for_each_entry(pos, &(head)->node_list, node_list)
 
#define plist_for_each_safe(pos, n, head)   list_for_each_entry_safe(pos, n, &(head)->node_list, node_list)
 
#define plist_for_each_entry(pos, head, mem)   list_for_each_entry(pos, &(head)->node_list, mem.node_list)
 
#define plist_for_each_entry_safe(pos, n, head, m)   list_for_each_entry_safe(pos, n, &(head)->node_list, m.node_list)
 
#define plist_first_entry(head, type, member)   container_of(plist_first(head), type, member)
 
#define plist_last_entry(head, type, member)   container_of(plist_last(head), type, member)
 

Functions

void plist_add (struct plist_node *node, struct plist_head *head)
 
void plist_del (struct plist_node *node, struct plist_head *head)
 

Macro Definition Documentation

#define plist_first_entry (   head,
  type,
  member 
)    container_of(plist_first(head), type, member)

plist_first_entry - get the struct for the first entry : the &struct plist_head pointer : the type of the struct this is embedded in : the name of the list_struct within the struct

Definition at line 210 of file plist.h.

#define plist_for_each (   pos,
  head 
)    list_for_each_entry(pos, &(head)->node_list, node_list)

plist_for_each - iterate over the plist : the type * to use as a loop counter : the head for your list

Definition at line 142 of file plist.h.

#define plist_for_each_entry (   pos,
  head,
  mem 
)    list_for_each_entry(pos, &(head)->node_list, mem.node_list)

plist_for_each_entry - iterate over list of given type : the type * to use as a loop counter : the head for your list : the name of the list_struct within the struct

Definition at line 162 of file plist.h.

#define plist_for_each_entry_safe (   pos,
  n,
  head,
  m 
)    list_for_each_entry_safe(pos, n, &(head)->node_list, m.node_list)

plist_for_each_entry_safe - iterate safely over list of given type : the type * to use as a loop counter
: another type * to use as temporary storage : the head for your list : the name of the list_struct within the struct

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

Definition at line 174 of file plist.h.

#define plist_for_each_safe (   pos,
  n,
  head 
)    list_for_each_entry_safe(pos, n, &(head)->node_list, node_list)

plist_for_each_safe - iterate safely over a plist of given type : the type * to use as a loop counter
: another type * to use as temporary storage : the head for your list

Iterate over a plist of given type, safe against removal of list entry.

Definition at line 153 of file plist.h.

#define PLIST_HEAD_INIT (   head)
Value:
{ \
.node_list = LIST_HEAD_INIT((head).node_list) \
}

PLIST_HEAD_INIT - static struct plist_head initializer : struct plist_head variable name

Definition at line 95 of file plist.h.

#define plist_last_entry (   head,
  type,
  member 
)    container_of(plist_last(head), type, member)

plist_last_entry - get the struct for the last entry : the &struct plist_head pointer : the type of the struct this is embedded in : the name of the list_struct within the struct

Definition at line 227 of file plist.h.

#define PLIST_NODE_INIT (   node,
  __prio 
)
Value:
{ \
.prio = (__prio), \
.prio_list = LIST_HEAD_INIT((node).prio_list), \
.node_list = LIST_HEAD_INIT((node).node_list), \
}

PLIST_NODE_INIT - static struct plist_node initializer : struct plist_node variable name : initial node priority

Definition at line 105 of file plist.h.

Function Documentation

void plist_add ( struct plist_node node,
struct plist_head head 
)

plist_add - add to

: &struct plist_node pointer : &struct plist_head pointer

Definition at line 75 of file plist.c.

void plist_del ( struct plist_node node,
struct plist_head head 
)

plist_del - Remove a from plist.

: &struct plist_node pointer - entry to be removed : &struct plist_head pointer - list head

Definition at line 114 of file plist.c.