]> git.proxmox.com Git - mirror_spl.git/blame - include/linux/list_compat.h
Pull in timespec, list, and type compat changes to support
[mirror_spl.git] / include / linux / list_compat.h
CommitLineData
6a6cafbe 1#ifndef _SPL_LIST_COMPAT_H
2#define _SPL_LIST_COMPAT_H
3
4#include <linux/list.h>
5
6#ifndef list_for_each_entry_safe_reverse
7
8/**
9 * list_for_each_entry_safe_reverse
10 * @pos: the type * to use as a loop cursor.
11 * @n: another type * to use as temporary storage
12 * @head: the head for your list.
13 * @member: the name of the list_struct within the struct.
14 *
15 * Iterate backwards over list of given type, safe against removal
16 * of list entry.
17 */
18#define list_for_each_entry_safe_reverse(pos, n, head, member) \
19 for (pos = list_entry((head)->prev, typeof(*pos), member), \
20 n = list_entry(pos->member.prev, typeof(*pos), member); \
21 &pos->member != (head); \
22 pos = n, n = list_entry(n->member.prev, typeof(*n), member))
23
24#endif /* list_for_each_entry_safe_reverse */
25
26#endif /* SPL_LIST_COMPAT_H */
27