Lines Matching refs:nsw

290 static int o2net_prep_nsw(struct o2net_node *nn, struct o2net_status_wait *nsw)  in o2net_prep_nsw()  argument
295 ret = idr_alloc(&nn->nn_status_idr, nsw, 0, 0, GFP_ATOMIC); in o2net_prep_nsw()
297 nsw->ns_id = ret; in o2net_prep_nsw()
298 list_add_tail(&nsw->ns_node_item, &nn->nn_status_list); in o2net_prep_nsw()
304 init_waitqueue_head(&nsw->ns_wq); in o2net_prep_nsw()
305 nsw->ns_sys_status = O2NET_ERR_NONE; in o2net_prep_nsw()
306 nsw->ns_status = 0; in o2net_prep_nsw()
311 struct o2net_status_wait *nsw, in o2net_complete_nsw_locked() argument
317 if (!list_empty(&nsw->ns_node_item)) { in o2net_complete_nsw_locked()
318 list_del_init(&nsw->ns_node_item); in o2net_complete_nsw_locked()
319 nsw->ns_sys_status = sys_status; in o2net_complete_nsw_locked()
320 nsw->ns_status = status; in o2net_complete_nsw_locked()
321 idr_remove(&nn->nn_status_idr, nsw->ns_id); in o2net_complete_nsw_locked()
322 wake_up(&nsw->ns_wq); in o2net_complete_nsw_locked()
327 struct o2net_status_wait *nsw, in o2net_complete_nsw() argument
332 if (nsw == NULL) { in o2net_complete_nsw()
336 nsw = idr_find(&nn->nn_status_idr, id); in o2net_complete_nsw()
337 if (nsw == NULL) in o2net_complete_nsw()
341 o2net_complete_nsw_locked(nn, nsw, sys_status, status); in o2net_complete_nsw()
350 struct o2net_status_wait *nsw, *tmp; in o2net_complete_nodes_nsw() local
355 list_for_each_entry_safe(nsw, tmp, &nn->nn_status_list, ns_node_item) { in o2net_complete_nodes_nsw()
356 o2net_complete_nsw_locked(nn, nsw, O2NET_ERR_DIED, 0); in o2net_complete_nodes_nsw()
365 struct o2net_status_wait *nsw) in o2net_nsw_completed() argument
369 completed = list_empty(&nsw->ns_node_item); in o2net_nsw_completed()
1021 struct o2net_status_wait nsw = { in o2net_send_message_vec() local
1022 .ns_node_item = LIST_HEAD_INIT(nsw.ns_node_item), in o2net_send_message_vec()
1083 ret = o2net_prep_nsw(nn, &nsw); in o2net_send_message_vec()
1087 msg->msg_num = cpu_to_be32(nsw.ns_id); in o2net_send_message_vec()
1088 o2net_set_nst_msg_id(&nst, nsw.ns_id); in o2net_send_message_vec()
1106 wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw)); in o2net_send_message_vec()
1113 ret = o2net_sys_err_to_errno(nsw.ns_sys_status); in o2net_send_message_vec()
1115 *status = nsw.ns_status; in o2net_send_message_vec()
1118 ret, nsw.ns_status); in o2net_send_message_vec()
1125 o2net_complete_nsw(nn, &nsw, 0, 0, 0); in o2net_send_message_vec()