libceph: use osd_req_op_extent_init()
Use osd_req_op_extent_init() in ceph_osdc_new_request() to initialize the one or two ops built in that function. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
parent
d18d1e2807
commit
b0270324c5
|
@ -581,17 +581,10 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
|
||||||
truncate_size = object_size;
|
truncate_size = object_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&ops, 0, sizeof ops);
|
osd_req_op_extent_init(&ops[0], opcode, objoff, objlen,
|
||||||
ops[0].op = opcode;
|
truncate_size, truncate_seq);
|
||||||
ops[0].extent.offset = objoff;
|
|
||||||
ops[0].extent.length = objlen;
|
|
||||||
ops[0].extent.truncate_size = truncate_size;
|
|
||||||
ops[0].extent.truncate_seq = truncate_seq;
|
|
||||||
if (ops[0].op == CEPH_OSD_OP_WRITE)
|
|
||||||
ops[0].payload_len = *plen;
|
|
||||||
|
|
||||||
if (do_sync)
|
if (do_sync)
|
||||||
ops[1].op = CEPH_OSD_OP_STARTSYNC;
|
osd_req_op_init(&ops[1], CEPH_OSD_OP_STARTSYNC);
|
||||||
|
|
||||||
req->r_file_layout = *layout; /* keep a copy */
|
req->r_file_layout = *layout; /* keep a copy */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue