Lines Matching full:connection

46 	struct drbd_connection *connection;  in count_objects()  local
54 for_each_connection(connection, resource) in count_objects()
79 state_change->connections[n].connection = NULL; in alloc_state_change()
88 struct drbd_connection *connection; in remember_old_state() local
112 for_each_connection(connection, resource) { in remember_old_state()
113 kref_get(&connection->kref); in remember_old_state()
114 connection_state_change->connection = connection; in remember_old_state()
116 connection->cstate; in remember_old_state()
118 conn_highest_peer(connection); in remember_old_state()
131 for_each_connection(connection, resource) { in remember_old_state()
134 peer_device = conn_peer_device(connection, device->vnr); in remember_old_state()
184 struct drbd_connection *connection = in remember_new_state() local
185 connection_state_change->connection; in remember_new_state()
187 connection_state_change->cstate[NEW] = connection->cstate; in remember_new_state()
189 conn_highest_peer(connection); in remember_new_state()
270 struct drbd_connection *connection = in forget_state_change() local
271 state_change->connections[n].connection; in forget_state_change()
273 if (connection) in forget_state_change()
274 kref_put(&connection->kref, drbd_destroy_connection); in forget_state_change()
294 bool conn_all_vols_unconf(struct drbd_connection *connection) in conn_all_vols_unconf() argument
301 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_all_vols_unconf()
335 enum drbd_role conn_highest_role(struct drbd_connection *connection) in conn_highest_role() argument
342 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_role()
351 enum drbd_role conn_highest_peer(struct drbd_connection *connection) in conn_highest_peer() argument
358 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_peer()
367 enum drbd_disk_state conn_highest_disk(struct drbd_connection *connection) in conn_highest_disk() argument
374 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_disk()
383 enum drbd_disk_state conn_lowest_disk(struct drbd_connection *connection) in conn_lowest_disk() argument
390 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_lowest_disk()
399 enum drbd_disk_state conn_highest_pdsk(struct drbd_connection *connection) in conn_highest_pdsk() argument
406 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_pdsk()
415 enum drbd_conns conn_lowest_conn(struct drbd_connection *connection) in conn_lowest_conn() argument
422 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_lowest_conn()
431 static bool no_peer_wf_report_params(struct drbd_connection *connection) in no_peer_wf_report_params() argument
438 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in no_peer_wf_report_params()
448 static void wake_up_all_devices(struct drbd_connection *connection) in wake_up_all_devices() argument
454 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in wake_up_all_devices()
542 rv = is_valid_soft_transition(os, ns, first_peer_device(device)->connection); in _req_st_cond()
591 rv = is_valid_soft_transition(os, ns, first_peer_device(device)->connection); in drbd_req_state()
625 D_ASSERT(device, current != first_peer_device(device)->connection->worker.task); in drbd_req_state()
799 static void conn_pr_state_change(struct drbd_connection *connection, union drbd_state os, union drb… in conn_pr_state_change() argument
813 drbd_info(connection, "%s\n", pb); in conn_pr_state_change()
838 nc = rcu_dereference(first_peer_device(device)->connection->net_conf); in is_valid_state()
843 else if (conn_highest_peer(first_peer_device(device)->connection) == R_PRIMARY) in is_valid_state()
884 first_peer_device(device)->connection->agreed_pro_version < 88) in is_valid_state()
909 * @connection: DRBD connection.
912 …valid_soft_transition(union drbd_state os, union drbd_state ns, struct drbd_connection *connection) in is_valid_soft_transition() argument
935 /* While establishing a connection only allow cstate to change. in is_valid_soft_transition()
937 if (test_bit(STATE_SENT, &connection->flags) && in is_valid_soft_transition()
976 /* no change -> nothing to do, at least for the connection part */ in is_valid_conn_transition()
980 /* disconnect of an unconfigured connection does not make sense */ in is_valid_conn_transition()
988 /* When establishing a connection we need to go through WF_REPORT_PARAMS! in is_valid_conn_transition()
1033 [CONNECTION_LOST_NEGOTIATING] = "Connection lost while negotiating, no data!", in print_sanitize_warnings()
1049 * When we loose connection, we have to set the state of the peers disk (pdsk)
1069 /* Implications from connection to peer and peer_isp */ in sanitize_state()
1081 /* An implication of the disk states onto the connection state */ in sanitize_state()
1090 /* Connection breaks down before we finished "Negotiating" */ in sanitize_state()
1113 /* Implications of the connection state on the disk states */ in sanitize_state()
1227 if (first_peer_device(device)->connection->agreed_pro_version < 90) in set_ov_position()
1265 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; in _drbd_set_state() local
1292 rv = is_valid_soft_transition(os, ns, connection); in _drbd_set_state()
1294 rv = is_valid_soft_transition(os, ns, connection); in _drbd_set_state()
1311 conn_pr_state_change(connection, os, ns, in _drbd_set_state()
1343 start_new_tl_epoch(connection); in _drbd_set_state()
1348 /* Wake up role changes, that were delayed because of connection establishing */ in _drbd_set_state()
1350 no_peer_wf_report_params(connection)) { in _drbd_set_state()
1351 clear_bit(STATE_SENT, &connection->flags); in _drbd_set_state()
1352 wake_up_all_devices(connection); in _drbd_set_state()
1357 wake_up(&connection->ping_wait); in _drbd_set_state()
1445 drbd_thread_stop_nowait(&connection->receiver); in _drbd_set_state()
1449 drbd_thread_stop_nowait(&connection->receiver); in _drbd_set_state()
1454 drbd_thread_restart_nowait(&connection->receiver); in _drbd_set_state()
1456 /* Resume AL writing if we get a connection */ in _drbd_set_state()
1459 connection->connect_cnt++; in _drbd_set_state()
1478 drbd_queue_work(&connection->sender_work, in _drbd_set_state()
1526 D_ASSERT(device, current == first_peer_device(device)->connection->worker.task); in drbd_bitmap_io_from_worker()
1561 struct drbd_connection *connection = connection_state_change->connection; in notify_connection_state_change() local
1567 return notify_connection_state(skb, seq, connection, &connection_info, type); in notify_connection_state_change()
1707 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; in after_state_ch() local
1737 if (os.conn < C_CONNECTED && conn_lowest_conn(connection) >= C_CONNECTED) in after_state_ch()
1741 conn_lowest_disk(connection) == D_UP_TO_DATE) in after_state_ch()
1745 _tl_restart(connection, what); in after_state_ch()
1746 _conn_request_state(connection, in after_state_ch()
1756 if (resource->susp_fen && conn_lowest_conn(connection) >= C_CONNECTED) { in after_state_ch()
1757 /* case2: The connection was established again: */ in after_state_ch()
1762 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in after_state_ch()
1772 _tl_restart(connection, RESEND); in after_state_ch()
1773 _conn_request_state(connection, in after_state_ch()
1787 connection->agreed_pro_version >= 96 && get_ldev(device)) { in after_state_ch()
1805 /* No point in queuing send_bitmap if we don't have a connection in after_state_ch()
2004 * Connection loss is handled in drbd_disconnected() by the receiver. in after_state_ch()
2034 struct drbd_connection *connection; member
2042 struct drbd_connection *connection = acscw->connection; in w_after_conn_state_ch() local
2054 drbd_thread_start(&connection->receiver); in w_after_conn_state_ch()
2060 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in w_after_conn_state_ch()
2063 notify_connection_state(NULL, 0, connection, NULL, NOTIFY_DESTROY); in w_after_conn_state_ch()
2066 mutex_lock(&connection->resource->conf_update); in w_after_conn_state_ch()
2067 old_conf = connection->net_conf; in w_after_conn_state_ch()
2068 connection->my_addr_len = 0; in w_after_conn_state_ch()
2069 connection->peer_addr_len = 0; in w_after_conn_state_ch()
2070 RCU_INIT_POINTER(connection->net_conf, NULL); in w_after_conn_state_ch()
2071 conn_free_crypto(connection); in w_after_conn_state_ch()
2072 mutex_unlock(&connection->resource->conf_update); in w_after_conn_state_ch()
2081 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in w_after_conn_state_ch()
2089 spin_lock_irq(&connection->resource->req_lock); in w_after_conn_state_ch()
2090 _tl_restart(connection, CONNECTION_LOST_WHILE_PENDING); in w_after_conn_state_ch()
2091 _conn_request_state(connection, in w_after_conn_state_ch()
2095 spin_unlock_irq(&connection->resource->req_lock); in w_after_conn_state_ch()
2098 conn_md_sync(connection); in w_after_conn_state_ch()
2099 kref_put(&connection->kref, drbd_destroy_connection); in w_after_conn_state_ch()
2104 static void conn_old_common_state(struct drbd_connection *connection, union drbd_state *pcs, enum c… in conn_old_common_state() argument
2112 .conn = connection->cstate, in conn_old_common_state()
2118 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_old_common_state()
2151 conn_is_valid_transition(struct drbd_connection *connection, union drbd_state mask, union drbd_stat… in conn_is_valid_transition() argument
2160 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_is_valid_transition()
2177 rv = is_valid_soft_transition(os, ns, connection); in conn_is_valid_transition()
2179 rv = is_valid_soft_transition(os, ns, connection); in conn_is_valid_transition()
2194 conn_set_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in conn_set_state() argument
2213 if (connection->cstate != C_WF_REPORT_PARAMS && val.conn == C_WF_REPORT_PARAMS) in conn_set_state()
2214 connection->last_reconnect_jif = jiffies; in conn_set_state()
2216 connection->cstate = val.conn; in conn_set_state()
2220 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_set_state()
2257 ns_min.susp = ns_max.susp = connection->resource->susp; in conn_set_state()
2258 ns_min.susp_nod = ns_max.susp_nod = connection->resource->susp_nod; in conn_set_state()
2259 ns_min.susp_fen = ns_max.susp_fen = connection->resource->susp_fen; in conn_set_state()
2266 _conn_rq_cond(struct drbd_connection *connection, union drbd_state mask, union drbd_state val) in _conn_rq_cond() argument
2270 if (test_and_clear_bit(CONN_WD_ST_CHG_OKAY, &connection->flags)) in _conn_rq_cond()
2273 if (test_and_clear_bit(CONN_WD_ST_CHG_FAIL, &connection->flags)) in _conn_rq_cond()
2276 err = conn_is_valid_transition(connection, mask, val, 0); in _conn_rq_cond()
2277 if (err == SS_SUCCESS && connection->cstate == C_WF_REPORT_PARAMS) in _conn_rq_cond()
2284 _conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in _conn_request_state() argument
2289 enum drbd_conns oc = connection->cstate; in _conn_request_state()
2300 rv = conn_is_valid_transition(connection, mask, val, flags); in _conn_request_state()
2310 spin_unlock_irq(&connection->resource->req_lock); in _conn_request_state()
2311 mutex_lock(&connection->cstate_mutex); in _conn_request_state()
2314 set_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
2315 if (conn_send_state_req(connection, mask, val)) { in _conn_request_state()
2317 clear_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
2324 set_bit(DISCONNECT_SENT, &connection->flags); in _conn_request_state()
2329 spin_lock_irq(&connection->resource->req_lock); in _conn_request_state()
2330 wait_event_lock_irq(connection->ping_wait, in _conn_request_state()
2331 (rv = _conn_rq_cond(connection, mask, val)), in _conn_request_state()
2332 connection->resource->req_lock); in _conn_request_state()
2333 clear_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
2338 state_change = remember_old_state(connection->resource, GFP_ATOMIC); in _conn_request_state()
2339 conn_old_common_state(connection, &os, &flags); in _conn_request_state()
2341 conn_set_state(connection, mask, val, &ns_min, &ns_max, flags); in _conn_request_state()
2342 conn_pr_state_change(connection, os, ns_max, flags); in _conn_request_state()
2352 kref_get(&connection->kref); in _conn_request_state()
2353 acscw->connection = connection; in _conn_request_state()
2355 drbd_queue_work(&connection->sender_work, &acscw->w); in _conn_request_state()
2357 drbd_err(connection, "Could not kmalloc an acscw\n"); in _conn_request_state()
2364 spin_unlock_irq(&connection->resource->req_lock); in _conn_request_state()
2366 mutex_unlock(&connection->cstate_mutex); in _conn_request_state()
2367 spin_lock_irq(&connection->resource->req_lock); in _conn_request_state()
2370 drbd_err(connection, "State change failed: %s\n", drbd_set_st_err_str(rv)); in _conn_request_state()
2371 drbd_err(connection, " mask = 0x%x val = 0x%x\n", mask.i, val.i); in _conn_request_state()
2372 drbd_err(connection, " old_conn:%s wanted_conn:%s\n", drbd_conn_str(oc), drbd_conn_str(val.conn)); in _conn_request_state()
2378 conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in conn_request_state() argument
2383 spin_lock_irq(&connection->resource->req_lock); in conn_request_state()
2384 rv = _conn_request_state(connection, mask, val, flags); in conn_request_state()
2385 spin_unlock_irq(&connection->resource->req_lock); in conn_request_state()