drbd: Converted wake_asender() and request_ping() from mdev to tconn
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
parent
808e37b803
commit
0625ac190d
@ -1858,16 +1858,16 @@ drbd_queue_work(struct drbd_work_queue *q, struct drbd_work *w)
|
||||
spin_unlock_irqrestore(&q->q_lock, flags);
|
||||
}
|
||||
|
||||
static inline void wake_asender(struct drbd_conf *mdev)
|
||||
static inline void wake_asender(struct drbd_tconn *tconn)
|
||||
{
|
||||
if (test_bit(SIGNAL_ASENDER, &mdev->tconn->flags))
|
||||
force_sig(DRBD_SIG, mdev->tconn->asender.task);
|
||||
if (test_bit(SIGNAL_ASENDER, &tconn->flags))
|
||||
force_sig(DRBD_SIG, tconn->asender.task);
|
||||
}
|
||||
|
||||
static inline void request_ping(struct drbd_conf *mdev)
|
||||
static inline void request_ping(struct drbd_tconn *tconn)
|
||||
{
|
||||
set_bit(SEND_PING, &mdev->tconn->flags);
|
||||
wake_asender(mdev);
|
||||
set_bit(SEND_PING, &tconn->flags);
|
||||
wake_asender(tconn);
|
||||
}
|
||||
|
||||
static inline int drbd_send_short_cmd(struct drbd_conf *mdev,
|
||||
|
@ -1348,7 +1348,7 @@ static int we_should_drop_the_connection(struct drbd_conf *mdev, struct socket *
|
||||
if (!drop_it) {
|
||||
dev_err(DEV, "[%s/%d] sock_sendmsg time expired, ko = %u\n",
|
||||
current->comm, current->pid, mdev->tconn->ko_count);
|
||||
request_ping(mdev);
|
||||
request_ping(mdev->tconn);
|
||||
}
|
||||
|
||||
return drop_it; /* && (mdev->state == R_PRIMARY) */;
|
||||
|
@ -318,7 +318,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)
|
||||
enum drbd_disk_state nps;
|
||||
|
||||
if (new_role == R_PRIMARY)
|
||||
request_ping(mdev); /* Detect a dead peer ASAP */
|
||||
request_ping(mdev->tconn); /* Detect a dead peer ASAP */
|
||||
|
||||
mutex_lock(&mdev->state_mutex);
|
||||
|
||||
|
@ -1864,7 +1864,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packet cmd,
|
||||
* but I don't like the receiver using the msock */
|
||||
|
||||
put_ldev(mdev);
|
||||
wake_asender(mdev);
|
||||
wake_asender(mdev->tconn);
|
||||
finish_wait(&mdev->misc_wait, &wait);
|
||||
return true;
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ static void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req) __rel
|
||||
if (do_al_complete_io)
|
||||
drbd_al_complete_io(mdev, e_sector);
|
||||
|
||||
wake_asender(mdev);
|
||||
wake_asender(mdev->tconn);
|
||||
put_ldev(mdev);
|
||||
}
|
||||
|
||||
@ -728,7 +728,7 @@ static int w_resync_finished(struct drbd_conf *mdev, struct drbd_work *w, int ca
|
||||
static void ping_peer(struct drbd_conf *mdev)
|
||||
{
|
||||
clear_bit(GOT_PING_ACK, &mdev->flags);
|
||||
request_ping(mdev);
|
||||
request_ping(mdev->tconn);
|
||||
wait_event(mdev->misc_wait,
|
||||
test_bit(GOT_PING_ACK, &mdev->flags) || mdev->state.conn < C_CONNECTED);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user