};
struct rbd_mapping {
- char *snap_name;
- u64 snap_id;
u64 size;
u64 features;
bool snap_exists;
char *pool_name;
u64 pool_id;
+ char *snap_name;
+ u64 snap_id;
+
struct ceph_osd_event *watch_event;
struct ceph_osd_request *watch_request;
list_for_each_entry(snap, &rbd_dev->snaps, node) {
if (!strcmp(snap_name, snap->name)) {
- rbd_dev->mapping.snap_id = snap->id;
+ rbd_dev->snap_id = snap->id;
rbd_dev->mapping.size = snap->size;
rbd_dev->mapping.features = snap->features;
if (!memcmp(snap_name, RBD_SNAP_HEAD_NAME,
sizeof (RBD_SNAP_HEAD_NAME))) {
- rbd_dev->mapping.snap_id = CEPH_NOSNAP;
+ rbd_dev->snap_id = CEPH_NOSNAP;
rbd_dev->mapping.size = rbd_dev->header.image_size;
rbd_dev->mapping.features = rbd_dev->header.features;
rbd_dev->mapping.snap_exists = false;
rbd_dev->mapping.snap_exists = true;
rbd_dev->mapping.read_only = true;
}
- rbd_dev->mapping.snap_name = snap_name;
+ rbd_dev->snap_name = snap_name;
done:
return ret;
}
opcode = CEPH_OSD_OP_READ;
flags = CEPH_OSD_FLAG_READ;
snapc = NULL;
- snapid = rbd_dev->mapping.snap_id;
+ snapid = rbd_dev->snap_id;
payload_len = 0;
}
down_read(&rbd_dev->header_rwsem);
- if (rbd_dev->mapping.snap_id != CEPH_NOSNAP &&
+ if (rbd_dev->snap_id != CEPH_NOSNAP &&
!rbd_dev->mapping.snap_exists) {
up_read(&rbd_dev->header_rwsem);
dout("request for non-existent snapshot");
{
sector_t size;
- if (rbd_dev->mapping.snap_id != CEPH_NOSNAP)
+ if (rbd_dev->snap_id != CEPH_NOSNAP)
return;
size = (sector_t) rbd_dev->header.image_size / SECTOR_SIZE;
{
struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);
- return sprintf(buf, "%s\n", rbd_dev->mapping.snap_name);
+ return sprintf(buf, "%s\n", rbd_dev->snap_name);
}
static ssize_t rbd_image_refresh(struct device *dev,
/* Existing snapshot not in the new snap context */
- if (rbd_dev->mapping.snap_id == snap->id)
+ if (rbd_dev->snap_id == snap->id)
rbd_dev->mapping.snap_exists = false;
rbd_remove_snap_dev(snap);
dout("%ssnap id %llu has been removed\n",
- rbd_dev->mapping.snap_id == snap->id ?
- "mapped " : "",
+ rbd_dev->snap_id == snap->id ? "mapped " : "",
(unsigned long long) snap->id);
/* Done with this list entry; advance */
rbd_put_client(rbd_dev);
kfree(rbd_dev->image_id);
err_out_args:
- kfree(rbd_dev->mapping.snap_name);
+ kfree(rbd_dev->snap_name);
kfree(rbd_dev->image_name);
kfree(rbd_dev->pool_name);
err_out_mem:
rbd_header_free(&rbd_dev->header);
/* done with the id, and with the rbd_dev */
- kfree(rbd_dev->mapping.snap_name);
+ kfree(rbd_dev->snap_name);
kfree(rbd_dev->image_id);
kfree(rbd_dev->header_name);
kfree(rbd_dev->pool_name);