Huh? Where is that? :-)
There is list_for_each_entry and list_for_each_entry_rcu, but not
list_for_each_entry_safe nor, for that matter, list_for_each_entry_safe_rcu.
list_for_each_entry was introduced not so long ago by Rusty, AFAIK, so that we
can simplify traversing lists that before, with just list_for_each & _safe and
_rcu variations required that we use a struct list_head as the loop iteration
variable and have as well another variable of the type contained in the list,
like this:
struct llc_sap *llc_sap_find(u8 sap_value)
{
struct llc_sap* sap = NULL;
struct list_head *entry;
list_for_each(entry, &llc_main_station.sap_list.list) {
sap = list_entry(entry, struct llc_sap, node);
if (sap->laddr.lsap == sap_value)
goto out;
}
sap = NULL;
out:
return sap;
}
Using the _entry variation this can (and will) be converted to
struct llc_sap *llc_sap_find(u8 sap_value)
{
struct llc_sap* sap;
list_for_each_entry(sap, &llc_main_station.sap_list.list, node)
if (sap->laddr.lsap == sap_value)
goto out;
sap = NULL;
out:
return sap;
}
But then we need (at least I need for IPX, maybe others) the _entry_safe (and
most likely, at least initially for completeness, the _entry_safe_rcu)
variations. This is what I'm submitting :)
- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/