diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-05 15:46:18 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-05 15:46:18 -0500 |
| commit | 3fa04ecd72780da31ba8b329e148179bc24a9c7d (patch) | |
| tree | f5d462fd4aee086952d18f159f737c450ab46b3b /include/linux/rculist.h | |
| parent | 180b62a3d837613fcac3ce89576526423926c3c3 (diff) | |
| parent | 1cda707d52e51a6cafac0aef12d2bd7052d572e6 (diff) | |
Merge branch 'writeback-for-2.6.34' into nfs-for-2.6.34
Diffstat (limited to 'include/linux/rculist.h')
| -rw-r--r-- | include/linux/rculist.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 1bf0f708c4fc..2c9b46cff3d7 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -208,7 +208,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 208 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | 208 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). |
| 209 | */ | 209 | */ |
| 210 | #define list_entry_rcu(ptr, type, member) \ | 210 | #define list_entry_rcu(ptr, type, member) \ |
| 211 | container_of(rcu_dereference(ptr), type, member) | 211 | container_of(rcu_dereference_raw(ptr), type, member) |
| 212 | 212 | ||
| 213 | /** | 213 | /** |
| 214 | * list_first_entry_rcu - get the first element from a list | 214 | * list_first_entry_rcu - get the first element from a list |
| @@ -225,9 +225,9 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 225 | list_entry_rcu((ptr)->next, type, member) | 225 | list_entry_rcu((ptr)->next, type, member) |
| 226 | 226 | ||
| 227 | #define __list_for_each_rcu(pos, head) \ | 227 | #define __list_for_each_rcu(pos, head) \ |
| 228 | for (pos = rcu_dereference((head)->next); \ | 228 | for (pos = rcu_dereference_raw((head)->next); \ |
| 229 | pos != (head); \ | 229 | pos != (head); \ |
| 230 | pos = rcu_dereference(pos->next)) | 230 | pos = rcu_dereference_raw(pos->next)) |
| 231 | 231 | ||
| 232 | /** | 232 | /** |
| 233 | * list_for_each_entry_rcu - iterate over rcu list of given type | 233 | * list_for_each_entry_rcu - iterate over rcu list of given type |
| @@ -257,9 +257,9 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 257 | * as long as the traversal is guarded by rcu_read_lock(). | 257 | * as long as the traversal is guarded by rcu_read_lock(). |
| 258 | */ | 258 | */ |
| 259 | #define list_for_each_continue_rcu(pos, head) \ | 259 | #define list_for_each_continue_rcu(pos, head) \ |
| 260 | for ((pos) = rcu_dereference((pos)->next); \ | 260 | for ((pos) = rcu_dereference_raw((pos)->next); \ |
| 261 | prefetch((pos)->next), (pos) != (head); \ | 261 | prefetch((pos)->next), (pos) != (head); \ |
| 262 | (pos) = rcu_dereference((pos)->next)) | 262 | (pos) = rcu_dereference_raw((pos)->next)) |
| 263 | 263 | ||
| 264 | /** | 264 | /** |
| 265 | * list_for_each_entry_continue_rcu - continue iteration over list of given type | 265 | * list_for_each_entry_continue_rcu - continue iteration over list of given type |
| @@ -406,6 +406,11 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 406 | n->next->pprev = &n->next; | 406 | n->next->pprev = &n->next; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | #define __hlist_for_each_rcu(pos, head) \ | ||
| 410 | for (pos = rcu_dereference((head)->first); \ | ||
| 411 | pos && ({ prefetch(pos->next); 1; }); \ | ||
| 412 | pos = rcu_dereference(pos->next)) | ||
| 413 | |||
| 409 | /** | 414 | /** |
| 410 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 415 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
| 411 | * @tpos: the type * to use as a loop cursor. | 416 | * @tpos: the type * to use as a loop cursor. |
| @@ -418,10 +423,10 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 418 | * as long as the traversal is guarded by rcu_read_lock(). | 423 | * as long as the traversal is guarded by rcu_read_lock(). |
| 419 | */ | 424 | */ |
| 420 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | 425 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ |
| 421 | for (pos = rcu_dereference((head)->first); \ | 426 | for (pos = rcu_dereference_raw((head)->first); \ |
| 422 | pos && ({ prefetch(pos->next); 1; }) && \ | 427 | pos && ({ prefetch(pos->next); 1; }) && \ |
| 423 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 428 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
| 424 | pos = rcu_dereference(pos->next)) | 429 | pos = rcu_dereference_raw(pos->next)) |
| 425 | 430 | ||
| 426 | #endif /* __KERNEL__ */ | 431 | #endif /* __KERNEL__ */ |
| 427 | #endif | 432 | #endif |
