• Home
  • Raw
  • Download

Lines Matching full:ops

37 	struct nl_cache_ops *ops;  in __nl_cache_ops_lookup()  local
39 for (ops = cache_ops; ops; ops = ops->co_next) in __nl_cache_ops_lookup()
40 if (!strcmp(ops->co_name, name)) in __nl_cache_ops_lookup()
41 return ops; in __nl_cache_ops_lookup()
48 * @arg ops Cache operations
50 void nl_cache_ops_get(struct nl_cache_ops *ops) in nl_cache_ops_get() argument
52 ops->co_refcnt++; in nl_cache_ops_get()
57 * @arg ops Cache operations
59 void nl_cache_ops_put(struct nl_cache_ops *ops) in nl_cache_ops_put() argument
61 ops->co_refcnt--; in nl_cache_ops_put()
75 struct nl_cache_ops *ops; in nl_cache_ops_lookup() local
78 ops = __nl_cache_ops_lookup(name); in nl_cache_ops_lookup()
81 return ops; in nl_cache_ops_lookup()
95 struct nl_cache_ops *ops; in nl_cache_ops_lookup_safe() local
98 if ((ops = __nl_cache_ops_lookup(name))) in nl_cache_ops_lookup_safe()
99 nl_cache_ops_get(ops); in nl_cache_ops_lookup_safe()
102 return ops; in nl_cache_ops_lookup_safe()
108 struct nl_cache_ops *ops; in __cache_ops_associate() local
110 for (ops = cache_ops; ops; ops = ops->co_next) { in __cache_ops_associate()
111 if (ops->co_protocol != protocol) in __cache_ops_associate()
114 for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++) in __cache_ops_associate()
115 if (ops->co_msgtypes[i].mt_id == msgtype) in __cache_ops_associate()
116 return ops; in __cache_ops_associate()
136 struct nl_cache_ops *ops; in nl_cache_ops_associate() local
139 ops = __cache_ops_associate(protocol, msgtype); in nl_cache_ops_associate()
142 return ops; in nl_cache_ops_associate()
160 struct nl_cache_ops *ops; in nl_cache_ops_associate_safe() local
163 if ((ops = __cache_ops_associate(protocol, msgtype))) in nl_cache_ops_associate_safe()
164 nl_cache_ops_get(ops); in nl_cache_ops_associate_safe()
167 return ops; in nl_cache_ops_associate_safe()
172 * @arg ops cache operations
183 struct nl_msgtype *nl_msgtype_lookup(struct nl_cache_ops *ops, int msgtype) in nl_msgtype_lookup() argument
187 for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++) in nl_msgtype_lookup()
188 if (ops->co_msgtypes[i].mt_id == msgtype) in nl_msgtype_lookup()
189 return &ops->co_msgtypes[i]; in nl_msgtype_lookup()
197 struct nl_cache_ops *ops; in cache_ops_lookup_for_obj() local
199 for (ops = cache_ops; ops; ops = ops->co_next) in cache_ops_lookup_for_obj()
200 if (ops->co_obj_ops == obj_ops) in cache_ops_lookup_for_obj()
201 return ops; in cache_ops_lookup_for_obj()
214 struct nl_cache_ops *ops; in nl_cache_ops_foreach() local
217 for (ops = cache_ops; ops; ops = ops->co_next) in nl_cache_ops_foreach()
218 cb(ops, arg); in nl_cache_ops_foreach()
224 * @arg ops Cache ops
230 void nl_cache_ops_set_flags(struct nl_cache_ops *ops, unsigned int flags) in nl_cache_ops_set_flags() argument
233 ops->co_flags |= flags; in nl_cache_ops_set_flags()
239 * @arg ops cache operations
246 int nl_cache_mngt_register(struct nl_cache_ops *ops) in nl_cache_mngt_register() argument
248 if (!ops->co_name || !ops->co_obj_ops) in nl_cache_mngt_register()
252 BUG_ON (ops->co_obj_ops->oo_keygen && !ops->co_obj_ops->oo_compare); in nl_cache_mngt_register()
255 if (__nl_cache_ops_lookup(ops->co_name)) { in nl_cache_mngt_register()
260 ops->co_refcnt = 0; in nl_cache_mngt_register()
261 ops->co_next = cache_ops; in nl_cache_mngt_register()
262 cache_ops = ops; in nl_cache_mngt_register()
265 NL_DBG(1, "Registered cache operations %s\n", ops->co_name); in nl_cache_mngt_register()
272 * @arg ops cache operations
281 int nl_cache_mngt_unregister(struct nl_cache_ops *ops) in nl_cache_mngt_unregister() argument
288 if (ops->co_refcnt > 0) { in nl_cache_mngt_unregister()
294 if (t == ops) in nl_cache_mngt_unregister()
302 NL_DBG(1, "Unregistered cache operations %s\n", ops->co_name); in nl_cache_mngt_unregister()
328 struct nl_cache_ops *ops; in nl_cache_mngt_provide() local
332 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops); in nl_cache_mngt_provide()
333 if (!ops) in nl_cache_mngt_provide()
340 * ops don't go away while we use it to store the cache pointer. in nl_cache_mngt_provide()
342 if (!ops->co_major_cache) in nl_cache_mngt_provide()
343 nl_cache_ops_get(ops); in nl_cache_mngt_provide()
345 ops->co_major_cache = cache; in nl_cache_mngt_provide()
361 struct nl_cache_ops *ops; in nl_cache_mngt_unprovide() local
365 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops); in nl_cache_mngt_unprovide()
366 if (!ops) in nl_cache_mngt_unprovide()
368 else if (ops->co_major_cache == cache) { in nl_cache_mngt_unprovide()
369 nl_cache_free(ops->co_major_cache); in nl_cache_mngt_unprovide()
370 nl_cache_ops_put(ops); in nl_cache_mngt_unprovide()
371 ops->co_major_cache = NULL; in nl_cache_mngt_unprovide()
379 struct nl_cache_ops *ops; in __nl_cache_mngt_require() local
382 ops = nl_cache_ops_lookup_safe(name); in __nl_cache_mngt_require()
383 if (ops) { in __nl_cache_mngt_require()
384 cache = ops->co_major_cache; in __nl_cache_mngt_require()
385 nl_cache_ops_put(ops); in __nl_cache_mngt_require()