summaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-13 20:50:01 -0500
committerSage Weil <sage@inktank.com>2013-05-01 21:17:49 -0700
commitb0270324c5a9a5157f565c2de34fb1071cfdce7c (patch)
tree18e8800c8a3613400dd68aa20f4cd5cfb4fddf2b /net/ceph
parentd18d1e2807f38a94839be1f83682e17011f53322 (diff)
downloadblackbird-op-linux-b0270324c5a9a5157f565c2de34fb1071cfdce7c.tar.gz
blackbird-op-linux-b0270324c5a9a5157f565c2de34fb1071cfdce7c.zip
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>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/osd_client.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 7136060a0501..55f7c9a57a43 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -581,17 +581,10 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
truncate_size = object_size;
}
- memset(&ops, 0, sizeof ops);
- ops[0].op = opcode;
- 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;
-
+ osd_req_op_extent_init(&ops[0], opcode, objoff, objlen,
+ truncate_size, truncate_seq);
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 */
OpenPOWER on IntegriCloud