rcu_dereference(pos) != (head); \
pos = pos->next)
-/**
- * list_for_each_safe_rcu
- * @pos: the &struct list_head to use as a loop cursor.
- * @n: another &struct list_head to use as temporary storage
- * @head: the head for your list.
- *
- * Iterate over an rcu-protected list, safe against removal of list entry.
- *
- * This list-traversal primitive may safely run concurrently with
- * the _rcu list-mutation primitives such as list_add_rcu()
- * as long as the traversal is guarded by rcu_read_lock().
- */
-#define list_for_each_safe_rcu(pos, n, head) \
- for (pos = (head)->next; \
- n = rcu_dereference(pos)->next, pos != (head); \
- pos = n)
-
/**
* list_for_each_entry_rcu - iterate over rcu list of given type
* @pos: the type * to use as a loop cursor.
const struct sw_flow_key *key, uint16_t priority, int strict)
{
struct sw_table_linear *tl = (struct sw_table_linear *) swt;
- struct list_head *pos, *n;
+ struct sw_flow *flow;
unsigned int count = 0;
- list_for_each_safe_rcu (pos, n, &tl->flows) {
- struct sw_flow *flow = list_entry(pos, struct sw_flow, node);
+ list_for_each_entry_rcu (flow, &tl->flows, node) {
if (flow_del_matches(&flow->key, key, strict)
&& (strict && (flow->priority == priority)))
count += do_delete(swt, flow);
static int table_linear_timeout(struct datapath *dp, struct sw_table *swt)
{
struct sw_table_linear *tl = (struct sw_table_linear *) swt;
- struct list_head *pos, *n;
+ struct sw_flow *flow;
int count = 0;
- list_for_each_safe_rcu (pos, n, &tl->flows) {
- struct sw_flow *flow = list_entry(pos, struct sw_flow, node);
+ list_for_each_entry_rcu (flow, &tl->flows, node) {
if (flow_timeout(flow)) {
count += do_delete(swt, flow);
if (dp->flags & OFPC_SEND_FLOW_EXP)