diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-07-23 00:47:29 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-07-23 00:47:29 -0400 |
commit | bd072111e7319d90a7b8127f91c2806b9a6f279e (patch) | |
tree | 1686978814a2387ebfc16f9f5778a7f0caaf319b /include/linux/list_nulls.h | |
parent | 24d01c0681bfbc10a99304c48a89ad213d2d7a4b (diff) | |
parent | 4be3bd7849165e7efa6b0b35a23d6a3598d97465 (diff) |
Merge commit 'v2.6.31-rc4' into next
Diffstat (limited to 'include/linux/list_nulls.h')
-rw-r--r-- | include/linux/list_nulls.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index 93150ecf3ea4..5d10ae364b5e 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h | |||
@@ -56,6 +56,18 @@ static inline int hlist_nulls_empty(const struct hlist_nulls_head *h) | |||
56 | return is_a_nulls(h->first); | 56 | return is_a_nulls(h->first); |
57 | } | 57 | } |
58 | 58 | ||
59 | static inline void hlist_nulls_add_head(struct hlist_nulls_node *n, | ||
60 | struct hlist_nulls_head *h) | ||
61 | { | ||
62 | struct hlist_nulls_node *first = h->first; | ||
63 | |||
64 | n->next = first; | ||
65 | n->pprev = &h->first; | ||
66 | h->first = n; | ||
67 | if (!is_a_nulls(first)) | ||
68 | first->pprev = &n->next; | ||
69 | } | ||
70 | |||
59 | static inline void __hlist_nulls_del(struct hlist_nulls_node *n) | 71 | static inline void __hlist_nulls_del(struct hlist_nulls_node *n) |
60 | { | 72 | { |
61 | struct hlist_nulls_node *next = n->next; | 73 | struct hlist_nulls_node *next = n->next; |
@@ -65,6 +77,12 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n) | |||
65 | next->pprev = pprev; | 77 | next->pprev = pprev; |
66 | } | 78 | } |
67 | 79 | ||
80 | static inline void hlist_nulls_del(struct hlist_nulls_node *n) | ||
81 | { | ||
82 | __hlist_nulls_del(n); | ||
83 | n->pprev = LIST_POISON2; | ||
84 | } | ||
85 | |||
68 | /** | 86 | /** |
69 | * hlist_nulls_for_each_entry - iterate over list of given type | 87 | * hlist_nulls_for_each_entry - iterate over list of given type |
70 | * @tpos: the type * to use as a loop cursor. | 88 | * @tpos: the type * to use as a loop cursor. |