rbd: track object rather than osd request for watch
authorAlex Elder <elder@inktank.com>
Fri, 25 Jan 2013 23:08:55 +0000 (17:08 -0600)
committerSage Weil <sage@inktank.com>
Thu, 14 Feb 2013 02:29:10 +0000 (18:29 -0800)
Switch to keeping track of the object request pointer rather than
the osd request used to watch the rbd image header object.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c

index 5593def33ce51da0f7bfb79a247cebcdf59d7e72..fc1a045cee4d95e02bff324e749fe3e9a46573e6 100644 (file)
@@ -272,7 +272,7 @@ struct rbd_device {
        struct ceph_file_layout layout;
 
        struct ceph_osd_event   *watch_event;
-       struct ceph_osd_request *watch_request;
+       struct rbd_obj_request  *watch_request;
 
        struct rbd_spec         *parent_spec;
        u64                     parent_overlap;
@@ -1719,11 +1719,11 @@ static int rbd_dev_header_watch_sync(struct rbd_device *rbd_dev, int start)
                goto out_cancel;
 
        if (start) {
-               rbd_dev->watch_request = obj_request->osd_req;
-               ceph_osdc_set_request_linger(osdc, rbd_dev->watch_request);
+               ceph_osdc_set_request_linger(osdc, obj_request->osd_req);
+               rbd_dev->watch_request = obj_request;
        } else {
                ceph_osdc_unregister_linger_request(osdc,
-                                               rbd_dev->watch_request);
+                                       rbd_dev->watch_request->osd_req);
                rbd_dev->watch_request = NULL;
        }
        ret = rbd_obj_request_submit(osdc, obj_request);