aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2010-07-06 13:45:24 -0400
committerChris Metcalf <cmetcalf@tilera.com>2010-07-06 13:45:24 -0400
commita2262d8a231e92742651859a10c9a4430a5e899a (patch)
treeb5a823e3f6a3f60e1dd995f113caf0b350228d84 /include/linux/list.h
parentef06f55a5c936a395f3ee2e1237bbebdb4396c65 (diff)
parent815c4163b6c8ebf8152f42b0a5fd015cfdcedc78 (diff)
Merge branch 'master' into for-linus
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index bc43e8a0d7f6..d167b5d7c0ac 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -541,6 +541,21 @@ static inline void list_splice_tail_init(struct list_head *list,
541 &pos->member != (head); \ 541 &pos->member != (head); \
542 pos = n, n = list_entry(n->member.prev, typeof(*n), member)) 542 pos = n, n = list_entry(n->member.prev, typeof(*n), member))
543 543
544/**
545 * list_safe_reset_next - reset a stale list_for_each_entry_safe loop
546 * @pos: the loop cursor used in the list_for_each_entry_safe loop
547 * @n: temporary storage used in list_for_each_entry_safe
548 * @member: the name of the list_struct within the struct.
549 *
550 * list_safe_reset_next is not safe to use in general if the list may be
551 * modified concurrently (eg. the lock is dropped in the loop body). An
552 * exception to this is if the cursor element (pos) is pinned in the list,
553 * and list_safe_reset_next is called after re-taking the lock and before
554 * completing the current iteration of the loop body.
555 */
556#define list_safe_reset_next(pos, n, member) \
557 n = list_entry(pos->member.next, typeof(*pos), member)
558
544/* 559/*
545 * Double linked lists with a single pointer list head. 560 * Double linked lists with a single pointer list head.
546 * Mostly useful for hash tables where the two pointer list head is 561 * Mostly useful for hash tables where the two pointer list head is