Lines Matching refs:connection
58 struct drbd_connection *connection; in count_objects() local
66 for_each_connection(connection, resource) in count_objects()
91 state_change->connections[n].connection = NULL; in alloc_state_change()
100 struct drbd_connection *connection; in remember_old_state() local
124 for_each_connection(connection, resource) { in remember_old_state()
125 kref_get(&connection->kref); in remember_old_state()
126 connection_state_change->connection = connection; in remember_old_state()
128 connection->cstate; in remember_old_state()
130 conn_highest_peer(connection); in remember_old_state()
143 for_each_connection(connection, resource) { in remember_old_state()
146 peer_device = conn_peer_device(connection, device->vnr); in remember_old_state()
196 struct drbd_connection *connection = in remember_new_state() local
197 connection_state_change->connection; in remember_new_state()
199 connection_state_change->cstate[NEW] = connection->cstate; in remember_new_state()
201 conn_highest_peer(connection); in remember_new_state()
282 struct drbd_connection *connection = in forget_state_change() local
283 state_change->connections[n].connection; in forget_state_change()
285 if (connection) in forget_state_change()
286 kref_put(&connection->kref, drbd_destroy_connection); in forget_state_change()
306 bool conn_all_vols_unconf(struct drbd_connection *connection) in conn_all_vols_unconf() argument
313 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_all_vols_unconf()
347 enum drbd_role conn_highest_role(struct drbd_connection *connection) in conn_highest_role() argument
354 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_role()
363 enum drbd_role conn_highest_peer(struct drbd_connection *connection) in conn_highest_peer() argument
370 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_peer()
379 enum drbd_disk_state conn_highest_disk(struct drbd_connection *connection) in conn_highest_disk() argument
386 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_disk()
395 enum drbd_disk_state conn_lowest_disk(struct drbd_connection *connection) in conn_lowest_disk() argument
402 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_lowest_disk()
411 enum drbd_disk_state conn_highest_pdsk(struct drbd_connection *connection) in conn_highest_pdsk() argument
418 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_pdsk()
427 enum drbd_conns conn_lowest_conn(struct drbd_connection *connection) in conn_lowest_conn() argument
434 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_lowest_conn()
443 static bool no_peer_wf_report_params(struct drbd_connection *connection) in no_peer_wf_report_params() argument
450 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in no_peer_wf_report_params()
460 static void wake_up_all_devices(struct drbd_connection *connection) in wake_up_all_devices() argument
466 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in wake_up_all_devices()
554 rv = is_valid_soft_transition(os, ns, first_peer_device(device)->connection); in _req_st_cond()
603 rv = is_valid_soft_transition(os, ns, first_peer_device(device)->connection); in drbd_req_state()
637 D_ASSERT(device, current != first_peer_device(device)->connection->worker.task); in drbd_req_state()
813 static void conn_pr_state_change(struct drbd_connection *connection, union drbd_state os, union drb… in conn_pr_state_change() argument
827 drbd_info(connection, "%s\n", pb); in conn_pr_state_change()
852 nc = rcu_dereference(first_peer_device(device)->connection->net_conf); in is_valid_state()
857 else if (conn_highest_peer(first_peer_device(device)->connection) == R_PRIMARY) in is_valid_state()
898 first_peer_device(device)->connection->agreed_pro_version < 88) in is_valid_state()
926 …valid_soft_transition(union drbd_state os, union drbd_state ns, struct drbd_connection *connection) in is_valid_soft_transition() argument
951 if (test_bit(STATE_SENT, &connection->flags) && in is_valid_soft_transition()
1241 if (first_peer_device(device)->connection->agreed_pro_version < 90) in set_ov_position()
1279 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; in _drbd_set_state() local
1306 rv = is_valid_soft_transition(os, ns, connection); in _drbd_set_state()
1308 rv = is_valid_soft_transition(os, ns, connection); in _drbd_set_state()
1325 conn_pr_state_change(connection, os, ns, in _drbd_set_state()
1357 start_new_tl_epoch(connection); in _drbd_set_state()
1364 no_peer_wf_report_params(connection)) { in _drbd_set_state()
1365 clear_bit(STATE_SENT, &connection->flags); in _drbd_set_state()
1366 wake_up_all_devices(connection); in _drbd_set_state()
1371 wake_up(&connection->ping_wait); in _drbd_set_state()
1459 drbd_thread_stop_nowait(&connection->receiver); in _drbd_set_state()
1463 drbd_thread_stop_nowait(&connection->receiver); in _drbd_set_state()
1468 drbd_thread_restart_nowait(&connection->receiver); in _drbd_set_state()
1473 connection->connect_cnt++; in _drbd_set_state()
1492 drbd_queue_work(&connection->sender_work, in _drbd_set_state()
1540 D_ASSERT(device, current == first_peer_device(device)->connection->worker.task); in drbd_bitmap_io_from_worker()
1575 struct drbd_connection *connection = connection_state_change->connection; in notify_connection_state_change() local
1581 notify_connection_state(skb, seq, connection, &connection_info, type); in notify_connection_state_change()
1720 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; in after_state_ch() local
1750 if (os.conn < C_CONNECTED && conn_lowest_conn(connection) >= C_CONNECTED) in after_state_ch()
1754 conn_lowest_disk(connection) == D_UP_TO_DATE) in after_state_ch()
1758 _tl_restart(connection, what); in after_state_ch()
1759 _conn_request_state(connection, in after_state_ch()
1769 if (resource->susp_fen && conn_lowest_conn(connection) >= C_CONNECTED) { in after_state_ch()
1775 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in after_state_ch()
1785 _tl_restart(connection, RESEND); in after_state_ch()
1786 _conn_request_state(connection, in after_state_ch()
1800 connection->agreed_pro_version >= 96 && get_ldev(device)) { in after_state_ch()
2047 struct drbd_connection *connection; member
2055 struct drbd_connection *connection = acscw->connection; in w_after_conn_state_ch() local
2067 drbd_thread_start(&connection->receiver); in w_after_conn_state_ch()
2073 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in w_after_conn_state_ch()
2076 notify_connection_state(NULL, 0, connection, NULL, NOTIFY_DESTROY); in w_after_conn_state_ch()
2079 mutex_lock(&connection->resource->conf_update); in w_after_conn_state_ch()
2080 old_conf = connection->net_conf; in w_after_conn_state_ch()
2081 connection->my_addr_len = 0; in w_after_conn_state_ch()
2082 connection->peer_addr_len = 0; in w_after_conn_state_ch()
2083 RCU_INIT_POINTER(connection->net_conf, NULL); in w_after_conn_state_ch()
2084 conn_free_crypto(connection); in w_after_conn_state_ch()
2085 mutex_unlock(&connection->resource->conf_update); in w_after_conn_state_ch()
2095 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in w_after_conn_state_ch()
2103 spin_lock_irq(&connection->resource->req_lock); in w_after_conn_state_ch()
2104 _tl_restart(connection, CONNECTION_LOST_WHILE_PENDING); in w_after_conn_state_ch()
2105 _conn_request_state(connection, in w_after_conn_state_ch()
2109 spin_unlock_irq(&connection->resource->req_lock); in w_after_conn_state_ch()
2112 kref_put(&connection->kref, drbd_destroy_connection); in w_after_conn_state_ch()
2114 conn_md_sync(connection); in w_after_conn_state_ch()
2119 static void conn_old_common_state(struct drbd_connection *connection, union drbd_state *pcs, enum c… in conn_old_common_state() argument
2127 .conn = connection->cstate, in conn_old_common_state()
2133 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_old_common_state()
2166 conn_is_valid_transition(struct drbd_connection *connection, union drbd_state mask, union drbd_stat… in conn_is_valid_transition() argument
2175 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_is_valid_transition()
2192 rv = is_valid_soft_transition(os, ns, connection); in conn_is_valid_transition()
2194 rv = is_valid_soft_transition(os, ns, connection); in conn_is_valid_transition()
2209 conn_set_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in conn_set_state() argument
2228 if (connection->cstate != C_WF_REPORT_PARAMS && val.conn == C_WF_REPORT_PARAMS) in conn_set_state()
2229 connection->last_reconnect_jif = jiffies; in conn_set_state()
2231 connection->cstate = val.conn; in conn_set_state()
2235 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_set_state()
2272 ns_min.susp = ns_max.susp = connection->resource->susp; in conn_set_state()
2273 ns_min.susp_nod = ns_max.susp_nod = connection->resource->susp_nod; in conn_set_state()
2274 ns_min.susp_fen = ns_max.susp_fen = connection->resource->susp_fen; in conn_set_state()
2281 _conn_rq_cond(struct drbd_connection *connection, union drbd_state mask, union drbd_state val) in _conn_rq_cond() argument
2285 if (test_and_clear_bit(CONN_WD_ST_CHG_OKAY, &connection->flags)) in _conn_rq_cond()
2288 if (test_and_clear_bit(CONN_WD_ST_CHG_FAIL, &connection->flags)) in _conn_rq_cond()
2291 err = conn_is_valid_transition(connection, mask, val, 0); in _conn_rq_cond()
2292 if (err == SS_SUCCESS && connection->cstate == C_WF_REPORT_PARAMS) in _conn_rq_cond()
2299 _conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in _conn_request_state() argument
2304 enum drbd_conns oc = connection->cstate; in _conn_request_state()
2315 rv = conn_is_valid_transition(connection, mask, val, flags); in _conn_request_state()
2325 spin_unlock_irq(&connection->resource->req_lock); in _conn_request_state()
2326 mutex_lock(&connection->cstate_mutex); in _conn_request_state()
2329 set_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
2330 if (conn_send_state_req(connection, mask, val)) { in _conn_request_state()
2332 clear_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
2339 set_bit(DISCONNECT_SENT, &connection->flags); in _conn_request_state()
2344 spin_lock_irq(&connection->resource->req_lock); in _conn_request_state()
2345 wait_event_lock_irq(connection->ping_wait, in _conn_request_state()
2346 (rv = _conn_rq_cond(connection, mask, val)), in _conn_request_state()
2347 connection->resource->req_lock); in _conn_request_state()
2348 clear_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
2353 state_change = remember_old_state(connection->resource, GFP_ATOMIC); in _conn_request_state()
2354 conn_old_common_state(connection, &os, &flags); in _conn_request_state()
2356 conn_set_state(connection, mask, val, &ns_min, &ns_max, flags); in _conn_request_state()
2357 conn_pr_state_change(connection, os, ns_max, flags); in _conn_request_state()
2367 kref_get(&connection->kref); in _conn_request_state()
2368 acscw->connection = connection; in _conn_request_state()
2370 drbd_queue_work(&connection->sender_work, &acscw->w); in _conn_request_state()
2372 drbd_err(connection, "Could not kmalloc an acscw\n"); in _conn_request_state()
2379 spin_unlock_irq(&connection->resource->req_lock); in _conn_request_state()
2381 mutex_unlock(&connection->cstate_mutex); in _conn_request_state()
2382 spin_lock_irq(&connection->resource->req_lock); in _conn_request_state()
2385 drbd_err(connection, "State change failed: %s\n", drbd_set_st_err_str(rv)); in _conn_request_state()
2386 drbd_err(connection, " mask = 0x%x val = 0x%x\n", mask.i, val.i); in _conn_request_state()
2387 drbd_err(connection, " old_conn:%s wanted_conn:%s\n", drbd_conn_str(oc), drbd_conn_str(val.conn)); in _conn_request_state()
2393 conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in conn_request_state() argument
2398 spin_lock_irq(&connection->resource->req_lock); in conn_request_state()
2399 rv = _conn_request_state(connection, mask, val, flags); in conn_request_state()
2400 spin_unlock_irq(&connection->resource->req_lock); in conn_request_state()