提交 3c972c95 编写于 作者: I Ilya Dryomov

libceph: rename ceph_osd_request::r_{oloc,oid} to r_base_{oloc,oid}

Rename ceph_osd_request::r_{oloc,oid} to r_base_{oloc,oid} before
introducing r_target_{oloc,oid} needed for redirects.
Signed-off-by: NIlya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: NSage Weil <sage@inktank.com>
上级 17a13e40
...@@ -1808,8 +1808,8 @@ static struct ceph_osd_request *rbd_osd_req_create( ...@@ -1808,8 +1808,8 @@ static struct ceph_osd_request *rbd_osd_req_create(
osd_req->r_callback = rbd_osd_req_callback; osd_req->r_callback = rbd_osd_req_callback;
osd_req->r_priv = obj_request; osd_req->r_priv = obj_request;
osd_req->r_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout); osd_req->r_base_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout);
ceph_oid_set_name(&osd_req->r_oid, obj_request->object_name); ceph_oid_set_name(&osd_req->r_base_oid, obj_request->object_name);
return osd_req; return osd_req;
} }
...@@ -1846,8 +1846,8 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request) ...@@ -1846,8 +1846,8 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request)
osd_req->r_callback = rbd_osd_req_callback; osd_req->r_callback = rbd_osd_req_callback;
osd_req->r_priv = obj_request; osd_req->r_priv = obj_request;
osd_req->r_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout); osd_req->r_base_oloc.pool = ceph_file_layout_pg_pool(rbd_dev->layout);
ceph_oid_set_name(&osd_req->r_oid, obj_request->object_name); ceph_oid_set_name(&osd_req->r_base_oid, obj_request->object_name);
return osd_req; return osd_req;
} }
......
...@@ -153,8 +153,8 @@ struct ceph_osd_request { ...@@ -153,8 +153,8 @@ struct ceph_osd_request {
struct inode *r_inode; /* for use by callbacks */ struct inode *r_inode; /* for use by callbacks */
void *r_priv; /* ditto */ void *r_priv; /* ditto */
struct ceph_object_locator r_oloc; struct ceph_object_locator r_base_oloc;
struct ceph_object_id r_oid; struct ceph_object_id r_base_oid;
u64 r_snapid; u64 r_snapid;
unsigned long r_stamp; /* send OR check time */ unsigned long r_stamp; /* send OR check time */
......
...@@ -132,8 +132,8 @@ static int osdc_show(struct seq_file *s, void *pp) ...@@ -132,8 +132,8 @@ static int osdc_show(struct seq_file *s, void *pp)
req->r_osd ? req->r_osd->o_osd : -1, req->r_osd ? req->r_osd->o_osd : -1,
req->r_pgid.pool, req->r_pgid.seed); req->r_pgid.pool, req->r_pgid.seed);
seq_printf(s, "%.*s", req->r_oid.name_len, seq_printf(s, "%.*s", req->r_base_oid.name_len,
req->r_oid.name); req->r_base_oid.name);
if (req->r_reassert_version.epoch) if (req->r_reassert_version.epoch)
seq_printf(s, "\t%u'%llu", seq_printf(s, "\t%u'%llu",
......
...@@ -368,7 +368,7 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, ...@@ -368,7 +368,7 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
INIT_LIST_HEAD(&req->r_req_lru_item); INIT_LIST_HEAD(&req->r_req_lru_item);
INIT_LIST_HEAD(&req->r_osd_item); INIT_LIST_HEAD(&req->r_osd_item);
req->r_oloc.pool = -1; req->r_base_oloc.pool = -1;
/* create reply message */ /* create reply message */
if (use_mempool) if (use_mempool)
...@@ -763,11 +763,11 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, ...@@ -763,11 +763,11 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
if (num_ops > 1) if (num_ops > 1)
osd_req_op_init(req, 1, CEPH_OSD_OP_STARTSYNC); osd_req_op_init(req, 1, CEPH_OSD_OP_STARTSYNC);
req->r_oloc.pool = ceph_file_layout_pg_pool(*layout); req->r_base_oloc.pool = ceph_file_layout_pg_pool(*layout);
snprintf(req->r_oid.name, sizeof(req->r_oid.name), snprintf(req->r_base_oid.name, sizeof(req->r_base_oid.name),
"%llx.%08llx", vino.ino, objnum); "%llx.%08llx", vino.ino, objnum);
req->r_oid.name_len = strlen(req->r_oid.name); req->r_base_oid.name_len = strlen(req->r_base_oid.name);
return req; return req;
} }
...@@ -1259,20 +1259,20 @@ static int __calc_request_pg(struct ceph_osdmap *osdmap, ...@@ -1259,20 +1259,20 @@ static int __calc_request_pg(struct ceph_osdmap *osdmap,
if ((req->r_flags & CEPH_OSD_FLAG_IGNORE_OVERLAY) == 0) { if ((req->r_flags & CEPH_OSD_FLAG_IGNORE_OVERLAY) == 0) {
struct ceph_pg_pool_info *pi; struct ceph_pg_pool_info *pi;
pi = ceph_pg_pool_by_id(osdmap, req->r_oloc.pool); pi = ceph_pg_pool_by_id(osdmap, req->r_base_oloc.pool);
if (pi) { if (pi) {
if ((req->r_flags & CEPH_OSD_FLAG_READ) && if ((req->r_flags & CEPH_OSD_FLAG_READ) &&
pi->read_tier >= 0) pi->read_tier >= 0)
req->r_oloc.pool = pi->read_tier; req->r_base_oloc.pool = pi->read_tier;
if ((req->r_flags & CEPH_OSD_FLAG_WRITE) && if ((req->r_flags & CEPH_OSD_FLAG_WRITE) &&
pi->write_tier >= 0) pi->write_tier >= 0)
req->r_oloc.pool = pi->write_tier; req->r_base_oloc.pool = pi->write_tier;
} }
/* !pi is caught in ceph_oloc_oid_to_pg() */ /* !pi is caught in ceph_oloc_oid_to_pg() */
} }
return ceph_oloc_oid_to_pg(osdmap, &req->r_oloc, return ceph_oloc_oid_to_pg(osdmap, &req->r_base_oloc,
&req->r_oid, pg_out); &req->r_base_oid, pg_out);
} }
/* /*
...@@ -1382,7 +1382,7 @@ static void __send_request(struct ceph_osd_client *osdc, ...@@ -1382,7 +1382,7 @@ static void __send_request(struct ceph_osd_client *osdc,
/* fill in message content that changes each time we send it */ /* fill in message content that changes each time we send it */
put_unaligned_le32(osdc->osdmap->epoch, req->r_request_osdmap_epoch); put_unaligned_le32(osdc->osdmap->epoch, req->r_request_osdmap_epoch);
put_unaligned_le32(req->r_flags, req->r_request_flags); put_unaligned_le32(req->r_flags, req->r_request_flags);
put_unaligned_le64(req->r_oloc.pool, req->r_request_pool); put_unaligned_le64(req->r_base_oloc.pool, req->r_request_pool);
p = req->r_request_pgid; p = req->r_request_pgid;
ceph_encode_64(&p, req->r_pgid.pool); ceph_encode_64(&p, req->r_pgid.pool);
ceph_encode_32(&p, req->r_pgid.seed); ceph_encode_32(&p, req->r_pgid.seed);
...@@ -2144,11 +2144,11 @@ void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off, ...@@ -2144,11 +2144,11 @@ void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off,
ceph_encode_32(&p, -1); /* preferred */ ceph_encode_32(&p, -1); /* preferred */
/* oid */ /* oid */
ceph_encode_32(&p, req->r_oid.name_len); ceph_encode_32(&p, req->r_base_oid.name_len);
memcpy(p, req->r_oid.name, req->r_oid.name_len); memcpy(p, req->r_base_oid.name, req->r_base_oid.name_len);
dout("oid '%.*s' len %d\n", req->r_oid.name_len, dout("oid '%.*s' len %d\n", req->r_base_oid.name_len,
req->r_oid.name, req->r_oid.name_len); req->r_base_oid.name, req->r_base_oid.name_len);
p += req->r_oid.name_len; p += req->r_base_oid.name_len;
/* ops--can imply data */ /* ops--can imply data */
ceph_encode_16(&p, (u16)req->r_num_ops); ceph_encode_16(&p, (u16)req->r_num_ops);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册