Allocate a new cache containing a subset of a cache
Definition at line 234 of file cache.c. References nl_cache_add(), nl_cache_alloc(), and nl_object_match_filter(). { struct nl_cache *cache; struct nl_object_ops *ops; struct nl_object *obj; if (!filter) BUG(); cache = nl_cache_alloc(orig->c_ops); if (!cache) return NULL; ops = orig->c_ops->co_obj_ops; nl_list_for_each_entry(obj, &orig->c_items, ce_list) { if (!nl_object_match_filter(obj, filter)) continue; nl_cache_add(cache, obj); } return cache; }
|