]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: sync stop osdc timeout timer on shutdown
authorSage Weil <sage@newdream.net>
Tue, 6 May 2008 22:55:38 +0000 (15:55 -0700)
committerSage Weil <sage@newdream.net>
Tue, 6 May 2008 22:55:38 +0000 (15:55 -0700)
src/kernel/osd_client.c
src/kernel/osd_client.h
src/kernel/super.c

index 7fd074e42a1807051dbcaf0ccef90afe5613fed1..c7c6bfaccf92c787d585927d62361f527fd78be9 100644 (file)
@@ -466,7 +466,7 @@ int do_request(struct ceph_osd_client *osdc, struct ceph_osd_request *req)
        unregister_request(osdc, req);
        if (rc < 0) {
                struct ceph_msg *msg;
-               dout(0, "tid %llu err %d, revoking %p pages\n", req->r_tid, 
+               dout(0, "tid %llu err %d, revoking %p pages\n", req->r_tid,
                     rc, req->r_request);
                /* 
                 * mark req aborted _before_ revoking pages, so that
@@ -525,6 +525,16 @@ void ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client)
        INIT_DELAYED_WORK(&osdc->timeout_work, handle_timeout);
 }
 
+void ceph_osdc_stop(struct ceph_osd_client *osdc)
+{
+       cancel_delayed_work_sync(&osdc->timeout_work);
+
+       if (osdc->osdmap) {
+               osdmap_destroy(osdc->osdmap);
+               osdc->osdmap = 0;
+       }
+}
+
 
 
 /*
index fc106e66f723bb949f20f6b20918c693720c9815..9c0949069b26a6fb0f56eb928a0d0eeb0409875c 100644 (file)
@@ -52,6 +52,8 @@ struct ceph_osd_client {
 
 extern void ceph_osdc_init(struct ceph_osd_client *osdc,
                           struct ceph_client *client);
+extern void ceph_osdc_stop(struct ceph_osd_client *osdc);
+
 extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,
                                   struct ceph_msg *msg);
 extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
index 94217abf99498bf54519ea8c197345b4fa98733e..cea4b8a6d92c929c13b707c98ac6e3dd038e6eca 100644 (file)
@@ -599,6 +599,8 @@ void ceph_destroy_client(struct ceph_client *cl)
        /* unmount */
        /* ... */
 
+       ceph_osdc_stop(&cl->osdc);
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
        if (cl->client_kobj)
                kobject_put(cl->client_kobj);