libceph: variable-sized ceph_object_id
[cascardo/linux.git] / net / ceph / mon_client.c
index 816fb81..cf638c0 100644 (file)
@@ -222,8 +222,8 @@ static void __schedule_delayed(struct ceph_mon_client *monc)
                delay = CEPH_MONC_PING_INTERVAL;
 
        dout("__schedule_delayed after %lu\n", delay);
-       schedule_delayed_work(&monc->delayed_work,
-                             round_jiffies_relative(delay));
+       mod_delayed_work(system_wq, &monc->delayed_work,
+                        round_jiffies_relative(delay));
 }
 
 const char *ceph_sub_str[] = {
@@ -1155,22 +1155,17 @@ static void mon_fault(struct ceph_connection *con)
 {
        struct ceph_mon_client *monc = con->private;
 
-       if (!monc)
-               return;
-
-       dout("mon_fault\n");
        mutex_lock(&monc->mutex);
-       if (!con->private)
-               goto out;
-
-       if (!monc->hunting) {
-               dout("%s hunting for new mon\n", __func__);
-               reopen_session(monc);
-       } else {
-               /* already hunting, let's wait a bit */
-               __schedule_delayed(monc);
+       dout("%s mon%d\n", __func__, monc->cur_mon);
+       if (monc->cur_mon >= 0) {
+               if (!monc->hunting) {
+                       dout("%s hunting for new mon\n", __func__);
+                       reopen_session(monc);
+                       __schedule_delayed(monc);
+               } else {
+                       dout("%s already hunting\n", __func__);
+               }
        }
-out:
        mutex_unlock(&monc->mutex);
 }