Lines Matching refs:srv

91 static int server_match(const struct qrtr_server *srv,  in server_match()  argument
96 if (f->service != 0 && srv->service != f->service) in server_match()
101 return (srv->instance & ifilter) == f->instance; in server_match()
105 struct qrtr_server *srv) in service_announce_new() argument
111 trace_qrtr_ns_service_announce_new(srv->service, srv->instance, in service_announce_new()
112 srv->node, srv->port); in service_announce_new()
119 pkt.server.service = cpu_to_le32(srv->service); in service_announce_new()
120 pkt.server.instance = cpu_to_le32(srv->instance); in service_announce_new()
121 pkt.server.node = cpu_to_le32(srv->node); in service_announce_new()
122 pkt.server.port = cpu_to_le32(srv->port); in service_announce_new()
131 struct qrtr_server *srv) in service_announce_del() argument
138 trace_qrtr_ns_service_announce_del(srv->service, srv->instance, in service_announce_del()
139 srv->node, srv->port); in service_announce_del()
146 pkt.server.service = cpu_to_le32(srv->service); in service_announce_del()
147 pkt.server.instance = cpu_to_le32(srv->instance); in service_announce_del()
148 pkt.server.node = cpu_to_le32(srv->node); in service_announce_del()
149 pkt.server.port = cpu_to_le32(srv->port); in service_announce_del()
161 static void lookup_notify(struct sockaddr_qrtr *to, struct qrtr_server *srv, in lookup_notify() argument
175 if (srv) { in lookup_notify()
176 pkt.server.service = cpu_to_le32(srv->service); in lookup_notify()
177 pkt.server.instance = cpu_to_le32(srv->instance); in lookup_notify()
178 pkt.server.node = cpu_to_le32(srv->node); in lookup_notify()
179 pkt.server.port = cpu_to_le32(srv->port); in lookup_notify()
193 struct qrtr_server *srv; in announce_servers() local
205 srv = radix_tree_deref_slot(slot); in announce_servers()
206 if (!srv) in announce_servers()
208 if (radix_tree_deref_retry(srv)) { in announce_servers()
215 ret = service_announce_new(sq, srv); in announce_servers()
234 struct qrtr_server *srv; in server_add() local
241 srv = kzalloc(sizeof(*srv), GFP_KERNEL); in server_add()
242 if (!srv) in server_add()
245 srv->service = service; in server_add()
246 srv->instance = instance; in server_add()
247 srv->node = node_id; in server_add()
248 srv->port = port; in server_add()
261 radix_tree_insert(&node->servers, port, srv); in server_add()
263 trace_qrtr_ns_server_add(srv->service, srv->instance, in server_add()
264 srv->node, srv->port); in server_add()
266 return srv; in server_add()
269 kfree(srv); in server_add()
276 struct qrtr_server *srv; in server_del() local
279 srv = radix_tree_lookup(&node->servers, port); in server_del()
280 if (!srv) in server_del()
286 if (srv->node == qrtr_ns.local_node) in server_del()
287 service_announce_del(&qrtr_ns.bcast_sq, srv); in server_del()
292 if (lookup->service && lookup->service != srv->service) in server_del()
294 if (lookup->instance && lookup->instance != srv->instance) in server_del()
297 lookup_notify(&lookup->sq, srv, false); in server_del()
300 kfree(srv); in server_del()
345 struct qrtr_server *srv; in ctrl_cmd_bye() local
363 srv = radix_tree_deref_slot(slot); in ctrl_cmd_bye()
364 if (!srv) in ctrl_cmd_bye()
366 if (radix_tree_deref_retry(srv)) { in ctrl_cmd_bye()
372 server_del(node, srv->port); in ctrl_cmd_bye()
388 srv = radix_tree_deref_slot(slot); in ctrl_cmd_bye()
389 if (!srv) in ctrl_cmd_bye()
391 if (radix_tree_deref_retry(srv)) { in ctrl_cmd_bye()
399 sq.sq_node = srv->node; in ctrl_cmd_bye()
400 sq.sq_port = srv->port; in ctrl_cmd_bye()
426 struct qrtr_server *srv; in ctrl_cmd_del_client() local
475 srv = radix_tree_deref_slot(slot); in ctrl_cmd_del_client()
476 if (!srv) in ctrl_cmd_del_client()
478 if (radix_tree_deref_retry(srv)) { in ctrl_cmd_del_client()
486 sq.sq_node = srv->node; in ctrl_cmd_del_client()
487 sq.sq_port = srv->port; in ctrl_cmd_del_client()
510 struct qrtr_server *srv; in ctrl_cmd_new_server() local
520 srv = server_add(service, instance, node_id, port); in ctrl_cmd_new_server()
521 if (!srv) in ctrl_cmd_new_server()
524 if (srv->node == qrtr_ns.local_node) { in ctrl_cmd_new_server()
525 ret = service_announce_new(&qrtr_ns.bcast_sq, srv); in ctrl_cmd_new_server()
540 lookup_notify(&lookup->sq, srv, true); in ctrl_cmd_new_server()
610 struct qrtr_server *srv; in ctrl_cmd_new_lookup() local
612 srv = radix_tree_deref_slot(srv_slot); in ctrl_cmd_new_lookup()
613 if (!srv) in ctrl_cmd_new_lookup()
615 if (radix_tree_deref_retry(srv)) { in ctrl_cmd_new_lookup()
620 if (!server_match(srv, &filter)) in ctrl_cmd_new_lookup()
626 lookup_notify(from, srv, true); in ctrl_cmd_new_lookup()