mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Reviewed-by: Sage Weil <[email protected]>
This commit is contained in:
parent
2d0ebc5d59
commit
4295f2217a
5 changed files with 50 additions and 25 deletions
|
|
@ -1809,10 +1809,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
|
|||
osd_req->r_priv = obj_request;
|
||||
|
||||
osd_req->r_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout);
|
||||
|
||||
osd_req->r_oid_len = strlen(obj_request->object_name);
|
||||
rbd_assert(osd_req->r_oid_len < sizeof (osd_req->r_oid));
|
||||
memcpy(osd_req->r_oid, obj_request->object_name, osd_req->r_oid_len);
|
||||
ceph_oid_set_name(&osd_req->r_oid, obj_request->object_name);
|
||||
|
||||
return osd_req;
|
||||
}
|
||||
|
|
@ -1850,10 +1847,7 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request)
|
|||
osd_req->r_priv = obj_request;
|
||||
|
||||
osd_req->r_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout);
|
||||
|
||||
osd_req->r_oid_len = strlen(obj_request->object_name);
|
||||
rbd_assert(osd_req->r_oid_len < sizeof (osd_req->r_oid));
|
||||
memcpy(osd_req->r_oid, obj_request->object_name, osd_req->r_oid_len);
|
||||
ceph_oid_set_name(&osd_req->r_oid, obj_request->object_name);
|
||||
|
||||
return osd_req;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue