Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260346
b: refs/heads/master
c: 79e3057
h: refs/heads/master
v: v3
  • Loading branch information
Yehuda Sadeh authored and Sage Weil committed Jul 26, 2011
1 parent c5af32a commit 805da04
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f90b852e3ae73889d7f6de6ecf429b9b6a6b103
refs/heads/master: 79e3057c4c9d32b88e6745fd220d91b0a8b2030b
31 changes: 30 additions & 1 deletion trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,35 @@ static int rbd_req_sync_watch(struct rbd_device *dev,
return ret;
}

/*
* Request sync osd unwatch
*/
static int rbd_req_sync_unwatch(struct rbd_device *dev,
const char *obj)
{
struct ceph_osd_req_op *ops;

int ret = rbd_create_rw_ops(&ops, 1, CEPH_OSD_OP_WATCH, 0);
if (ret < 0)
return ret;

ops[0].watch.ver = 0;
ops[0].watch.cookie = cpu_to_le64(dev->watch_event->cookie);
ops[0].watch.flag = 0;

ret = rbd_req_sync_op(dev, NULL,
CEPH_NOSNAP,
0,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
ops,
1, obj, 0, 0, NULL, NULL, NULL);

rbd_destroy_ops(ops);
ceph_osdc_cancel_event(dev->watch_event);
dev->watch_event = NULL;
return ret;
}

struct rbd_notify_info {
struct rbd_device *dev;
};
Expand Down Expand Up @@ -2290,7 +2319,7 @@ static void rbd_dev_release(struct device *dev)
ceph_osdc_unregister_linger_request(&rbd_dev->client->osdc,
rbd_dev->watch_request);
if (rbd_dev->watch_event)
ceph_osdc_cancel_event(rbd_dev->watch_event);
rbd_req_sync_unwatch(rbd_dev, rbd_dev->obj_md_name);

rbd_put_client(rbd_dev);

Expand Down

0 comments on commit 805da04

Please sign in to comment.