Hash List

Double linked lists with a single pointer list head. More...

Data Structures

struct  cfs_hlist_node
struct  cfs_hlist_head

Defines

#define CFS_HLIST_HEAD_INIT   { NULL_P }
#define CFS_HLIST_HEAD(name)   cfs_hlist_head_t name = { NULL_P }
#define CFS_INIT_HLIST_HEAD(ptr)   ((ptr)->first = NULL_P)
#define CFS_INIT_HLIST_NODE(ptr)   ((ptr)->next = NULL_P, (ptr)->pprev = NULL_P)
#define cfs_hlist_entry(ptr, type, member)   container_of(ptr,type,member)
#define cfs_hlist_for_each(pos, head)
#define cfs_hlist_for_each_safe(pos, n, head)
#define cfs_hlist_for_each_entry(tpos, pos, head, member)
 Iterate over an hlist of given type.
#define cfs_hlist_for_each_entry_continue(tpos, pos, member)
 Iterate over an hlist continuing after existing point.
#define cfs_hlist_for_each_entry_from(tpos, pos, member)
 Iterate over an hlist continuing from an existing point.
#define cfs_hlist_for_each_entry_safe(tpos, pos, n, head, member)
 Iterate over an hlist of given type safe against removal of list entry.

Typedefs

typedef cfs_hlist_node cfs_hlist_node_t
typedef cfs_hlist_head cfs_hlist_head_t

Detailed Description

Double linked lists with a single pointer list head.

Mostly useful for hash tables where the two pointer list head is too wasteful. You lose the ability to access the tail in O(1).


Define Documentation

#define cfs_hlist_for_each ( pos,
head   ) 

Value:

for (pos = (head)->first; pos && (prefetch(pos->next), 1); \
             pos = pos->next)

#define cfs_hlist_for_each_entry ( tpos,
pos,
head,
member   ) 

Value:

for (pos = (head)->first;                                            \
             pos && ({ prefetch(pos->next); 1;}) &&                          \
                ({ tpos = cfs_hlist_entry(pos, typeof(*tpos), member); 1;}); \
             pos = pos->next)
Iterate over an hlist of given type.

Parameters:
tpos the type * to use as a loop counter.
pos the &struct hlist_node to use as a loop counter.
head the head for your list.
member the name of the hlist_node within the struct.

#define cfs_hlist_for_each_entry_continue ( tpos,
pos,
member   ) 

Value:

for (pos = (pos)->next;                                              \
             pos && ({ prefetch(pos->next); 1;}) &&                          \
                ({ tpos = cfs_hlist_entry(pos, typeof(*tpos), member); 1;}); \
             pos = pos->next)
Iterate over an hlist continuing after existing point.

Parameters:
tpos the type * to use as a loop counter.
pos the &struct hlist_node to use as a loop counter.
member the name of the hlist_node within the struct.

#define cfs_hlist_for_each_entry_from ( tpos,
pos,
member   ) 

Value:

for (; pos && ({ prefetch(pos->next); 1;}) &&                        \
                ({ tpos = cfs_hlist_entry(pos, typeof(*tpos), member); 1;}); \
             pos = pos->next)
Iterate over an hlist continuing from an existing point.

Parameters:
tpos the type * to use as a loop counter.
pos the &struct hlist_node to use as a loop counter.
member the name of the hlist_node within the struct.

#define cfs_hlist_for_each_entry_safe ( tpos,
pos,
n,
head,
member   ) 

Value:

for (pos = (head)->first;                                            \
             pos && ({ n = pos->next; 1; }) &&                               \
                ({ tpos = cfs_hlist_entry(pos, typeof(*tpos), member); 1;}); \
             pos = n)
Iterate over an hlist of given type safe against removal of list entry.

Parameters:
tpos the type * to use as a loop counter.
pos the &struct hlist_node to use as a loop counter.
n another &struct hlist_node to use as temporary storage
head the head for your list.
member the name of the hlist_node within the struct.

#define cfs_hlist_for_each_safe ( pos,
n,
head   ) 

Value:

for (pos = (head)->first; pos && (n = pos->next, 1); \
             pos = n)


Generated on Mon Apr 12 04:18:21 2010 for Lustre 1.10.0.40-0-g9a80ff7 by doxygen 1.4.7

Contact | About Sun | News | Employment | Privacy | Terms of Use | Trademarks | (C) 2008 Sun Microsystems, Inc.