]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drbd: Use tconn in request_timer_fn()
authorPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 1 Mar 2011 10:08:28 +0000 (11:08 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:45:07 +0000 (16:45 +0100)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_req.c

index 7bc7b098787ae824acea6eb9f18788ea8bf17281..9ad8dd3a84818a29a371641fd086255e92ba4bef 100644 (file)
@@ -794,6 +794,7 @@ int drbd_connected(int vnr, void *p, void *data)
                err = drbd_send_state(mdev);
        clear_bit(USE_DEGR_WFC_T, &mdev->flags);
        clear_bit(RESIZE_PENDING, &mdev->flags);
+       mod_timer(&mdev->request_timer, jiffies + HZ); /* just start it here. */
        return err;
 }
 
index e296d7ed6b8f6992377088265ff8f374e230dcd7..fd0b4529a4b912bb73538bfe985761d5a8c58be1 100644 (file)
@@ -1047,21 +1047,22 @@ int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct
 void request_timer_fn(unsigned long data)
 {
        struct drbd_conf *mdev = (struct drbd_conf *) data;
+       struct drbd_tconn *tconn = mdev->tconn;
        struct drbd_request *req; /* oldest request */
        struct list_head *le;
        unsigned long et = 0; /* effective timeout = ko_count * timeout */
 
-       if (get_net_conf(mdev->tconn)) {
-               et = mdev->tconn->net_conf->timeout*HZ/10 * mdev->tconn->net_conf->ko_count;
-               put_net_conf(mdev->tconn);
+       if (get_net_conf(tconn)) {
+               et = tconn->net_conf->timeout*HZ/10 * tconn->net_conf->ko_count;
+               put_net_conf(tconn);
        }
        if (!et || mdev->state.conn < C_WF_REPORT_PARAMS)
                return; /* Recurring timer stopped */
 
-       spin_lock_irq(&mdev->tconn->req_lock);
-       le = &mdev->tconn->oldest_tle->requests;
+       spin_lock_irq(&tconn->req_lock);
+       le = &tconn->oldest_tle->requests;
        if (list_empty(le)) {
-               spin_unlock_irq(&mdev->tconn->req_lock);
+               spin_unlock_irq(&tconn->req_lock);
                mod_timer(&mdev->request_timer, jiffies + et);
                return;
        }
@@ -1080,5 +1081,5 @@ void request_timer_fn(unsigned long data)
                mod_timer(&mdev->request_timer, req->start_time + et);
        }
 
-       spin_unlock_irq(&mdev->tconn->req_lock);
+       spin_unlock_irq(&tconn->req_lock);
 }