spinlock_t lock; /* queue lock */
struct rbd_image_header header;
- char *obj; /* rbd image name */
- size_t obj_len;
- char *obj_md_name; /* hdr nm. */
+ char *image_name;
+ size_t image_name_len;
+ char *header_name;
char *pool_name;
int pool_id;
if (!rbd_dev)
return;
- dout("rbd_watch_cb %s notify_id=%lld opcode=%d\n", rbd_dev->obj_md_name,
- notify_id, (int)opcode);
+ dout("rbd_watch_cb %s notify_id=%lld opcode=%d\n",
+ rbd_dev->header_name, notify_id, (int) opcode);
mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
rc = __rbd_refresh_header(rbd_dev);
mutex_unlock(&ctl_mutex);
pr_warning(RBD_DRV_NAME "%d got notification but failed to "
" update snaps: %d\n", rbd_dev->major, rc);
- rbd_req_sync_notify_ack(rbd_dev, ver, notify_id, rbd_dev->obj_md_name);
+ rbd_req_sync_notify_ack(rbd_dev, ver, notify_id, rbd_dev->header_name);
}
/*
return;
dout("rbd_notify_cb %s notify_id=%lld opcode=%d\n",
- rbd_dev->obj_md_name,
+ rbd_dev->header_name,
notify_id, (int)opcode);
}
rc = rbd_req_sync_read(rbd_dev,
NULL, CEPH_NOSNAP,
- rbd_dev->obj_md_name,
+ rbd_dev->header_name,
0, len,
(char *)dh, &ver);
if (rc < 0)
if (rc < 0) {
if (rc == -ENXIO)
pr_warning("unrecognized header format"
- " for image %s", rbd_dev->obj);
+ " for image %s\n",
+ rbd_dev->image_name);
goto out_dh;
}
ceph_encode_string_safe(&p, e, snap_name, name_len, bad);
ceph_encode_64_safe(&p, e, new_snapid, bad);
- ret = rbd_req_sync_exec(rbd_dev, rbd_dev->obj_md_name,
+ ret = rbd_req_sync_exec(rbd_dev, rbd_dev->header_name,
"rbd", "snap_add",
data, p - data, &ver);
{
struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);
- return sprintf(buf, "%s\n", rbd_dev->obj);
+ return sprintf(buf, "%s\n", rbd_dev->image_name);
}
static ssize_t rbd_snap_show(struct device *dev,
int ret, rc;
do {
- ret = rbd_req_sync_watch(rbd_dev, rbd_dev->obj_md_name,
+ ret = rbd_req_sync_watch(rbd_dev, rbd_dev->header_name,
rbd_dev->header.obj_version);
if (ret == -ERANGE) {
mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
}
/*
- * This fills in the pool_name, obj, obj_len, snap_name, obj_len,
+ * This fills in the pool_name, image_name, image_name_len, snap_name,
* rbd_dev, rbd_md_name, and name fields of the given rbd_dev, based
* on the list of monitor addresses and other options provided via
* /sys/bus/rbd/add.
const char **mon_addrs,
size_t *mon_addrs_size,
char *options,
- size_t options_size)
+ size_t options_size)
{
size_t len;
int ret;
if (!rbd_dev->pool_name)
goto out_err;
- rbd_dev->obj = dup_token(&buf, &rbd_dev->obj_len);
- if (!rbd_dev->obj)
+ rbd_dev->image_name = dup_token(&buf, &rbd_dev->image_name_len);
+ if (!rbd_dev->image_name)
goto out_err;
/* Create the name of the header object */
- rbd_dev->obj_md_name = kmalloc(rbd_dev->obj_len
+ rbd_dev->header_name = kmalloc(rbd_dev->image_name_len
+ sizeof (RBD_SUFFIX),
GFP_KERNEL);
- if (!rbd_dev->obj_md_name)
+ if (!rbd_dev->header_name)
goto out_err;
- sprintf(rbd_dev->obj_md_name, "%s%s", rbd_dev->obj, RBD_SUFFIX);
+ sprintf(rbd_dev->header_name, "%s%s", rbd_dev->image_name, RBD_SUFFIX);
/*
* The snapshot name is optional. If none is is supplied,
return 0;
out_err:
- kfree(rbd_dev->obj_md_name);
- kfree(rbd_dev->obj);
+ kfree(rbd_dev->header_name);
+ kfree(rbd_dev->image_name);
kfree(rbd_dev->pool_name);
rbd_dev->pool_name = NULL;
err_put_id:
if (rbd_dev->pool_name) {
kfree(rbd_dev->snap_name);
- kfree(rbd_dev->obj_md_name);
- kfree(rbd_dev->obj);
+ kfree(rbd_dev->header_name);
+ kfree(rbd_dev->image_name);
kfree(rbd_dev->pool_name);
}
rbd_id_put(rbd_dev);
rbd_dev->watch_request);
}
if (rbd_dev->watch_event)
- rbd_req_sync_unwatch(rbd_dev, rbd_dev->obj_md_name);
+ rbd_req_sync_unwatch(rbd_dev, rbd_dev->header_name);
rbd_put_client(rbd_dev);
/* done with the id, and with the rbd_dev */
kfree(rbd_dev->snap_name);
- kfree(rbd_dev->obj_md_name);
+ kfree(rbd_dev->header_name);
kfree(rbd_dev->pool_name);
- kfree(rbd_dev->obj);
+ kfree(rbd_dev->image_name);
rbd_id_put(rbd_dev);
kfree(rbd_dev);
mutex_unlock(&ctl_mutex);
/* make a best effort, don't error if failed */
- rbd_req_sync_notify(rbd_dev, rbd_dev->obj_md_name);
+ rbd_req_sync_notify(rbd_dev, rbd_dev->header_name);
ret = count;
kfree(name);