Home | History | Annotate | Download | only in lib

Lines Matching refs:ops

43 	struct nl_cache_ops *ops;
45 for (ops = cache_ops; ops; ops = ops->co_next)
46 if (!strcmp(ops->co_name, name))
47 return ops;
54 * @arg ops Cache operations
56 void nl_cache_ops_get(struct nl_cache_ops *ops)
58 ops->co_refcnt++;
63 * @arg ops Cache operations
65 void nl_cache_ops_put(struct nl_cache_ops *ops)
67 ops->co_refcnt--;
81 struct nl_cache_ops *ops;
84 ops = __nl_cache_ops_lookup(name);
87 return ops;
101 struct nl_cache_ops *ops;
104 if ((ops = __nl_cache_ops_lookup(name)))
105 nl_cache_ops_get(ops);
108 return ops;
114 struct nl_cache_ops *ops;
116 for (ops = cache_ops; ops; ops = ops->co_next) {
117 if (ops->co_protocol != protocol)
120 for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++)
121 if (ops->co_msgtypes[i].mt_id == msgtype)
122 return ops;
142 struct nl_cache_ops *ops;
145 ops = __cache_ops_associate(protocol, msgtype);
148 return ops;
166 struct nl_cache_ops *ops;
169 if ((ops = __cache_ops_associate(protocol, msgtype)))
170 nl_cache_ops_get(ops);
173 return ops;
178 * @arg ops cache operations
189 struct nl_msgtype *nl_msgtype_lookup(struct nl_cache_ops *ops, int msgtype)
193 for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++)
194 if (ops->co_msgtypes[i].mt_id == msgtype)
195 return &ops->co_msgtypes[i];
203 struct nl_cache_ops *ops;
205 for (ops = cache_ops; ops; ops = ops->co_next)
206 if (ops->co_obj_ops == obj_ops)
207 return ops;
220 struct nl_cache_ops *ops;
223 for (ops = cache_ops; ops; ops = ops->co_next)
224 cb(ops, arg);
230 * @arg ops Cache ops
236 void nl_cache_ops_set_flags(struct nl_cache_ops *ops, unsigned int flags)
239 ops->co_flags |= flags;
245 * @arg ops cache operations
252 int nl_cache_mngt_register(struct nl_cache_ops *ops)
254 if (!ops->co_name || !ops->co_obj_ops)
258 if (__nl_cache_ops_lookup(ops->co_name)) {
263 ops->co_refcnt = 0;
264 ops->co_next = cache_ops;
265 cache_ops = ops;
268 NL_DBG(1, "Registered cache operations %s\n", ops->co_name);
275 * @arg ops cache operations
284 int nl_cache_mngt_unregister(struct nl_cache_ops *ops)
291 if (ops->co_refcnt > 0) {
297 if (t == ops)
305 NL_DBG(1, "Unregistered cache operations %s\n", ops->co_name);
331 struct nl_cache_ops *ops;
335 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops);
336 if (!ops)
343 * ops don't go away while we use it to store the cache pointer.
345 if (!ops->co_major_cache)
346 nl_cache_ops_get(ops);
348 ops->co_major_cache = cache;
364 struct nl_cache_ops *ops;
368 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops);
369 if (!ops)
371 else if (ops->co_major_cache == cache) {
372 nl_cache_free(ops->co_major_cache);
373 nl_cache_ops_put(ops);
374 ops->co_major_cache = NULL;
382 struct nl_cache_ops *ops;
385 ops = nl_cache_ops_lookup_safe(name);
386 if (ops) {
387 cache = ops->co_major_cache;
388 nl_cache_ops_put(ops);