diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/osd_client.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 87fcf0b795c0..23491e92b229 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -372,6 +372,13 @@ void osd_req_op_extent_update(struct ceph_osd_req_op *op, u64 length) | |||
372 | } | 372 | } |
373 | EXPORT_SYMBOL(osd_req_op_extent_update); | 373 | EXPORT_SYMBOL(osd_req_op_extent_update); |
374 | 374 | ||
375 | void osd_req_op_extent_osd_data(struct ceph_osd_req_op *op, | ||
376 | struct ceph_osd_data *osd_data) | ||
377 | { | ||
378 | op->extent.osd_data = osd_data; | ||
379 | } | ||
380 | EXPORT_SYMBOL(osd_req_op_extent_osd_data); | ||
381 | |||
375 | void osd_req_op_cls_init(struct ceph_osd_req_op *op, u16 opcode, | 382 | void osd_req_op_cls_init(struct ceph_osd_req_op *op, u16 opcode, |
376 | const char *class, const char *method, | 383 | const char *class, const char *method, |
377 | const void *request_data, size_t request_data_size) | 384 | const void *request_data, size_t request_data_size) |
@@ -406,6 +413,13 @@ void osd_req_op_cls_init(struct ceph_osd_req_op *op, u16 opcode, | |||
406 | } | 413 | } |
407 | EXPORT_SYMBOL(osd_req_op_cls_init); | 414 | EXPORT_SYMBOL(osd_req_op_cls_init); |
408 | 415 | ||
416 | void osd_req_op_cls_response_data(struct ceph_osd_req_op *op, | ||
417 | struct ceph_osd_data *response_data) | ||
418 | { | ||
419 | op->cls.response_data = response_data; | ||
420 | } | ||
421 | EXPORT_SYMBOL(osd_req_op_cls_response_data); | ||
422 | |||
409 | void osd_req_op_watch_init(struct ceph_osd_req_op *op, u16 opcode, | 423 | void osd_req_op_watch_init(struct ceph_osd_req_op *op, u16 opcode, |
410 | u64 cookie, u64 version, int flag) | 424 | u64 cookie, u64 version, int flag) |
411 | { | 425 | { |
@@ -449,6 +463,10 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req, | |||
449 | cpu_to_le64(src->extent.truncate_size); | 463 | cpu_to_le64(src->extent.truncate_size); |
450 | dst->extent.truncate_seq = | 464 | dst->extent.truncate_seq = |
451 | cpu_to_le32(src->extent.truncate_seq); | 465 | cpu_to_le32(src->extent.truncate_seq); |
466 | if (src->op == CEPH_OSD_OP_WRITE) | ||
467 | WARN_ON(src->extent.osd_data != &req->r_data_out); | ||
468 | else | ||
469 | WARN_ON(src->extent.osd_data != &req->r_data_in); | ||
452 | break; | 470 | break; |
453 | case CEPH_OSD_OP_CALL: | 471 | case CEPH_OSD_OP_CALL: |
454 | pagelist = kmalloc(sizeof (*pagelist), GFP_NOFS); | 472 | pagelist = kmalloc(sizeof (*pagelist), GFP_NOFS); |
@@ -464,8 +482,9 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req, | |||
464 | src->cls.method_len); | 482 | src->cls.method_len); |
465 | ceph_pagelist_append(pagelist, src->cls.request_data, | 483 | ceph_pagelist_append(pagelist, src->cls.request_data, |
466 | src->cls.request_data_len); | 484 | src->cls.request_data_len); |
467 | |||
468 | ceph_osd_data_pagelist_init(&req->r_data_out, pagelist); | 485 | ceph_osd_data_pagelist_init(&req->r_data_out, pagelist); |
486 | |||
487 | WARN_ON(src->cls.response_data != &req->r_data_in); | ||
469 | request_data_len = pagelist->length; | 488 | request_data_len = pagelist->length; |
470 | break; | 489 | break; |
471 | case CEPH_OSD_OP_STARTSYNC: | 490 | case CEPH_OSD_OP_STARTSYNC: |
@@ -609,6 +628,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
609 | bool use_mempool) | 628 | bool use_mempool) |
610 | { | 629 | { |
611 | struct ceph_osd_request *req; | 630 | struct ceph_osd_request *req; |
631 | struct ceph_osd_data *osd_data; | ||
612 | struct ceph_osd_req_op *op; | 632 | struct ceph_osd_req_op *op; |
613 | u64 objnum = 0; | 633 | u64 objnum = 0; |
614 | u64 objoff = 0; | 634 | u64 objoff = 0; |
@@ -623,6 +643,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
623 | GFP_NOFS); | 643 | GFP_NOFS); |
624 | if (!req) | 644 | if (!req) |
625 | return ERR_PTR(-ENOMEM); | 645 | return ERR_PTR(-ENOMEM); |
646 | osd_data = opcode == CEPH_OSD_OP_WRITE ? &req->r_data_out | ||
647 | : &req->r_data_in; | ||
626 | 648 | ||
627 | req->r_flags = flags; | 649 | req->r_flags = flags; |
628 | 650 | ||
@@ -646,6 +668,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
646 | op = &req->r_ops[0]; | 668 | op = &req->r_ops[0]; |
647 | osd_req_op_extent_init(op, opcode, objoff, objlen, | 669 | osd_req_op_extent_init(op, opcode, objoff, objlen, |
648 | truncate_size, truncate_seq); | 670 | truncate_size, truncate_seq); |
671 | osd_req_op_extent_osd_data(op, osd_data); | ||
672 | |||
649 | /* | 673 | /* |
650 | * A second op in the ops array means the caller wants to | 674 | * A second op in the ops array means the caller wants to |
651 | * also issue a include a 'startsync' command so that the | 675 | * also issue a include a 'startsync' command so that the |