#include "prefetch.h"
Include dependency graph for dlist.h:
Go to the source code of this file.
Data Structures | |
struct | hlist_head |
struct | hlist_node |
Defines | |
#define | HLIST_HEAD_INIT { .first = NULL } |
#define | HLIST_HEAD(name) struct hlist_head name = { .first = NULL } |
#define | INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) |
#define | INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL) |
#define | hlist_entry(ptr, type, member) container_of(ptr,type,member) |
#define | hlist_for_each(pos, head) |
#define | hlist_for_each_safe(pos, n, head) |
#define | hlist_for_each_entry(tpos, pos, head, member) |
#define | hlist_for_each_entry_continue(tpos, pos, member) |
#define | hlist_for_each_entry_from(tpos, pos, member) |
#define | hlist_for_each_entry_safe(tpos, pos, n, head, member) |
Functions | |
static int | hlist_unhashed (const struct hlist_node *h) |
static int | hlist_empty (const struct hlist_head *h) |
static void | __hlist_del (struct hlist_node *n) |
static void | hlist_del (struct hlist_node *n) |
static void | hlist_del_init (struct hlist_node *n) |
static void | hlist_add_head (struct hlist_node *n, struct hlist_head *h) |
static void | hlist_add_before (struct hlist_node *n, struct hlist_node *next) |
static void | hlist_add_after (struct hlist_node *n, struct hlist_node *next) |
#define hlist_entry | ( | ptr, | |||
type, | |||||
member | ) | container_of(ptr,type,member) |
#define hlist_for_each | ( | pos, | |||
head | ) |
#define hlist_for_each_entry | ( | tpos, | |||
pos, | |||||
head, | |||||
member | ) |
Value:
for (pos = (head)->first; \ pos && ({ prefetch(pos->next); 1;}) && \ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ pos = pos->next)
#define hlist_for_each_entry_continue | ( | tpos, | |||
pos, | |||||
member | ) |
Value:
for (pos = (pos)->next; \ pos && ({ prefetch(pos->next); 1;}) && \ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ pos = pos->next)
#define hlist_for_each_entry_from | ( | tpos, | |||
pos, | |||||
member | ) |
Value:
for (; pos && ({ prefetch(pos->next); 1;}) && \ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ pos = pos->next)
#define hlist_for_each_entry_safe | ( | tpos, | |||
pos, | |||||
n, | |||||
head, | |||||
member | ) |
Value:
for (pos = (head)->first; \ pos && ({ n = pos->next; 1; }) && \ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ pos = n)
#define hlist_for_each_safe | ( | pos, | |||
n, | |||||
head | ) |
#define HLIST_HEAD | ( | name | ) | struct hlist_head name = { .first = NULL } |
#define INIT_HLIST_NODE | ( | ptr | ) | ((ptr)->next = NULL, (ptr)->pprev = NULL) |
static void __hlist_del | ( | struct hlist_node * | n | ) | [inline, static] |
Definition at line 35 of file dlist.h.
References hlist_node::next, and hlist_node::pprev.
Referenced by hlist_del(), and hlist_del_init().
00036 { 00037 struct hlist_node *next = n->next; 00038 struct hlist_node **pprev = n->pprev; 00039 *pprev = next; 00040 if (next) 00041 next->pprev = pprev; 00042 }
static void hlist_add_after | ( | struct hlist_node * | n, | |
struct hlist_node * | next | |||
) | [inline, static] |
static void hlist_add_before | ( | struct hlist_node * | n, | |
struct hlist_node * | next | |||
) | [inline, static] |
static void hlist_add_head | ( | struct hlist_node * | n, | |
struct hlist_head * | h | |||
) | [inline, static] |
Definition at line 59 of file dlist.h.
References hlist_head::first, hlist_node::next, and hlist_node::pprev.
00060 { 00061 struct hlist_node *first = h->first; 00062 n->next = first; 00063 if (first) 00064 first->pprev = &n->next; 00065 h->first = n; 00066 n->pprev = &h->first; 00067 }
static void hlist_del | ( | struct hlist_node * | n | ) | [inline, static] |
Definition at line 44 of file dlist.h.
References __hlist_del(), hlist_node::next, and hlist_node::pprev.
00045 { 00046 __hlist_del(n); 00047 n->next = LIST_POISON1; 00048 n->pprev = LIST_POISON2; 00049 }
static void hlist_del_init | ( | struct hlist_node * | n | ) | [inline, static] |
Definition at line 51 of file dlist.h.
References __hlist_del(), INIT_HLIST_NODE, and hlist_node::pprev.
00052 { 00053 if (n->pprev) { 00054 __hlist_del(n); 00055 INIT_HLIST_NODE(n); 00056 } 00057 }
static int hlist_empty | ( | const struct hlist_head * | h | ) | [inline, static] |
Definition at line 30 of file dlist.h.
References hlist_head::first.
00031 { 00032 return !h->first; 00033 }
static int hlist_unhashed | ( | const struct hlist_node * | h | ) | [inline, static] |
Definition at line 25 of file dlist.h.
References hlist_node::pprev.
00026 { 00027 return !h->pprev; 00028 }