Commit 808e37b8 authored by Philipp Reisner's avatar Philipp Reisner

drbd: Moved SIGNAL_ASENDER to the per connection (tconn) flags

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent e43ef195
...@@ -757,8 +757,6 @@ enum { ...@@ -757,8 +757,6 @@ enum {
/* flag bits per mdev */ /* flag bits per mdev */
enum { enum {
CREATE_BARRIER, /* next P_DATA is preceded by a P_BARRIER */ CREATE_BARRIER, /* next P_DATA is preceded by a P_BARRIER */
SIGNAL_ASENDER, /* whether asender wants to be interrupted */
UNPLUG_QUEUED, /* only relevant with kernel 2.4 */ UNPLUG_QUEUED, /* only relevant with kernel 2.4 */
UNPLUG_REMOTE, /* sending a "UnplugRemote" could help */ UNPLUG_REMOTE, /* sending a "UnplugRemote" could help */
MD_DIRTY, /* current uuids and flags not yet on disk */ MD_DIRTY, /* current uuids and flags not yet on disk */
...@@ -911,6 +909,7 @@ enum { ...@@ -911,6 +909,7 @@ enum {
NET_CONGESTED, /* The data socket is congested */ NET_CONGESTED, /* The data socket is congested */
DISCARD_CONCURRENT, /* Set on one node, cleared on the peer! */ DISCARD_CONCURRENT, /* Set on one node, cleared on the peer! */
SEND_PING, /* whether asender should send a ping asap */ SEND_PING, /* whether asender should send a ping asap */
SIGNAL_ASENDER, /* whether asender wants to be interrupted */
}; };
struct drbd_tconn { /* is a resource from the config file */ struct drbd_tconn { /* is a resource from the config file */
...@@ -1861,7 +1860,7 @@ drbd_queue_work(struct drbd_work_queue *q, struct drbd_work *w) ...@@ -1861,7 +1860,7 @@ drbd_queue_work(struct drbd_work_queue *q, struct drbd_work *w)
static inline void wake_asender(struct drbd_conf *mdev) static inline void wake_asender(struct drbd_conf *mdev)
{ {
if (test_bit(SIGNAL_ASENDER, &mdev->flags)) if (test_bit(SIGNAL_ASENDER, &mdev->tconn->flags))
force_sig(DRBD_SIG, mdev->tconn->asender.task); force_sig(DRBD_SIG, mdev->tconn->asender.task);
} }
......
...@@ -4580,12 +4580,12 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -4580,12 +4580,12 @@ int drbd_asender(struct drbd_thread *thi)
3 < atomic_read(&mdev->unacked_cnt)) 3 < atomic_read(&mdev->unacked_cnt))
drbd_tcp_cork(mdev->tconn->meta.socket); drbd_tcp_cork(mdev->tconn->meta.socket);
while (1) { while (1) {
clear_bit(SIGNAL_ASENDER, &mdev->flags); clear_bit(SIGNAL_ASENDER, &mdev->tconn->flags);
flush_signals(current); flush_signals(current);
if (!drbd_process_done_ee(mdev)) if (!drbd_process_done_ee(mdev))
goto reconnect; goto reconnect;
/* to avoid race with newly queued ACKs */ /* to avoid race with newly queued ACKs */
set_bit(SIGNAL_ASENDER, &mdev->flags); set_bit(SIGNAL_ASENDER, &mdev->tconn->flags);
spin_lock_irq(&mdev->tconn->req_lock); spin_lock_irq(&mdev->tconn->req_lock);
empty = list_empty(&mdev->done_ee); empty = list_empty(&mdev->done_ee);
spin_unlock_irq(&mdev->tconn->req_lock); spin_unlock_irq(&mdev->tconn->req_lock);
...@@ -4605,7 +4605,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -4605,7 +4605,7 @@ int drbd_asender(struct drbd_thread *thi)
rv = drbd_recv_short(mdev, mdev->tconn->meta.socket, rv = drbd_recv_short(mdev, mdev->tconn->meta.socket,
buf, expect-received, 0); buf, expect-received, 0);
clear_bit(SIGNAL_ASENDER, &mdev->flags); clear_bit(SIGNAL_ASENDER, &mdev->tconn->flags);
flush_signals(current); flush_signals(current);
...@@ -4688,7 +4688,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -4688,7 +4688,7 @@ int drbd_asender(struct drbd_thread *thi)
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); drbd_force_state(mdev, NS(conn, C_DISCONNECTING));
drbd_md_sync(mdev); drbd_md_sync(mdev);
} }
clear_bit(SIGNAL_ASENDER, &mdev->flags); clear_bit(SIGNAL_ASENDER, &mdev->tconn->flags);
D_ASSERT(mdev->state.conn < C_CONNECTED); D_ASSERT(mdev->state.conn < C_CONNECTED);
dev_info(DEV, "asender terminated\n"); dev_info(DEV, "asender terminated\n");
......
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