Lines Matching refs:nsw
291 static int o2net_prep_nsw(struct o2net_node *nn, struct o2net_status_wait *nsw) in o2net_prep_nsw() argument
296 ret = idr_alloc(&nn->nn_status_idr, nsw, 0, 0, GFP_ATOMIC); in o2net_prep_nsw()
298 nsw->ns_id = ret; in o2net_prep_nsw()
299 list_add_tail(&nsw->ns_node_item, &nn->nn_status_list); in o2net_prep_nsw()
305 init_waitqueue_head(&nsw->ns_wq); in o2net_prep_nsw()
306 nsw->ns_sys_status = O2NET_ERR_NONE; in o2net_prep_nsw()
307 nsw->ns_status = 0; in o2net_prep_nsw()
312 struct o2net_status_wait *nsw, in o2net_complete_nsw_locked() argument
318 if (!list_empty(&nsw->ns_node_item)) { in o2net_complete_nsw_locked()
319 list_del_init(&nsw->ns_node_item); in o2net_complete_nsw_locked()
320 nsw->ns_sys_status = sys_status; in o2net_complete_nsw_locked()
321 nsw->ns_status = status; in o2net_complete_nsw_locked()
322 idr_remove(&nn->nn_status_idr, nsw->ns_id); in o2net_complete_nsw_locked()
323 wake_up(&nsw->ns_wq); in o2net_complete_nsw_locked()
328 struct o2net_status_wait *nsw, in o2net_complete_nsw() argument
333 if (nsw == NULL) { in o2net_complete_nsw()
337 nsw = idr_find(&nn->nn_status_idr, id); in o2net_complete_nsw()
338 if (nsw == NULL) in o2net_complete_nsw()
342 o2net_complete_nsw_locked(nn, nsw, sys_status, status); in o2net_complete_nsw()
351 struct o2net_status_wait *nsw, *tmp; in o2net_complete_nodes_nsw() local
356 list_for_each_entry_safe(nsw, tmp, &nn->nn_status_list, ns_node_item) { in o2net_complete_nodes_nsw()
357 o2net_complete_nsw_locked(nn, nsw, O2NET_ERR_DIED, 0); in o2net_complete_nodes_nsw()
366 struct o2net_status_wait *nsw) in o2net_nsw_completed() argument
370 completed = list_empty(&nsw->ns_node_item); in o2net_nsw_completed()
1025 struct o2net_status_wait nsw = { in o2net_send_message_vec() local
1026 .ns_node_item = LIST_HEAD_INIT(nsw.ns_node_item), in o2net_send_message_vec()
1087 ret = o2net_prep_nsw(nn, &nsw); in o2net_send_message_vec()
1091 msg->msg_num = cpu_to_be32(nsw.ns_id); in o2net_send_message_vec()
1092 o2net_set_nst_msg_id(&nst, nsw.ns_id); in o2net_send_message_vec()
1110 wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw)); in o2net_send_message_vec()
1117 ret = o2net_sys_err_to_errno(nsw.ns_sys_status); in o2net_send_message_vec()
1119 *status = nsw.ns_status; in o2net_send_message_vec()
1122 ret, nsw.ns_status); in o2net_send_message_vec()
1129 o2net_complete_nsw(nn, &nsw, 0, 0, 0); in o2net_send_message_vec()