aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2014-01-27 10:40:18 -0500
committerIlya Dryomov <ilya.dryomov@inktank.com>2014-01-27 16:57:28 -0500
commit4295f2217a5aa8ef2738e3a368db3c1ceab41212 (patch)
tree557b4efd8558bfa71bae87413d0f4d6f0ba0511a /drivers/block
parent2d0ebc5d591f49131bf8f93b54c5424162c3fb7f (diff)
libceph: introduce and start using oid abstraction
In preparation for tiering support, which would require having two (base and target) object names for each osd request and also copying those names around, introduce struct ceph_object_id (oid) and a couple helpers to facilitate those copies and encapsulate the fact that object name is not necessarily a NUL-terminated string. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 98792b2a7f65..6fdc5fc00447 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1809,10 +1809,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
1809 osd_req->r_priv = obj_request; 1809 osd_req->r_priv = obj_request;
1810 1810
1811 osd_req->r_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout); 1811 osd_req->r_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout);
1812 1812 ceph_oid_set_name(&osd_req->r_oid, obj_request->object_name);
1813 osd_req->r_oid_len = strlen(obj_request->object_name);
1814 rbd_assert(osd_req->r_oid_len < sizeof (osd_req->r_oid));
1815 memcpy(osd_req->r_oid, obj_request->object_name, osd_req->r_oid_len);
1816 1813
1817 return osd_req; 1814 return osd_req;
1818} 1815}
@@ -1850,10 +1847,7 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request)
1850 osd_req->r_priv = obj_request; 1847 osd_req->r_priv = obj_request;
1851 1848
1852 osd_req->r_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout); 1849 osd_req->r_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout);
1853 1850 ceph_oid_set_name(&osd_req->r_oid, obj_request->object_name);
1854 osd_req->r_oid_len = strlen(obj_request->object_name);
1855 rbd_assert(osd_req->r_oid_len < sizeof (osd_req->r_oid));
1856 memcpy(osd_req->r_oid, obj_request->object_name, osd_req->r_oid_len);
1857 1851
1858 return osd_req; 1852 return osd_req;
1859} 1853}