Lines Matching refs:connection
65 bool conn_all_vols_unconf(struct drbd_connection *connection) in conn_all_vols_unconf() argument
72 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_all_vols_unconf()
105 enum drbd_role conn_highest_role(struct drbd_connection *connection) in conn_highest_role() argument
112 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_role()
121 enum drbd_role conn_highest_peer(struct drbd_connection *connection) in conn_highest_peer() argument
128 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_peer()
137 enum drbd_disk_state conn_highest_disk(struct drbd_connection *connection) in conn_highest_disk() argument
144 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_disk()
153 enum drbd_disk_state conn_lowest_disk(struct drbd_connection *connection) in conn_lowest_disk() argument
160 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_lowest_disk()
169 enum drbd_disk_state conn_highest_pdsk(struct drbd_connection *connection) in conn_highest_pdsk() argument
176 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_highest_pdsk()
185 enum drbd_conns conn_lowest_conn(struct drbd_connection *connection) in conn_lowest_conn() argument
192 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_lowest_conn()
201 static bool no_peer_wf_report_params(struct drbd_connection *connection) in no_peer_wf_report_params() argument
208 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in no_peer_wf_report_params()
218 static void wake_up_all_devices(struct drbd_connection *connection) in wake_up_all_devices() argument
224 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in wake_up_all_devices()
312 rv = is_valid_soft_transition(os, ns, first_peer_device(device)->connection); in _req_st_cond()
358 rv = is_valid_soft_transition(os, ns, first_peer_device(device)->connection); in drbd_req_state()
392 D_ASSERT(device, current != first_peer_device(device)->connection->worker.task); in drbd_req_state()
525 static void conn_pr_state_change(struct drbd_connection *connection, union drbd_state os, union drb… in conn_pr_state_change() argument
539 drbd_info(connection, "%s\n", pb); in conn_pr_state_change()
564 nc = rcu_dereference(first_peer_device(device)->connection->net_conf); in is_valid_state()
569 else if (conn_highest_peer(first_peer_device(device)->connection) == R_PRIMARY) in is_valid_state()
610 first_peer_device(device)->connection->agreed_pro_version < 88) in is_valid_state()
637 …valid_soft_transition(union drbd_state os, union drbd_state ns, struct drbd_connection *connection) in is_valid_soft_transition() argument
662 if (test_bit(STATE_SENT, &connection->flags) && in is_valid_soft_transition()
943 if (first_peer_device(device)->connection->agreed_pro_version < 90) in set_ov_position()
981 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; in __drbd_set_state() local
1007 rv = is_valid_soft_transition(os, ns, connection); in __drbd_set_state()
1009 rv = is_valid_soft_transition(os, ns, connection); in __drbd_set_state()
1026 conn_pr_state_change(connection, os, ns, in __drbd_set_state()
1053 start_new_tl_epoch(connection); in __drbd_set_state()
1060 no_peer_wf_report_params(connection)) { in __drbd_set_state()
1061 clear_bit(STATE_SENT, &connection->flags); in __drbd_set_state()
1062 wake_up_all_devices(connection); in __drbd_set_state()
1067 wake_up(&connection->ping_wait); in __drbd_set_state()
1155 drbd_thread_stop_nowait(&connection->receiver); in __drbd_set_state()
1159 drbd_thread_stop_nowait(&connection->receiver); in __drbd_set_state()
1164 drbd_thread_restart_nowait(&connection->receiver); in __drbd_set_state()
1169 connection->connect_cnt++; in __drbd_set_state()
1187 drbd_queue_work(&connection->sender_work, in __drbd_set_state()
1234 D_ASSERT(device, current == first_peer_device(device)->connection->worker.task); in drbd_bitmap_io_from_worker()
1260 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; in after_state_ch() local
1288 if (os.conn < C_CONNECTED && conn_lowest_conn(connection) >= C_CONNECTED) in after_state_ch()
1292 conn_lowest_disk(connection) > D_NEGOTIATING) in after_state_ch()
1296 _tl_restart(connection, what); in after_state_ch()
1297 _conn_request_state(connection, in after_state_ch()
1307 if (resource->susp_fen && conn_lowest_conn(connection) >= C_CONNECTED) { in after_state_ch()
1313 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in after_state_ch()
1316 _tl_restart(connection, RESEND); in after_state_ch()
1317 _conn_request_state(connection, in after_state_ch()
1331 connection->agreed_pro_version >= 96 && get_ldev(device)) { in after_state_ch()
1574 struct drbd_connection *connection; member
1581 struct drbd_connection *connection = acscw->connection; in w_after_conn_state_ch() local
1591 drbd_thread_start(&connection->receiver); in w_after_conn_state_ch()
1596 mutex_lock(&connection->resource->conf_update); in w_after_conn_state_ch()
1597 old_conf = connection->net_conf; in w_after_conn_state_ch()
1598 connection->my_addr_len = 0; in w_after_conn_state_ch()
1599 connection->peer_addr_len = 0; in w_after_conn_state_ch()
1600 RCU_INIT_POINTER(connection->net_conf, NULL); in w_after_conn_state_ch()
1601 conn_free_crypto(connection); in w_after_conn_state_ch()
1602 mutex_unlock(&connection->resource->conf_update); in w_after_conn_state_ch()
1612 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in w_after_conn_state_ch()
1620 spin_lock_irq(&connection->resource->req_lock); in w_after_conn_state_ch()
1621 _tl_restart(connection, CONNECTION_LOST_WHILE_PENDING); in w_after_conn_state_ch()
1622 _conn_request_state(connection, in w_after_conn_state_ch()
1626 spin_unlock_irq(&connection->resource->req_lock); in w_after_conn_state_ch()
1629 kref_put(&connection->kref, drbd_destroy_connection); in w_after_conn_state_ch()
1631 conn_md_sync(connection); in w_after_conn_state_ch()
1636 static void conn_old_common_state(struct drbd_connection *connection, union drbd_state *pcs, enum c… in conn_old_common_state() argument
1644 .conn = connection->cstate, in conn_old_common_state()
1650 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_old_common_state()
1683 conn_is_valid_transition(struct drbd_connection *connection, union drbd_state mask, union drbd_stat… in conn_is_valid_transition() argument
1692 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_is_valid_transition()
1709 rv = is_valid_soft_transition(os, ns, connection); in conn_is_valid_transition()
1711 rv = is_valid_soft_transition(os, ns, connection); in conn_is_valid_transition()
1726 conn_set_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in conn_set_state() argument
1745 if (connection->cstate != C_WF_REPORT_PARAMS && val.conn == C_WF_REPORT_PARAMS) in conn_set_state()
1746 connection->last_reconnect_jif = jiffies; in conn_set_state()
1748 connection->cstate = val.conn; in conn_set_state()
1752 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_set_state()
1791 ns_min.susp = ns_max.susp = connection->resource->susp; in conn_set_state()
1792 ns_min.susp_nod = ns_max.susp_nod = connection->resource->susp_nod; in conn_set_state()
1793 ns_min.susp_fen = ns_max.susp_fen = connection->resource->susp_fen; in conn_set_state()
1800 _conn_rq_cond(struct drbd_connection *connection, union drbd_state mask, union drbd_state val) in _conn_rq_cond() argument
1804 if (test_and_clear_bit(CONN_WD_ST_CHG_OKAY, &connection->flags)) in _conn_rq_cond()
1807 if (test_and_clear_bit(CONN_WD_ST_CHG_FAIL, &connection->flags)) in _conn_rq_cond()
1810 err = conn_is_valid_transition(connection, mask, val, 0); in _conn_rq_cond()
1811 if (err == SS_SUCCESS && connection->cstate == C_WF_REPORT_PARAMS) in _conn_rq_cond()
1818 _conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in _conn_request_state() argument
1823 enum drbd_conns oc = connection->cstate; in _conn_request_state()
1833 rv = conn_is_valid_transition(connection, mask, val, flags); in _conn_request_state()
1843 spin_unlock_irq(&connection->resource->req_lock); in _conn_request_state()
1844 mutex_lock(&connection->cstate_mutex); in _conn_request_state()
1847 set_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
1848 if (conn_send_state_req(connection, mask, val)) { in _conn_request_state()
1850 clear_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
1857 set_bit(DISCONNECT_SENT, &connection->flags); in _conn_request_state()
1862 spin_lock_irq(&connection->resource->req_lock); in _conn_request_state()
1863 wait_event_lock_irq(connection->ping_wait, in _conn_request_state()
1864 (rv = _conn_rq_cond(connection, mask, val)), in _conn_request_state()
1865 connection->resource->req_lock); in _conn_request_state()
1866 clear_bit(CONN_WD_ST_CHG_REQ, &connection->flags); in _conn_request_state()
1871 conn_old_common_state(connection, &os, &flags); in _conn_request_state()
1873 conn_set_state(connection, mask, val, &ns_min, &ns_max, flags); in _conn_request_state()
1874 conn_pr_state_change(connection, os, ns_max, flags); in _conn_request_state()
1883 kref_get(&connection->kref); in _conn_request_state()
1884 acscw->connection = connection; in _conn_request_state()
1885 drbd_queue_work(&connection->sender_work, &acscw->w); in _conn_request_state()
1887 drbd_err(connection, "Could not kmalloc an acscw\n"); in _conn_request_state()
1894 spin_unlock_irq(&connection->resource->req_lock); in _conn_request_state()
1896 mutex_unlock(&connection->cstate_mutex); in _conn_request_state()
1897 spin_lock_irq(&connection->resource->req_lock); in _conn_request_state()
1900 drbd_err(connection, "State change failed: %s\n", drbd_set_st_err_str(rv)); in _conn_request_state()
1901 drbd_err(connection, " mask = 0x%x val = 0x%x\n", mask.i, val.i); in _conn_request_state()
1902 drbd_err(connection, " old_conn:%s wanted_conn:%s\n", drbd_conn_str(oc), drbd_conn_str(val.conn)); in _conn_request_state()
1908 conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val, in conn_request_state() argument
1913 spin_lock_irq(&connection->resource->req_lock); in conn_request_state()
1914 rv = _conn_request_state(connection, mask, val, flags); in conn_request_state()
1915 spin_unlock_irq(&connection->resource->req_lock); in conn_request_state()