Commit 2aebfabb authored by Philipp Reisner's avatar Philipp Reisner

drbd: Renamed id_susp(union drbd_state s) to drbd_suspended(struct drbd_conf *)

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 78bae59b
...@@ -2217,16 +2217,16 @@ static inline int drbd_state_is_stable(struct drbd_conf *mdev) ...@@ -2217,16 +2217,16 @@ static inline int drbd_state_is_stable(struct drbd_conf *mdev)
return 1; return 1;
} }
static inline int is_susp(union drbd_state s) static inline int drbd_suspended(struct drbd_conf *mdev)
{ {
return s.susp || s.susp_nod || s.susp_fen; return mdev->state.susp || mdev->state.susp_nod || mdev->state.susp_fen;
} }
static inline bool may_inc_ap_bio(struct drbd_conf *mdev) static inline bool may_inc_ap_bio(struct drbd_conf *mdev)
{ {
int mxb = drbd_get_max_buffers(mdev); int mxb = drbd_get_max_buffers(mdev);
if (is_susp(mdev->state)) if (drbd_suspended(mdev))
return false; return false;
if (test_bit(SUSPEND_IO, &mdev->flags)) if (test_bit(SUSPEND_IO, &mdev->flags))
return false; return false;
......
...@@ -731,7 +731,7 @@ char *ppsize(char *buf, unsigned long long size) ...@@ -731,7 +731,7 @@ char *ppsize(char *buf, unsigned long long size)
void drbd_suspend_io(struct drbd_conf *mdev) void drbd_suspend_io(struct drbd_conf *mdev)
{ {
set_bit(SUSPEND_IO, &mdev->flags); set_bit(SUSPEND_IO, &mdev->flags);
if (is_susp(mdev->state)) if (drbd_suspended(mdev))
return; return;
wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_bio_cnt)); wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_bio_cnt));
} }
...@@ -1355,7 +1355,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) ...@@ -1355,7 +1355,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)
drbd_suspend_io(mdev); drbd_suspend_io(mdev);
/* also wait for the last barrier ack. */ /* also wait for the last barrier ack. */
wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt) || is_susp(mdev->state)); wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt) || drbd_suspended(mdev));
/* and for any other previously queued work */ /* and for any other previously queued work */
drbd_flush_workqueue(mdev); drbd_flush_workqueue(mdev);
......
...@@ -250,7 +250,7 @@ static int drbd_seq_show(struct seq_file *seq, void *v) ...@@ -250,7 +250,7 @@ static int drbd_seq_show(struct seq_file *seq, void *v)
drbd_disk_str(mdev->state.pdsk), drbd_disk_str(mdev->state.pdsk),
(mdev->tconn->net_conf == NULL ? ' ' : (mdev->tconn->net_conf == NULL ? ' ' :
(mdev->tconn->net_conf->wire_protocol - DRBD_PROT_A+'A')), (mdev->tconn->net_conf->wire_protocol - DRBD_PROT_A+'A')),
is_susp(mdev->state) ? 's' : 'r', drbd_suspended(mdev) ? 's' : 'r',
mdev->state.aftr_isp ? 'a' : '-', mdev->state.aftr_isp ? 'a' : '-',
mdev->state.peer_isp ? 'p' : '-', mdev->state.peer_isp ? 'p' : '-',
mdev->state.user_isp ? 'u' : '-', mdev->state.user_isp ? 'u' : '-',
......
...@@ -3568,7 +3568,7 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi) ...@@ -3568,7 +3568,7 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi)
if ((ns.conn == C_CONNECTED || ns.conn == C_WF_BITMAP_S) && ns.disk == D_NEGOTIATING) if ((ns.conn == C_CONNECTED || ns.conn == C_WF_BITMAP_S) && ns.disk == D_NEGOTIATING)
ns.disk = mdev->new_state_tmp.disk; ns.disk = mdev->new_state_tmp.disk;
cs_flags = CS_VERBOSE + (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED ? 0 : CS_HARD); cs_flags = CS_VERBOSE + (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED ? 0 : CS_HARD);
if (ns.pdsk == D_CONSISTENT && is_susp(ns) && ns.conn == C_CONNECTED && os.conn < C_CONNECTED && if (ns.pdsk == D_CONSISTENT && drbd_suspended(mdev) && ns.conn == C_CONNECTED && os.conn < C_CONNECTED &&
test_bit(NEW_CUR_UUID, &mdev->flags)) { test_bit(NEW_CUR_UUID, &mdev->flags)) {
/* Do not allow tl_restart(RESEND) for a rebooted peer. We can only allow this /* Do not allow tl_restart(RESEND) for a rebooted peer. We can only allow this
for temporal network outages! */ for temporal network outages! */
...@@ -4123,7 +4123,7 @@ static int drbd_disconnected(int vnr, void *p, void *data) ...@@ -4123,7 +4123,7 @@ static int drbd_disconnected(int vnr, void *p, void *data)
kfree(mdev->p_uuid); kfree(mdev->p_uuid);
mdev->p_uuid = NULL; mdev->p_uuid = NULL;
if (!is_susp(mdev->state)) if (!drbd_suspended(mdev))
tl_clear(mdev->tconn); tl_clear(mdev->tconn);
drbd_md_sync(mdev); drbd_md_sync(mdev);
......
...@@ -303,7 +303,7 @@ static void _req_may_be_done_not_susp(struct drbd_request *req, struct bio_and_e ...@@ -303,7 +303,7 @@ static void _req_may_be_done_not_susp(struct drbd_request *req, struct bio_and_e
{ {
struct drbd_conf *mdev = req->w.mdev; struct drbd_conf *mdev = req->w.mdev;
if (!is_susp(mdev->state)) if (!drbd_suspended(mdev))
_req_may_be_done(req, m); _req_may_be_done(req, m);
} }
...@@ -789,7 +789,7 @@ int __drbd_make_request(struct drbd_conf *mdev, struct bio *bio, unsigned long s ...@@ -789,7 +789,7 @@ int __drbd_make_request(struct drbd_conf *mdev, struct bio *bio, unsigned long s
send_oos = rw == WRITE && drbd_should_send_out_of_sync(mdev->state); send_oos = rw == WRITE && drbd_should_send_out_of_sync(mdev->state);
D_ASSERT(!(remote && send_oos)); D_ASSERT(!(remote && send_oos));
if (!(local || remote) && !is_susp(mdev->state)) { if (!(local || remote) && !drbd_suspended(mdev)) {
if (__ratelimit(&drbd_ratelimit_state)) if (__ratelimit(&drbd_ratelimit_state))
dev_err(DEV, "IO ERROR: neither local nor remote disk\n"); dev_err(DEV, "IO ERROR: neither local nor remote disk\n");
err = -EIO; err = -EIO;
...@@ -830,7 +830,7 @@ int __drbd_make_request(struct drbd_conf *mdev, struct bio *bio, unsigned long s ...@@ -830,7 +830,7 @@ int __drbd_make_request(struct drbd_conf *mdev, struct bio *bio, unsigned long s
} }
} }
if (is_susp(mdev->state)) { if (drbd_suspended(mdev)) {
/* If we got suspended, use the retry mechanism of /* If we got suspended, use the retry mechanism of
generic_make_request() to restart processing of this generic_make_request() to restart processing of this
bio. In the next call to drbd_make_request bio. In the next call to drbd_make_request
......
...@@ -47,6 +47,11 @@ static enum drbd_state_rv is_valid_transition(union drbd_state os, union drbd_st ...@@ -47,6 +47,11 @@ static enum drbd_state_rv is_valid_transition(union drbd_state os, union drbd_st
static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns, static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns,
const char **warn_sync_abort); const char **warn_sync_abort);
static inline bool is_susp(union drbd_state s)
{
return s.susp || s.susp_nod || s.susp_fen;
}
bool conn_all_vols_unconf(struct drbd_tconn *tconn) bool conn_all_vols_unconf(struct drbd_tconn *tconn)
{ {
struct drbd_conf *mdev; struct drbd_conf *mdev;
...@@ -1161,7 +1166,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, ...@@ -1161,7 +1166,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
if (get_ldev(mdev)) { if (get_ldev(mdev)) {
if ((ns.role == R_PRIMARY || ns.peer == R_PRIMARY) && if ((ns.role == R_PRIMARY || ns.peer == R_PRIMARY) &&
mdev->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { mdev->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) {
if (is_susp(mdev->state)) { if (drbd_suspended(mdev)) {
set_bit(NEW_CUR_UUID, &mdev->flags); set_bit(NEW_CUR_UUID, &mdev->flags);
} else { } else {
drbd_uuid_new_current(mdev); drbd_uuid_new_current(mdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment