Lines Matching full:ns

26 	union drbd_state ns;  member
281 union drbd_state ns, enum chg_state_flags flags,
285 static enum drbd_state_rv is_valid_transition(union drbd_state os, union drbd_state ns);
287 union drbd_state ns, enum sanitize_state_warnings *warn);
465 * @ns: new (wanted) state.
468 union drbd_state os, union drbd_state ns) in cl_wide_st_chg() argument
470 return (os.conn >= C_CONNECTED && ns.conn >= C_CONNECTED && in cl_wide_st_chg()
471 ((os.role != R_PRIMARY && ns.role == R_PRIMARY) || in cl_wide_st_chg()
472 (os.conn != C_STARTING_SYNC_T && ns.conn == C_STARTING_SYNC_T) || in cl_wide_st_chg()
473 (os.conn != C_STARTING_SYNC_S && ns.conn == C_STARTING_SYNC_S) || in cl_wide_st_chg()
474 (os.disk != D_FAILED && ns.disk == D_FAILED))) || in cl_wide_st_chg()
475 (os.conn >= C_CONNECTED && ns.conn == C_DISCONNECTING) || in cl_wide_st_chg()
476 (os.conn == C_CONNECTED && ns.conn == C_VERIFY_S) || in cl_wide_st_chg()
477 (os.conn == C_CONNECTED && ns.conn == C_WF_REPORT_PARAMS); in cl_wide_st_chg()
483 union drbd_state ns; in apply_mask_val() local
484 ns.i = (os.i & ~mask.i) | val.i; in apply_mask_val()
485 return ns; in apply_mask_val()
493 union drbd_state ns; in drbd_change_state() local
497 ns = apply_mask_val(drbd_read_state(device), mask, val); in drbd_change_state()
498 rv = _drbd_set_state(device, ns, f, NULL); in drbd_change_state()
520 union drbd_state os, ns; in _req_st_cond() local
532 ns = sanitize_state(device, os, apply_mask_val(os, mask, val), NULL); in _req_st_cond()
533 rv = is_valid_transition(os, ns); in _req_st_cond()
537 if (!cl_wide_st_chg(device, os, ns)) in _req_st_cond()
540 rv = is_valid_state(device, ns); in _req_st_cond()
542 rv = is_valid_soft_transition(os, ns, first_peer_device(device)->connection); in _req_st_cond()
568 union drbd_state os, ns; in drbd_req_state() local
581 ns = sanitize_state(device, os, apply_mask_val(os, mask, val), NULL); in drbd_req_state()
582 rv = is_valid_transition(os, ns); in drbd_req_state()
588 if (cl_wide_st_chg(device, os, ns)) { in drbd_req_state()
589 rv = is_valid_state(device, ns); in drbd_req_state()
591 rv = is_valid_soft_transition(os, ns, first_peer_device(device)->connection); in drbd_req_state()
596 print_st_err(device, os, ns, rv); in drbd_req_state()
603 print_st_err(device, os, ns, rv); in drbd_req_state()
612 print_st_err(device, os, ns, rv); in drbd_req_state()
616 ns = apply_mask_val(drbd_read_state(device), mask, val); in drbd_req_state()
617 rv = _drbd_set_state(device, ns, f, &done); in drbd_req_state()
619 rv = _drbd_set_state(device, ns, f, &done); in drbd_req_state()
675 return drbd_req_state(device, NS(disk, D_FAILED), in request_detach()
715 static void print_st(struct drbd_device *device, const char *name, union drbd_state ns) in print_st() argument
719 drbd_conn_str(ns.conn), in print_st()
720 drbd_role_str(ns.role), in print_st()
721 drbd_role_str(ns.peer), in print_st()
722 drbd_disk_str(ns.disk), in print_st()
723 drbd_disk_str(ns.pdsk), in print_st()
724 is_susp(ns) ? 's' : 'r', in print_st()
725 ns.aftr_isp ? 'a' : '-', in print_st()
726 ns.peer_isp ? 'p' : '-', in print_st()
727 ns.user_isp ? 'u' : '-', in print_st()
728 ns.susp_fen ? 'F' : '-', in print_st()
729 ns.susp_nod ? 'N' : '-' in print_st()
734 union drbd_state ns, enum drbd_state_rv err) in print_st_err() argument
740 print_st(device, "wanted", ns); in print_st_err()
743 static long print_state_change(char *pb, union drbd_state os, union drbd_state ns, in print_state_change() argument
750 if (ns.role != os.role && flags & CS_DC_ROLE) in print_state_change()
753 drbd_role_str(ns.role)); in print_state_change()
754 if (ns.peer != os.peer && flags & CS_DC_PEER) in print_state_change()
757 drbd_role_str(ns.peer)); in print_state_change()
758 if (ns.conn != os.conn && flags & CS_DC_CONN) in print_state_change()
761 drbd_conn_str(ns.conn)); in print_state_change()
762 if (ns.disk != os.disk && flags & CS_DC_DISK) in print_state_change()
765 drbd_disk_str(ns.disk)); in print_state_change()
766 if (ns.pdsk != os.pdsk && flags & CS_DC_PDSK) in print_state_change()
769 drbd_disk_str(ns.pdsk)); in print_state_change()
774 …tic void drbd_pr_state_change(struct drbd_device *device, union drbd_state os, union drbd_state ns, in drbd_pr_state_change() argument
780 pbp += print_state_change(pbp, os, ns, flags ^ CS_DC_MASK); in drbd_pr_state_change()
782 if (ns.aftr_isp != os.aftr_isp) in drbd_pr_state_change()
785 ns.aftr_isp); in drbd_pr_state_change()
786 if (ns.peer_isp != os.peer_isp) in drbd_pr_state_change()
789 ns.peer_isp); in drbd_pr_state_change()
790 if (ns.user_isp != os.user_isp) in drbd_pr_state_change()
793 ns.user_isp); in drbd_pr_state_change()
799 … conn_pr_state_change(struct drbd_connection *connection, union drbd_state os, union drbd_state ns, in conn_pr_state_change() argument
805 pbp += print_state_change(pbp, os, ns, flags); in conn_pr_state_change()
807 if (is_susp(ns) != is_susp(os) && flags & CS_DC_SUSP) in conn_pr_state_change()
810 is_susp(ns)); in conn_pr_state_change()
818 * is_valid_state() - Returns an SS_ error code if ns is not valid
820 * @ns: State to consider.
823 is_valid_state(struct drbd_device *device, union drbd_state ns) in is_valid_state() argument
840 if (!nc->two_primaries && ns.role == R_PRIMARY) { in is_valid_state()
841 if (ns.peer == R_PRIMARY) in is_valid_state()
850 else if (ns.role == R_SECONDARY && device->open_cnt) in is_valid_state()
853 else if (ns.role == R_PRIMARY && ns.conn < C_CONNECTED && ns.disk < D_UP_TO_DATE) in is_valid_state()
857 ns.role == R_PRIMARY && ns.conn < C_CONNECTED && ns.pdsk >= D_UNKNOWN) in is_valid_state()
860 else if (ns.role == R_PRIMARY && ns.disk <= D_INCONSISTENT && ns.pdsk <= D_INCONSISTENT) in is_valid_state()
863 else if (ns.conn > C_CONNECTED && ns.disk < D_INCONSISTENT) in is_valid_state()
866 else if (ns.conn > C_CONNECTED && ns.pdsk < D_INCONSISTENT) in is_valid_state()
869 else if (ns.conn > C_CONNECTED && ns.disk < D_UP_TO_DATE && ns.pdsk < D_UP_TO_DATE) in is_valid_state()
872 else if ((ns.conn == C_CONNECTED || in is_valid_state()
873 ns.conn == C_WF_BITMAP_S || in is_valid_state()
874 ns.conn == C_SYNC_SOURCE || in is_valid_state()
875 ns.conn == C_PAUSED_SYNC_S) && in is_valid_state()
876 ns.disk == D_OUTDATED) in is_valid_state()
879 else if (nc && (ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) && in is_valid_state()
883 else if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) && in is_valid_state()
887 else if (ns.role == R_PRIMARY && ns.disk < D_UP_TO_DATE && ns.pdsk < D_UP_TO_DATE) in is_valid_state()
890 else if ((ns.conn == C_STARTING_SYNC_S || ns.conn == C_STARTING_SYNC_T) && in is_valid_state()
891 ns.pdsk == D_UNKNOWN) in is_valid_state()
894 else if (ns.conn >= C_CONNECTED && ns.pdsk == D_UNKNOWN) in is_valid_state()
908 * @ns: new state.
912 is_valid_soft_transition(union drbd_state os, union drbd_state ns, struct drbd_connection *connecti… in is_valid_soft_transition() argument
916 if ((ns.conn == C_STARTING_SYNC_T || ns.conn == C_STARTING_SYNC_S) && in is_valid_soft_transition()
920 if (ns.conn == C_DISCONNECTING && os.conn == C_STANDALONE) in is_valid_soft_transition()
923 if (ns.disk > D_ATTACHING && os.disk == D_DISKLESS) in is_valid_soft_transition()
926 if (ns.conn == C_WF_CONNECTION && os.conn < C_UNCONNECTED) in is_valid_soft_transition()
929 if (ns.disk == D_OUTDATED && os.disk < D_OUTDATED && os.disk != D_ATTACHING) in is_valid_soft_transition()
932 if (ns.conn == C_DISCONNECTING && os.conn == C_UNCONNECTED) in is_valid_soft_transition()
938 !((ns.conn == C_WF_REPORT_PARAMS && os.conn == C_WF_CONNECTION) || in is_valid_soft_transition()
939 (ns.conn >= C_CONNECTED && os.conn == C_WF_REPORT_PARAMS))) in is_valid_soft_transition()
945 if (os.role != R_PRIMARY && ns.role == R_PRIMARY in is_valid_soft_transition()
946 && ns.pdsk == D_UP_TO_DATE in is_valid_soft_transition()
947 && ns.disk != D_UP_TO_DATE && ns.disk != D_DISKLESS in is_valid_soft_transition()
948 && (ns.conn <= C_WF_SYNC_UUID || ns.conn != os.conn)) in is_valid_soft_transition()
951 if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) && os.conn < C_CONNECTED) in is_valid_soft_transition()
954 if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) && in is_valid_soft_transition()
955 ns.conn != os.conn && os.conn > C_CONNECTED) in is_valid_soft_transition()
958 if ((ns.conn == C_STARTING_SYNC_S || ns.conn == C_STARTING_SYNC_T) && in is_valid_soft_transition()
962 if ((ns.conn == C_SYNC_TARGET || ns.conn == C_SYNC_SOURCE) in is_valid_soft_transition()
966 if (ns.conn == C_DISCONNECTING && ns.pdsk == D_OUTDATED && in is_valid_soft_transition()
1010 * @ns: new state.
1014 is_valid_transition(union drbd_state os, union drbd_state ns) in is_valid_transition() argument
1018 rv = is_valid_conn_transition(os.conn, ns.conn); in is_valid_transition()
1021 if (ns.disk == D_FAILED && os.disk == D_DISKLESS) in is_valid_transition()
1046 * @ns: new state.
1053 union drbd_state ns, enum sanitize_state_warnings *warn) in sanitize_state() argument
1070 if (ns.conn < C_CONNECTED) { in sanitize_state()
1071 ns.peer_isp = 0; in sanitize_state()
1072 ns.peer = R_UNKNOWN; in sanitize_state()
1073 if (ns.pdsk > D_UNKNOWN || ns.pdsk < D_INCONSISTENT) in sanitize_state()
1074 ns.pdsk = D_UNKNOWN; in sanitize_state()
1078 if (ns.conn == C_STANDALONE && ns.disk == D_DISKLESS && ns.role == R_SECONDARY) in sanitize_state()
1079 ns.aftr_isp = 0; in sanitize_state()
1083 if (ns.conn > C_CONNECTED && (ns.disk <= D_FAILED || ns.pdsk <= D_FAILED)) { in sanitize_state()
1085 *warn = ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T ? in sanitize_state()
1087 ns.conn = C_CONNECTED; in sanitize_state()
1091 if (ns.conn < C_CONNECTED && ns.disk == D_NEGOTIATING && in sanitize_state()
1094 ns.disk = device->new_state_tmp.disk; in sanitize_state()
1095 ns.pdsk = device->new_state_tmp.pdsk; in sanitize_state()
1099 ns.disk = D_DISKLESS; in sanitize_state()
1100 ns.pdsk = D_UNKNOWN; in sanitize_state()
1106 if (ns.conn >= C_CONNECTED && ns.conn < C_AHEAD) { in sanitize_state()
1107 if (ns.disk == D_CONSISTENT || ns.disk == D_OUTDATED) in sanitize_state()
1108 ns.disk = D_UP_TO_DATE; in sanitize_state()
1109 if (ns.pdsk == D_CONSISTENT || ns.pdsk == D_OUTDATED) in sanitize_state()
1110 ns.pdsk = D_UP_TO_DATE; in sanitize_state()
1118 switch ((enum drbd_conns)ns.conn) { in sanitize_state()
1176 if (ns.disk > disk_max) in sanitize_state()
1177 ns.disk = disk_max; in sanitize_state()
1179 if (ns.disk < disk_min) { in sanitize_state()
1182 ns.disk = disk_min; in sanitize_state()
1184 if (ns.pdsk > pdsk_max) in sanitize_state()
1185 ns.pdsk = pdsk_max; in sanitize_state()
1187 if (ns.pdsk < pdsk_min) { in sanitize_state()
1190 ns.pdsk = pdsk_min; in sanitize_state()
1194 (ns.role == R_PRIMARY && ns.conn < C_CONNECTED && ns.pdsk > D_OUTDATED) && in sanitize_state()
1196 ns.susp_fen = 1; /* Suspend IO while fence-peer handler runs (peer lost) */ in sanitize_state()
1199 (ns.role == R_PRIMARY && ns.disk < D_UP_TO_DATE && ns.pdsk < D_UP_TO_DATE) && in sanitize_state()
1201 ns.susp_nod = 1; /* Suspend IO while no data available (no accessible data available) */ in sanitize_state()
1203 if (ns.aftr_isp || ns.peer_isp || ns.user_isp) { in sanitize_state()
1204 if (ns.conn == C_SYNC_SOURCE) in sanitize_state()
1205 ns.conn = C_PAUSED_SYNC_S; in sanitize_state()
1206 if (ns.conn == C_SYNC_TARGET) in sanitize_state()
1207 ns.conn = C_PAUSED_SYNC_T; in sanitize_state()
1209 if (ns.conn == C_PAUSED_SYNC_S) in sanitize_state()
1210 ns.conn = C_SYNC_SOURCE; in sanitize_state()
1211 if (ns.conn == C_PAUSED_SYNC_T) in sanitize_state()
1212 ns.conn = C_SYNC_TARGET; in sanitize_state()
1215 return ns; in sanitize_state()
1256 * @ns: new state.
1263 _drbd_set_state(struct drbd_device *device, union drbd_state ns, in _drbd_set_state() argument
1276 ns = sanitize_state(device, os, ns, &ssw); in _drbd_set_state()
1277 if (ns.i == os.i) in _drbd_set_state()
1280 rv = is_valid_transition(os, ns); in _drbd_set_state()
1285 /* pre-state-change checks ; only look at ns */ in _drbd_set_state()
1288 rv = is_valid_state(device, ns); in _drbd_set_state()
1294 rv = is_valid_soft_transition(os, ns, connection); in _drbd_set_state()
1296 rv = is_valid_soft_transition(os, ns, connection); in _drbd_set_state()
1301 print_st_err(device, os, ns, rv); in _drbd_set_state()
1307 drbd_pr_state_change(device, os, ns, flags); in _drbd_set_state()
1313 conn_pr_state_change(connection, os, ns, in _drbd_set_state()
1320 if ((os.disk != D_FAILED && ns.disk == D_FAILED) || in _drbd_set_state()
1321 (os.disk != D_DISKLESS && ns.disk == D_DISKLESS)) in _drbd_set_state()
1324 if (!is_sync_state(os.conn) && is_sync_state(ns.conn)) in _drbd_set_state()
1334 device->state.i = ns.i; in _drbd_set_state()
1335 device->resource->susp = ns.susp; in _drbd_set_state()
1336 device->resource->susp_nod = ns.susp_nod; in _drbd_set_state()
1337 device->resource->susp_fen = ns.susp_fen; in _drbd_set_state()
1344 drbd_should_do_remote((union drbd_dev_state)ns.i)) in _drbd_set_state()
1347 if (os.disk == D_ATTACHING && ns.disk >= D_NEGOTIATING) in _drbd_set_state()
1351 if (os.conn == C_WF_REPORT_PARAMS && ns.conn != C_WF_REPORT_PARAMS && in _drbd_set_state()
1364 ns.conn <= C_CONNECTED) { in _drbd_set_state()
1373 (ns.conn == C_SYNC_TARGET || ns.conn == C_SYNC_SOURCE)) { in _drbd_set_state()
1377 if (ns.conn == C_SYNC_TARGET) in _drbd_set_state()
1382 (ns.conn == C_PAUSED_SYNC_T || ns.conn == C_PAUSED_SYNC_S)) { in _drbd_set_state()
1388 (ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T)) { in _drbd_set_state()
1392 set_ov_position(peer_device, ns.conn); in _drbd_set_state()
1405 if (ns.conn == C_VERIFY_S) { in _drbd_set_state()
1435 if (os.disk < D_CONSISTENT && ns.disk >= D_CONSISTENT) in _drbd_set_state()
1442 os.peer == R_SECONDARY && ns.peer == R_PRIMARY) in _drbd_set_state()
1446 if (os.conn != C_DISCONNECTING && ns.conn == C_DISCONNECTING) in _drbd_set_state()
1450 if (os.conn != C_STANDALONE && ns.conn == C_STANDALONE) in _drbd_set_state()
1455 ns.conn <= C_TEAR_DOWN && ns.conn >= C_TIMEOUT) in _drbd_set_state()
1459 if (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED) { in _drbd_set_state()
1468 ns.disk > D_NEGOTIATING) in _drbd_set_state()
1474 ascw->ns = ns; in _drbd_set_state()
1495 after_state_ch(device, ascw->os, ascw->ns, ascw->flags, ascw->state_change); in w_after_state_ch()
1508 _drbd_request_state(device, NS(conn, C_CONNECTED), CS_VERBOSE); in abw_start_sync()
1514 _drbd_request_state(device, NS(conn, C_WF_SYNC_UUID), CS_VERBOSE); in abw_start_sync()
1681 static bool lost_contact_to_peer_data(enum drbd_disk_state os, enum drbd_disk_state ns) in lost_contact_to_peer_data() argument
1684 && (ns < D_INCONSISTENT || ns == D_UNKNOWN || ns == D_OUTDATED)) in lost_contact_to_peer_data()
1694 && (ns == D_DISKLESS || ns == D_FAILED || ns == D_OUTDATED)) in lost_contact_to_peer_data()
1704 * @ns: new state.
1709 union drbd_state ns, enum chg_state_flags flags, in after_state_ch() argument
1721 sib.ns = ns; in after_state_ch()
1724 && (ns.disk == D_UP_TO_DATE && ns.pdsk == D_UP_TO_DATE)) { in after_state_ch()
1734 (ns.role == R_PRIMARY && ns.disk < D_UP_TO_DATE && ns.pdsk < D_UP_TO_DATE)) in after_state_ch()
1740 if (ns.susp_nod) { in after_state_ch()
1761 if (ns.susp_fen) { in after_state_ch()
1793 (ns.conn == C_SYNC_SOURCE || ns.conn == C_PAUSED_SYNC_S) && in after_state_ch()
1801 ns.pdsk > D_DISKLESS && ns.pdsk != D_UNKNOWN) { /* attach on the peer */ in after_state_ch()
1810 drbd_send_state(peer_device, ns); in after_state_ch()
1815 if (os.conn != C_WF_BITMAP_S && ns.conn == C_WF_BITMAP_S && in after_state_ch()
1822 if (lost_contact_to_peer_data(os.pdsk, ns.pdsk)) { in after_state_ch()
1824 if ((ns.role == R_PRIMARY || ns.peer == R_PRIMARY) && in after_state_ch()
1825 device->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { in after_state_ch()
1837 if (ns.pdsk < D_INCONSISTENT && get_ldev(device)) { in after_state_ch()
1838 if (os.peer != R_PRIMARY && ns.peer == R_PRIMARY && in after_state_ch()
1839 device->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { in after_state_ch()
1844 if (os.peer == R_PRIMARY && ns.peer == R_SECONDARY) in after_state_ch()
1856 if (os.role == R_PRIMARY && ns.role == R_SECONDARY && in after_state_ch()
1866 if (ns.conn >= C_CONNECTED && in after_state_ch()
1867 os.disk == D_ATTACHING && ns.disk == D_NEGOTIATING) { in after_state_ch()
1870 drbd_send_state(peer_device, ns); in after_state_ch()
1874 if (ns.conn >= C_CONNECTED && in after_state_ch()
1875 ((os.aftr_isp != ns.aftr_isp) || in after_state_ch()
1876 (os.user_isp != ns.user_isp))) in after_state_ch()
1877 drbd_send_state(peer_device, ns); in after_state_ch()
1881 (ns.aftr_isp || ns.peer_isp || ns.user_isp)) in after_state_ch()
1886 if (os.conn == C_WF_REPORT_PARAMS && ns.conn >= C_CONNECTED) in after_state_ch()
1887 drbd_send_state(peer_device, ns); in after_state_ch()
1889 if (os.conn != C_AHEAD && ns.conn == C_AHEAD) in after_state_ch()
1890 drbd_send_state(peer_device, ns); in after_state_ch()
1893 if ((os.conn != C_STARTING_SYNC_T && ns.conn == C_STARTING_SYNC_T) || in after_state_ch()
1894 (os.conn != C_STARTING_SYNC_S && ns.conn == C_STARTING_SYNC_S)) in after_state_ch()
1903 if (os.disk != D_FAILED && ns.disk == D_FAILED) { in after_state_ch()
1948 if (ns.conn >= C_CONNECTED) in after_state_ch()
1949 drbd_send_state(peer_device, ns); in after_state_ch()
1964 if (os.disk != D_DISKLESS && ns.disk == D_DISKLESS) { in after_state_ch()
1972 if (ns.conn >= C_CONNECTED) in after_state_ch()
1973 drbd_send_state(peer_device, ns); in after_state_ch()
1980 if (os.disk == D_UP_TO_DATE && ns.disk == D_INCONSISTENT && ns.conn >= C_CONNECTED) in after_state_ch()
1981 drbd_send_state(peer_device, ns); in after_state_ch()
1984 if (ns.disk > D_NEGOTIATING && ns.pdsk > D_NEGOTIATING && in after_state_ch()
1986 if (ns.conn == C_CONNECTED) in after_state_ch()
1991 if ((os.conn > C_CONNECTED && ns.conn <= C_CONNECTED) || in after_state_ch()
1992 (os.peer_isp && !ns.peer_isp) || in after_state_ch()
1993 (os.user_isp && !ns.user_isp)) in after_state_ch()
1998 if (os.disk < D_UP_TO_DATE && os.conn >= C_SYNC_SOURCE && ns.conn == C_CONNECTED) in after_state_ch()
1999 drbd_send_state(peer_device, ns); in after_state_ch()
2004 if (os.conn == C_VERIFY_S && ns.conn == C_CONNECTED in after_state_ch()
2006 drbd_send_state(peer_device, ns); in after_state_ch()
2020 (ns.conn == C_CONNECTED || ns.conn >= C_AHEAD) && get_ldev(device)) { in after_state_ch()
2027 if (ns.disk == D_DISKLESS && in after_state_ch()
2028 ns.conn == C_STANDALONE && in after_state_ch()
2029 ns.role == R_SECONDARY) { in after_state_ch()
2030 if (os.aftr_isp != ns.aftr_isp) in after_state_ch()
2164 union drbd_state ns, os; in conn_is_valid_transition() local
2172 ns = sanitize_state(device, os, apply_mask_val(os, mask, val), NULL); in conn_is_valid_transition()
2174 if (flags & CS_IGN_OUTD_FAIL && ns.disk == D_OUTDATED && os.disk < D_OUTDATED) in conn_is_valid_transition()
2175 ns.disk = os.disk; in conn_is_valid_transition()
2177 if (ns.i == os.i) in conn_is_valid_transition()
2180 rv = is_valid_transition(os, ns); in conn_is_valid_transition()
2183 rv = is_valid_state(device, ns); in conn_is_valid_transition()
2186 rv = is_valid_soft_transition(os, ns, connection); in conn_is_valid_transition()
2188 rv = is_valid_soft_transition(os, ns, connection); in conn_is_valid_transition()
2193 print_st_err(device, os, ns, rv); in conn_is_valid_transition()
2206 union drbd_state ns, os, ns_max = { }; in conn_set_state() local
2233 ns = apply_mask_val(os, mask, val); in conn_set_state()
2234 ns = sanitize_state(device, os, ns, NULL); in conn_set_state()
2236 if (flags & CS_IGN_OUTD_FAIL && ns.disk == D_OUTDATED && os.disk < D_OUTDATED) in conn_set_state()
2237 ns.disk = os.disk; in conn_set_state()
2239 rv = _drbd_set_state(device, ns, flags, NULL); in conn_set_state()
2241 ns.i = device->state.i; in conn_set_state()
2242 ns_max.role = max_role(ns.role, ns_max.role); in conn_set_state()
2243 ns_max.peer = max_role(ns.peer, ns_max.peer); in conn_set_state()
2244 ns_max.conn = max_t(enum drbd_conns, ns.conn, ns_max.conn); in conn_set_state()
2245 ns_max.disk = max_t(enum drbd_disk_state, ns.disk, ns_max.disk); in conn_set_state()
2246 ns_max.pdsk = max_t(enum drbd_disk_state, ns.pdsk, ns_max.pdsk); in conn_set_state()
2248 ns_min.role = min_role(ns.role, ns_min.role); in conn_set_state()
2249 ns_min.peer = min_role(ns.peer, ns_min.peer); in conn_set_state()
2250 ns_min.conn = min_t(enum drbd_conns, ns.conn, ns_min.conn); in conn_set_state()
2251 ns_min.disk = min_t(enum drbd_disk_state, ns.disk, ns_min.disk); in conn_set_state()
2252 ns_min.pdsk = min_t(enum drbd_disk_state, ns.pdsk, ns_min.pdsk); in conn_set_state()