| .. | .. |
|---|
| 86 | 86 | hlist_bl_set_first(h, n); |
|---|
| 87 | 87 | } |
|---|
| 88 | 88 | |
|---|
| 89 | +static inline void hlist_bl_add_before(struct hlist_bl_node *n, |
|---|
| 90 | + struct hlist_bl_node *next) |
|---|
| 91 | +{ |
|---|
| 92 | + struct hlist_bl_node **pprev = next->pprev; |
|---|
| 93 | + |
|---|
| 94 | + n->pprev = pprev; |
|---|
| 95 | + n->next = next; |
|---|
| 96 | + next->pprev = &n->next; |
|---|
| 97 | + |
|---|
| 98 | + /* pprev may be `first`, so be careful not to lose the lock bit */ |
|---|
| 99 | + WRITE_ONCE(*pprev, |
|---|
| 100 | + (struct hlist_bl_node *) |
|---|
| 101 | + ((uintptr_t)n | ((uintptr_t)*pprev & LIST_BL_LOCKMASK))); |
|---|
| 102 | +} |
|---|
| 103 | + |
|---|
| 104 | +static inline void hlist_bl_add_behind(struct hlist_bl_node *n, |
|---|
| 105 | + struct hlist_bl_node *prev) |
|---|
| 106 | +{ |
|---|
| 107 | + n->next = prev->next; |
|---|
| 108 | + n->pprev = &prev->next; |
|---|
| 109 | + prev->next = n; |
|---|
| 110 | + |
|---|
| 111 | + if (n->next) |
|---|
| 112 | + n->next->pprev = &n->next; |
|---|
| 113 | +} |
|---|
| 114 | + |
|---|
| 89 | 115 | static inline void __hlist_bl_del(struct hlist_bl_node *n) |
|---|
| 90 | 116 | { |
|---|
| 91 | 117 | struct hlist_bl_node *next = n->next; |
|---|