drbd: Moved SEND_PING to the per connection (tconn) flags
authorPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 7 Feb 2011 13:40:40 +0000 (14:40 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Wed, 28 Sep 2011 08:26:56 +0000 (10:26 +0200)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_receiver.c

index 2b8566362b78df67311eafab956b9e77eba75c61..227c0956e802e4c184acdfae29eb2c5b52cae319 100644 (file)
@@ -758,7 +758,6 @@ enum {
 enum {
        CREATE_BARRIER,         /* next P_DATA is preceded by a P_BARRIER */
        SIGNAL_ASENDER,         /* whether asender wants to be interrupted */
-       SEND_PING,              /* whether asender should send a ping asap */
 
        UNPLUG_QUEUED,          /* only relevant with kernel 2.4 */
        UNPLUG_REMOTE,          /* sending a "UnplugRemote" could help */
@@ -911,6 +910,7 @@ struct fifo_buffer {
 enum {
        NET_CONGESTED,          /* The data socket is congested */
        DISCARD_CONCURRENT,     /* Set on one node, cleared on the peer! */
+       SEND_PING,              /* whether asender should send a ping asap */
 };
 
 struct drbd_tconn {                    /* is a resource from the config file */
@@ -1867,7 +1867,7 @@ static inline void wake_asender(struct drbd_conf *mdev)
 
 static inline void request_ping(struct drbd_conf *mdev)
 {
-       set_bit(SEND_PING, &mdev->flags);
+       set_bit(SEND_PING, &mdev->tconn->flags);
        wake_asender(mdev);
 }
 
index e2eed149bb9c01bee5a7625585e4d94b1466f71b..54bf7a5c2252c5a9d4fb7b0520cf7d726c9f54ad 100644 (file)
@@ -4564,7 +4564,7 @@ int drbd_asender(struct drbd_thread *thi)
 
        while (get_t_state(thi) == RUNNING) {
                drbd_thread_current_set_cpu(mdev, thi);
-               if (test_and_clear_bit(SEND_PING, &mdev->flags)) {
+               if (test_and_clear_bit(SEND_PING, &mdev->tconn->flags)) {
                        if (!drbd_send_ping(mdev)) {
                                dev_err(DEV, "drbd_send_ping has failed\n");
                                goto reconnect;
@@ -4635,7 +4635,7 @@ int drbd_asender(struct drbd_thread *thi)
                                dev_err(DEV, "PingAck did not arrive in time.\n");
                                goto reconnect;
                        }
-                       set_bit(SEND_PING, &mdev->flags);
+                       set_bit(SEND_PING, &mdev->tconn->flags);
                        continue;
                } else if (rv == -EINTR) {
                        continue;