diff options
author | Alex Elder <elder@inktank.com> | 2013-01-25 17:08:55 -0600 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-02-13 18:29:09 -0800 |
commit | 6977c3f983b0d2b481a65b1fa3e85683fd1318af (patch) | |
tree | 8eaec1896170c886a488ade9c7a46cbaa415190b /drivers | |
parent | 9f20e02a53b944a54a35b9f0db1243cd64872f7d (diff) | |
download | linux-3.10-6977c3f983b0d2b481a65b1fa3e85683fd1318af.tar.gz linux-3.10-6977c3f983b0d2b481a65b1fa3e85683fd1318af.tar.bz2 linux-3.10-6977c3f983b0d2b481a65b1fa3e85683fd1318af.zip |
rbd: unregister linger in watch sync routine
Move the code that unregisters an rbd device's lingering header
object watch request into rbd_dev_header_watch_sync(), so it
occurs in the same function that originally sets up that request.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/rbd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 4ea89917bb9..5593def33ce 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1721,6 +1721,10 @@ static int rbd_dev_header_watch_sync(struct rbd_device *rbd_dev, int start) if (start) { rbd_dev->watch_request = obj_request->osd_req; ceph_osdc_set_request_linger(osdc, rbd_dev->watch_request); + } else { + ceph_osdc_unregister_linger_request(osdc, + rbd_dev->watch_request); + rbd_dev->watch_request = NULL; } ret = rbd_obj_request_submit(osdc, obj_request); if (ret) @@ -3995,12 +3999,6 @@ static void rbd_dev_release(struct device *dev) { struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); - if (rbd_dev->watch_request) { - struct ceph_client *client = rbd_dev->rbd_client->client; - - ceph_osdc_unregister_linger_request(&client->osdc, - rbd_dev->watch_request); - } if (rbd_dev->watch_event) rbd_dev_header_watch_sync(rbd_dev, 0); |