diff options
author | Sage Weil <sage@newdream.net> | 2009-10-08 13:25:46 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-10-08 13:39:08 -0400 |
commit | 0656d11ba6ffa3dee0e8916a1903f96185651217 (patch) | |
tree | 6ade91a503cdcddfd5ce3b047deb9303b0511594 /fs/ceph/mon_client.c | |
parent | e251e288082d5e89604eee1fef0c31bed1fe8f02 (diff) |
ceph: renew mon subscription before it expires
Be conservative: renew subscription once half the interval has expired.
Do not reuse sub expiration to control hunting.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mon_client.c')
-rw-r--r-- | fs/ceph/mon_client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c index b0c95cec5df8..9c34df17fa4b 100644 --- a/fs/ceph/mon_client.c +++ b/fs/ceph/mon_client.c | |||
@@ -213,7 +213,7 @@ static void handle_subscribe_ack(struct ceph_mon_client *monc, | |||
213 | monc->hunting = false; | 213 | monc->hunting = false; |
214 | } | 214 | } |
215 | dout("handle_subscribe_ack after %d seconds\n", seconds); | 215 | dout("handle_subscribe_ack after %d seconds\n", seconds); |
216 | monc->sub_renew_after = monc->sub_sent + seconds*HZ - 1; | 216 | monc->sub_renew_after = monc->sub_sent + (seconds >> 1)*HZ - 1; |
217 | monc->sub_sent = 0; | 217 | monc->sub_sent = 0; |
218 | mutex_unlock(&monc->mutex); | 218 | mutex_unlock(&monc->mutex); |
219 | return; | 219 | return; |
@@ -512,7 +512,7 @@ static void delayed_work(struct work_struct *work) | |||
512 | if (monc->want_mount) { | 512 | if (monc->want_mount) { |
513 | __request_mount(monc); | 513 | __request_mount(monc); |
514 | } else { | 514 | } else { |
515 | if (__sub_expired(monc)) { | 515 | if (monc->hunting) { |
516 | __close_session(monc); | 516 | __close_session(monc); |
517 | __open_session(monc); /* continue hunting */ | 517 | __open_session(monc); /* continue hunting */ |
518 | } else { | 518 | } else { |