Print debugging info while iterating a cache based on a filter
This commit is contained in:
parent
2c75886060
commit
33e94038c4
1 changed files with 9 additions and 2 deletions
11
lib/cache.c
11
lib/cache.c
|
@ -824,8 +824,15 @@ void nl_cache_foreach_filter(struct nl_cache *cache, struct nl_object *filter,
|
|||
ops = cache->c_ops->co_obj_ops;
|
||||
|
||||
nl_list_for_each_entry_safe(obj, tmp, &cache->c_items, ce_list) {
|
||||
if (filter && !nl_object_match_filter(obj, filter))
|
||||
continue;
|
||||
if (filter) {
|
||||
int diff = nl_object_match_filter(obj, filter);
|
||||
|
||||
NL_DBG(3, "%p<->%p object difference: %x\n",
|
||||
obj, filter, diff);
|
||||
|
||||
if (!diff)
|
||||
continue;
|
||||
}
|
||||
|
||||
cb(obj, arg);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue