struct ceph_osd_req_op *op;
int ret = 0;
+ rbd_assert(start ^ !!rbd_dev->watch_event);
+ rbd_assert(start ^ !!rbd_dev->watch_request);
+
if (start) {
struct ceph_osd_client *osdc;
&rbd_dev->watch_event);
if (ret < 0)
return ret;
- } else {
- rbd_assert(rbd_dev->watch_request != NULL);
}
op = rbd_osd_req_op_create(CEPH_OSD_OP_WATCH,
device_unregister(&rbd_dev->dev);
}
-static int rbd_init_watch_dev(struct rbd_device *rbd_dev)
-{
- int ret, rc;
-
- do {
- ret = rbd_req_sync_watch(rbd_dev, 1);
- if (ret == -ERANGE) {
- rc = rbd_dev_refresh(rbd_dev, NULL);
- if (rc < 0)
- return rc;
- }
- } while (ret == -ERANGE);
-
- return ret;
-}
-
static atomic64_t rbd_dev_id_max = ATOMIC64_INIT(0);
/*
if (ret)
goto err_out_bus;
- ret = rbd_init_watch_dev(rbd_dev);
+ ret = rbd_req_sync_watch(rbd_dev, 1);
if (ret)
goto err_out_bus;