• Home
  • Raw
  • Download

Lines Matching refs:ops

44 	struct nl_cache_ops *ops;  in __nl_cache_ops_lookup()  local
46 for (ops = cache_ops; ops; ops = ops->co_next) in __nl_cache_ops_lookup()
47 if (!strcmp(ops->co_name, name)) in __nl_cache_ops_lookup()
48 return ops; in __nl_cache_ops_lookup()
57 void nl_cache_ops_get(struct nl_cache_ops *ops) in nl_cache_ops_get() argument
59 ops->co_refcnt++; in nl_cache_ops_get()
66 void nl_cache_ops_put(struct nl_cache_ops *ops) in nl_cache_ops_put() argument
68 ops->co_refcnt--; in nl_cache_ops_put()
82 struct nl_cache_ops *ops; in nl_cache_ops_lookup() local
85 ops = __nl_cache_ops_lookup(name); in nl_cache_ops_lookup()
88 return ops; in nl_cache_ops_lookup()
102 struct nl_cache_ops *ops; in nl_cache_ops_lookup_safe() local
105 if ((ops = __nl_cache_ops_lookup(name))) in nl_cache_ops_lookup_safe()
106 nl_cache_ops_get(ops); in nl_cache_ops_lookup_safe()
109 return ops; in nl_cache_ops_lookup_safe()
115 struct nl_cache_ops *ops; in __cache_ops_associate() local
117 for (ops = cache_ops; ops; ops = ops->co_next) { in __cache_ops_associate()
118 if (ops->co_protocol != protocol) in __cache_ops_associate()
121 for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++) in __cache_ops_associate()
122 if (ops->co_msgtypes[i].mt_id == msgtype) in __cache_ops_associate()
123 return ops; in __cache_ops_associate()
143 struct nl_cache_ops *ops; in nl_cache_ops_associate() local
146 ops = __cache_ops_associate(protocol, msgtype); in nl_cache_ops_associate()
149 return ops; in nl_cache_ops_associate()
167 struct nl_cache_ops *ops; in nl_cache_ops_associate_safe() local
170 if ((ops = __cache_ops_associate(protocol, msgtype))) in nl_cache_ops_associate_safe()
171 nl_cache_ops_get(ops); in nl_cache_ops_associate_safe()
174 return ops; in nl_cache_ops_associate_safe()
190 struct nl_msgtype *nl_msgtype_lookup(struct nl_cache_ops *ops, int msgtype) in nl_msgtype_lookup() argument
194 for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++) in nl_msgtype_lookup()
195 if (ops->co_msgtypes[i].mt_id == msgtype) in nl_msgtype_lookup()
196 return &ops->co_msgtypes[i]; in nl_msgtype_lookup()
204 struct nl_cache_ops *ops; in cache_ops_lookup_for_obj() local
206 for (ops = cache_ops; ops; ops = ops->co_next) in cache_ops_lookup_for_obj()
207 if (ops->co_obj_ops == obj_ops) in cache_ops_lookup_for_obj()
208 return ops; in cache_ops_lookup_for_obj()
221 struct nl_cache_ops *ops; in nl_cache_ops_foreach() local
224 for (ops = cache_ops; ops; ops = ops->co_next) in nl_cache_ops_foreach()
225 cb(ops, arg); in nl_cache_ops_foreach()
237 void nl_cache_ops_set_flags(struct nl_cache_ops *ops, unsigned int flags) in nl_cache_ops_set_flags() argument
240 ops->co_flags |= flags; in nl_cache_ops_set_flags()
253 int nl_cache_mngt_register(struct nl_cache_ops *ops) in nl_cache_mngt_register() argument
255 if (!ops->co_name || !ops->co_obj_ops) in nl_cache_mngt_register()
259 BUG_ON (ops->co_obj_ops->oo_keygen && !ops->co_obj_ops->oo_compare); in nl_cache_mngt_register()
262 if (__nl_cache_ops_lookup(ops->co_name)) { in nl_cache_mngt_register()
267 ops->co_refcnt = 0; in nl_cache_mngt_register()
268 ops->co_next = cache_ops; in nl_cache_mngt_register()
269 cache_ops = ops; in nl_cache_mngt_register()
272 NL_DBG(1, "Registered cache operations %s\n", ops->co_name); in nl_cache_mngt_register()
288 int nl_cache_mngt_unregister(struct nl_cache_ops *ops) in nl_cache_mngt_unregister() argument
295 if (ops->co_refcnt > 0) { in nl_cache_mngt_unregister()
301 if (t == ops) in nl_cache_mngt_unregister()
309 NL_DBG(1, "Unregistered cache operations %s\n", ops->co_name); in nl_cache_mngt_unregister()
335 struct nl_cache_ops *ops; in nl_cache_mngt_provide() local
339 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops); in nl_cache_mngt_provide()
340 if (!ops) in nl_cache_mngt_provide()
349 if (!ops->co_major_cache) in nl_cache_mngt_provide()
350 nl_cache_ops_get(ops); in nl_cache_mngt_provide()
352 ops->co_major_cache = cache; in nl_cache_mngt_provide()
368 struct nl_cache_ops *ops; in nl_cache_mngt_unprovide() local
372 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops); in nl_cache_mngt_unprovide()
373 if (!ops) in nl_cache_mngt_unprovide()
375 else if (ops->co_major_cache == cache) { in nl_cache_mngt_unprovide()
376 nl_cache_free(ops->co_major_cache); in nl_cache_mngt_unprovide()
377 nl_cache_ops_put(ops); in nl_cache_mngt_unprovide()
378 ops->co_major_cache = NULL; in nl_cache_mngt_unprovide()
386 struct nl_cache_ops *ops; in __nl_cache_mngt_require() local
389 ops = nl_cache_ops_lookup_safe(name); in __nl_cache_mngt_require()
390 if (ops) { in __nl_cache_mngt_require()
391 cache = ops->co_major_cache; in __nl_cache_mngt_require()
392 nl_cache_ops_put(ops); in __nl_cache_mngt_require()