Lines Matching refs:ops
39 struct nl_cache_ops *ops; in nl_cache_ops_lookup() local
41 for (ops = cache_ops; ops; ops = ops->co_next) in nl_cache_ops_lookup()
42 if (!strcmp(ops->co_name, name)) in nl_cache_ops_lookup()
43 return ops; in nl_cache_ops_lookup()
62 struct nl_cache_ops *ops; in nl_cache_ops_associate() local
64 for (ops = cache_ops; ops; ops = ops->co_next) { in nl_cache_ops_associate()
65 if (ops->co_protocol != protocol) in nl_cache_ops_associate()
68 for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++) in nl_cache_ops_associate()
69 if (ops->co_msgtypes[i].mt_id == msgtype) in nl_cache_ops_associate()
70 return ops; in nl_cache_ops_associate()
86 struct nl_msgtype *nl_msgtype_lookup(struct nl_cache_ops *ops, int msgtype) in nl_msgtype_lookup() argument
90 for (i = 0; ops->co_msgtypes[i].mt_id >= 0; i++) in nl_msgtype_lookup()
91 if (ops->co_msgtypes[i].mt_id == msgtype) in nl_msgtype_lookup()
92 return &ops->co_msgtypes[i]; in nl_msgtype_lookup()
99 struct nl_cache_ops *ops; in cache_ops_lookup_for_obj() local
101 for (ops = cache_ops; ops; ops = ops->co_next) in cache_ops_lookup_for_obj()
102 if (ops->co_obj_ops == obj_ops) in cache_ops_lookup_for_obj()
103 return ops; in cache_ops_lookup_for_obj()
116 struct nl_cache_ops *ops; in nl_cache_ops_foreach() local
118 for (ops = cache_ops; ops; ops = ops->co_next) in nl_cache_ops_foreach()
119 cb(ops, arg); in nl_cache_ops_foreach()
131 int nl_cache_mngt_register(struct nl_cache_ops *ops) in nl_cache_mngt_register() argument
133 if (!ops->co_name || !ops->co_obj_ops) in nl_cache_mngt_register()
136 if (nl_cache_ops_lookup(ops->co_name)) in nl_cache_mngt_register()
139 ops->co_next = cache_ops; in nl_cache_mngt_register()
140 cache_ops = ops; in nl_cache_mngt_register()
142 NL_DBG(1, "Registered cache operations %s\n", ops->co_name); in nl_cache_mngt_register()
158 int nl_cache_mngt_unregister(struct nl_cache_ops *ops) in nl_cache_mngt_unregister() argument
163 if (t == ops) in nl_cache_mngt_unregister()
169 NL_DBG(1, "Unregistered cache operations %s\n", ops->co_name); in nl_cache_mngt_unregister()
192 struct nl_cache_ops *ops; in nl_cache_mngt_provide() local
194 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops); in nl_cache_mngt_provide()
195 if (!ops) in nl_cache_mngt_provide()
198 ops->co_major_cache = cache; in nl_cache_mngt_provide()
211 struct nl_cache_ops *ops; in nl_cache_mngt_unprovide() local
213 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops); in nl_cache_mngt_unprovide()
214 if (!ops) in nl_cache_mngt_unprovide()
216 else if (ops->co_major_cache == cache) in nl_cache_mngt_unprovide()
217 ops->co_major_cache = NULL; in nl_cache_mngt_unprovide()
232 struct nl_cache_ops *ops; in nl_cache_mngt_require() local
234 ops = nl_cache_ops_lookup(name); in nl_cache_mngt_require()
235 if (!ops || !ops->co_major_cache) { in nl_cache_mngt_require()
244 return ops->co_major_cache; in nl_cache_mngt_require()