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>
This commit is contained in:
Ilya Dryomov
2014-01-27 17:40:18 +02:00
parent 2d0ebc5d59
commit 4295f2217a
5 changed files with 50 additions and 25 deletions

View File

@ -132,7 +132,8 @@ static int osdc_show(struct seq_file *s, void *pp)
req->r_osd ? req->r_osd->o_osd : -1,
req->r_pgid.pool, req->r_pgid.seed);
seq_printf(s, "%.*s", req->r_oid_len, req->r_oid);
seq_printf(s, "%.*s", req->r_oid.name_len,
req->r_oid.name);
if (req->r_reassert_version.epoch)
seq_printf(s, "\t%u'%llu",