diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 4 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_proc.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 4 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_req.c | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_state.c | 7 |
6 files changed, 17 insertions, 12 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 24aed86e7364..cde547bdddf1 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -2217,16 +2217,16 @@ static inline int drbd_state_is_stable(struct drbd_conf *mdev) | |||
2217 | return 1; | 2217 | return 1; |
2218 | } | 2218 | } |
2219 | 2219 | ||
2220 | static inline int is_susp(union drbd_state s) | 2220 | static inline int drbd_suspended(struct drbd_conf *mdev) |
2221 | { | 2221 | { |
2222 | return s.susp || s.susp_nod || s.susp_fen; | 2222 | return mdev->state.susp || mdev->state.susp_nod || mdev->state.susp_fen; |
2223 | } | 2223 | } |
2224 | 2224 | ||
2225 | static inline bool may_inc_ap_bio(struct drbd_conf *mdev) | 2225 | static inline bool may_inc_ap_bio(struct drbd_conf *mdev) |
2226 | { | 2226 | { |
2227 | int mxb = drbd_get_max_buffers(mdev); | 2227 | int mxb = drbd_get_max_buffers(mdev); |
2228 | 2228 | ||
2229 | if (is_susp(mdev->state)) | 2229 | if (drbd_suspended(mdev)) |
2230 | return false; | 2230 | return false; |
2231 | if (test_bit(SUSPEND_IO, &mdev->flags)) | 2231 | if (test_bit(SUSPEND_IO, &mdev->flags)) |
2232 | return false; | 2232 | return false; |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 75caac70aaae..45a84fa660a2 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -731,7 +731,7 @@ char *ppsize(char *buf, unsigned long long size) | |||
731 | void drbd_suspend_io(struct drbd_conf *mdev) | 731 | void drbd_suspend_io(struct drbd_conf *mdev) |
732 | { | 732 | { |
733 | set_bit(SUSPEND_IO, &mdev->flags); | 733 | set_bit(SUSPEND_IO, &mdev->flags); |
734 | if (is_susp(mdev->state)) | 734 | if (drbd_suspended(mdev)) |
735 | return; | 735 | return; |
736 | wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_bio_cnt)); | 736 | wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_bio_cnt)); |
737 | } | 737 | } |
@@ -1355,7 +1355,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) | |||
1355 | 1355 | ||
1356 | drbd_suspend_io(mdev); | 1356 | drbd_suspend_io(mdev); |
1357 | /* also wait for the last barrier ack. */ | 1357 | /* also wait for the last barrier ack. */ |
1358 | wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt) || is_susp(mdev->state)); | 1358 | wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt) || drbd_suspended(mdev)); |
1359 | /* and for any other previously queued work */ | 1359 | /* and for any other previously queued work */ |
1360 | drbd_flush_workqueue(mdev); | 1360 | drbd_flush_workqueue(mdev); |
1361 | 1361 | ||
diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c index 36c9a6cecdc6..a4dbdbc52c15 100644 --- a/drivers/block/drbd/drbd_proc.c +++ b/drivers/block/drbd/drbd_proc.c | |||
@@ -250,7 +250,7 @@ static int drbd_seq_show(struct seq_file *seq, void *v) | |||
250 | drbd_disk_str(mdev->state.pdsk), | 250 | drbd_disk_str(mdev->state.pdsk), |
251 | (mdev->tconn->net_conf == NULL ? ' ' : | 251 | (mdev->tconn->net_conf == NULL ? ' ' : |
252 | (mdev->tconn->net_conf->wire_protocol - DRBD_PROT_A+'A')), | 252 | (mdev->tconn->net_conf->wire_protocol - DRBD_PROT_A+'A')), |
253 | is_susp(mdev->state) ? 's' : 'r', | 253 | drbd_suspended(mdev) ? 's' : 'r', |
254 | mdev->state.aftr_isp ? 'a' : '-', | 254 | mdev->state.aftr_isp ? 'a' : '-', |
255 | mdev->state.peer_isp ? 'p' : '-', | 255 | mdev->state.peer_isp ? 'p' : '-', |
256 | mdev->state.user_isp ? 'u' : '-', | 256 | mdev->state.user_isp ? 'u' : '-', |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 28cb19c8e264..7bc7b098787a 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -3568,7 +3568,7 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3568 | if ((ns.conn == C_CONNECTED || ns.conn == C_WF_BITMAP_S) && ns.disk == D_NEGOTIATING) | 3568 | if ((ns.conn == C_CONNECTED || ns.conn == C_WF_BITMAP_S) && ns.disk == D_NEGOTIATING) |
3569 | ns.disk = mdev->new_state_tmp.disk; | 3569 | ns.disk = mdev->new_state_tmp.disk; |
3570 | cs_flags = CS_VERBOSE + (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED ? 0 : CS_HARD); | 3570 | cs_flags = CS_VERBOSE + (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED ? 0 : CS_HARD); |
3571 | if (ns.pdsk == D_CONSISTENT && is_susp(ns) && ns.conn == C_CONNECTED && os.conn < C_CONNECTED && | 3571 | if (ns.pdsk == D_CONSISTENT && drbd_suspended(mdev) && ns.conn == C_CONNECTED && os.conn < C_CONNECTED && |
3572 | test_bit(NEW_CUR_UUID, &mdev->flags)) { | 3572 | test_bit(NEW_CUR_UUID, &mdev->flags)) { |
3573 | /* Do not allow tl_restart(RESEND) for a rebooted peer. We can only allow this | 3573 | /* Do not allow tl_restart(RESEND) for a rebooted peer. We can only allow this |
3574 | for temporal network outages! */ | 3574 | for temporal network outages! */ |
@@ -4123,7 +4123,7 @@ static int drbd_disconnected(int vnr, void *p, void *data) | |||
4123 | kfree(mdev->p_uuid); | 4123 | kfree(mdev->p_uuid); |
4124 | mdev->p_uuid = NULL; | 4124 | mdev->p_uuid = NULL; |
4125 | 4125 | ||
4126 | if (!is_susp(mdev->state)) | 4126 | if (!drbd_suspended(mdev)) |
4127 | tl_clear(mdev->tconn); | 4127 | tl_clear(mdev->tconn); |
4128 | 4128 | ||
4129 | drbd_md_sync(mdev); | 4129 | drbd_md_sync(mdev); |
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 6e0e3bb33167..e296d7ed6b8f 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
@@ -303,7 +303,7 @@ static void _req_may_be_done_not_susp(struct drbd_request *req, struct bio_and_e | |||
303 | { | 303 | { |
304 | struct drbd_conf *mdev = req->w.mdev; | 304 | struct drbd_conf *mdev = req->w.mdev; |
305 | 305 | ||
306 | if (!is_susp(mdev->state)) | 306 | if (!drbd_suspended(mdev)) |
307 | _req_may_be_done(req, m); | 307 | _req_may_be_done(req, m); |
308 | } | 308 | } |
309 | 309 | ||
@@ -789,7 +789,7 @@ int __drbd_make_request(struct drbd_conf *mdev, struct bio *bio, unsigned long s | |||
789 | send_oos = rw == WRITE && drbd_should_send_out_of_sync(mdev->state); | 789 | send_oos = rw == WRITE && drbd_should_send_out_of_sync(mdev->state); |
790 | D_ASSERT(!(remote && send_oos)); | 790 | D_ASSERT(!(remote && send_oos)); |
791 | 791 | ||
792 | if (!(local || remote) && !is_susp(mdev->state)) { | 792 | if (!(local || remote) && !drbd_suspended(mdev)) { |
793 | if (__ratelimit(&drbd_ratelimit_state)) | 793 | if (__ratelimit(&drbd_ratelimit_state)) |
794 | dev_err(DEV, "IO ERROR: neither local nor remote disk\n"); | 794 | dev_err(DEV, "IO ERROR: neither local nor remote disk\n"); |
795 | err = -EIO; | 795 | err = -EIO; |
@@ -830,7 +830,7 @@ allocate_barrier: | |||
830 | } | 830 | } |
831 | } | 831 | } |
832 | 832 | ||
833 | if (is_susp(mdev->state)) { | 833 | if (drbd_suspended(mdev)) { |
834 | /* If we got suspended, use the retry mechanism of | 834 | /* If we got suspended, use the retry mechanism of |
835 | generic_make_request() to restart processing of this | 835 | generic_make_request() to restart processing of this |
836 | bio. In the next call to drbd_make_request | 836 | bio. In the next call to drbd_make_request |
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 411d05f885e1..ae4a76ce8c1d 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c | |||
@@ -47,6 +47,11 @@ static enum drbd_state_rv is_valid_transition(union drbd_state os, union drbd_st | |||
47 | static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns, | 47 | static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns, |
48 | const char **warn_sync_abort); | 48 | const char **warn_sync_abort); |
49 | 49 | ||
50 | static inline bool is_susp(union drbd_state s) | ||
51 | { | ||
52 | return s.susp || s.susp_nod || s.susp_fen; | ||
53 | } | ||
54 | |||
50 | bool conn_all_vols_unconf(struct drbd_tconn *tconn) | 55 | bool conn_all_vols_unconf(struct drbd_tconn *tconn) |
51 | { | 56 | { |
52 | struct drbd_conf *mdev; | 57 | struct drbd_conf *mdev; |
@@ -1161,7 +1166,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, | |||
1161 | if (get_ldev(mdev)) { | 1166 | if (get_ldev(mdev)) { |
1162 | if ((ns.role == R_PRIMARY || ns.peer == R_PRIMARY) && | 1167 | if ((ns.role == R_PRIMARY || ns.peer == R_PRIMARY) && |
1163 | mdev->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { | 1168 | mdev->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { |
1164 | if (is_susp(mdev->state)) { | 1169 | if (drbd_suspended(mdev)) { |
1165 | set_bit(NEW_CUR_UUID, &mdev->flags); | 1170 | set_bit(NEW_CUR_UUID, &mdev->flags); |
1166 | } else { | 1171 | } else { |
1167 | drbd_uuid_new_current(mdev); | 1172 | drbd_uuid_new_current(mdev); |