diff options
author | Alex Elder <elder@inktank.com> | 2013-04-05 15:46:01 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:18:34 -0400 |
commit | 90af36022aecdeeb1b9c0755461187de717c86dd (patch) | |
tree | 275c653789249a7499165cb36ddb608b5b4bc6df /net | |
parent | ca8b3a69174b04376722672d7dd6b666a7f17c50 (diff) |
libceph: add, don't set data for a message
Change the names of the functions that put data on a pagelist to
reflect that we're adding to whatever's already there rather than
just setting it to the one thing. Currently only one data item is
ever added to a message, but that's about to change.
This resolves:
http://tracker.ceph.com/issues/2770
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/messenger.c | 12 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 84703e550c26..a36d98d8073e 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -3005,7 +3005,7 @@ static void ceph_msg_data_destroy(struct ceph_msg_data *data) | |||
3005 | kfree(data); | 3005 | kfree(data); |
3006 | } | 3006 | } |
3007 | 3007 | ||
3008 | void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages, | 3008 | void ceph_msg_data_add_pages(struct ceph_msg *msg, struct page **pages, |
3009 | size_t length, size_t alignment) | 3009 | size_t length, size_t alignment) |
3010 | { | 3010 | { |
3011 | struct ceph_msg_data *data; | 3011 | struct ceph_msg_data *data; |
@@ -3023,9 +3023,9 @@ void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages, | |||
3023 | list_add_tail(&data->links, &msg->data); | 3023 | list_add_tail(&data->links, &msg->data); |
3024 | msg->data_length += length; | 3024 | msg->data_length += length; |
3025 | } | 3025 | } |
3026 | EXPORT_SYMBOL(ceph_msg_data_set_pages); | 3026 | EXPORT_SYMBOL(ceph_msg_data_add_pages); |
3027 | 3027 | ||
3028 | void ceph_msg_data_set_pagelist(struct ceph_msg *msg, | 3028 | void ceph_msg_data_add_pagelist(struct ceph_msg *msg, |
3029 | struct ceph_pagelist *pagelist) | 3029 | struct ceph_pagelist *pagelist) |
3030 | { | 3030 | { |
3031 | struct ceph_msg_data *data; | 3031 | struct ceph_msg_data *data; |
@@ -3040,10 +3040,10 @@ void ceph_msg_data_set_pagelist(struct ceph_msg *msg, | |||
3040 | list_add_tail(&data->links, &msg->data); | 3040 | list_add_tail(&data->links, &msg->data); |
3041 | msg->data_length += pagelist->length; | 3041 | msg->data_length += pagelist->length; |
3042 | } | 3042 | } |
3043 | EXPORT_SYMBOL(ceph_msg_data_set_pagelist); | 3043 | EXPORT_SYMBOL(ceph_msg_data_add_pagelist); |
3044 | 3044 | ||
3045 | #ifdef CONFIG_BLOCK | 3045 | #ifdef CONFIG_BLOCK |
3046 | void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio, | 3046 | void ceph_msg_data_add_bio(struct ceph_msg *msg, struct bio *bio, |
3047 | size_t length) | 3047 | size_t length) |
3048 | { | 3048 | { |
3049 | struct ceph_msg_data *data; | 3049 | struct ceph_msg_data *data; |
@@ -3058,7 +3058,7 @@ void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio, | |||
3058 | list_add_tail(&data->links, &msg->data); | 3058 | list_add_tail(&data->links, &msg->data); |
3059 | msg->data_length += length; | 3059 | msg->data_length += length; |
3060 | } | 3060 | } |
3061 | EXPORT_SYMBOL(ceph_msg_data_set_bio); | 3061 | EXPORT_SYMBOL(ceph_msg_data_add_bio); |
3062 | #endif /* CONFIG_BLOCK */ | 3062 | #endif /* CONFIG_BLOCK */ |
3063 | 3063 | ||
3064 | /* | 3064 | /* |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 2562e4e52245..73227853d845 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -550,7 +550,7 @@ void osd_req_op_watch_init(struct ceph_osd_request *osd_req, | |||
550 | } | 550 | } |
551 | EXPORT_SYMBOL(osd_req_op_watch_init); | 551 | EXPORT_SYMBOL(osd_req_op_watch_init); |
552 | 552 | ||
553 | static void ceph_osdc_msg_data_set(struct ceph_msg *msg, | 553 | static void ceph_osdc_msg_data_add(struct ceph_msg *msg, |
554 | struct ceph_osd_data *osd_data) | 554 | struct ceph_osd_data *osd_data) |
555 | { | 555 | { |
556 | u64 length = ceph_osd_data_length(osd_data); | 556 | u64 length = ceph_osd_data_length(osd_data); |
@@ -558,14 +558,14 @@ static void ceph_osdc_msg_data_set(struct ceph_msg *msg, | |||
558 | if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { | 558 | if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { |
559 | BUG_ON(length > (u64) SIZE_MAX); | 559 | BUG_ON(length > (u64) SIZE_MAX); |
560 | if (length) | 560 | if (length) |
561 | ceph_msg_data_set_pages(msg, osd_data->pages, | 561 | ceph_msg_data_add_pages(msg, osd_data->pages, |
562 | length, osd_data->alignment); | 562 | length, osd_data->alignment); |
563 | } else if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGELIST) { | 563 | } else if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGELIST) { |
564 | BUG_ON(!length); | 564 | BUG_ON(!length); |
565 | ceph_msg_data_set_pagelist(msg, osd_data->pagelist); | 565 | ceph_msg_data_add_pagelist(msg, osd_data->pagelist); |
566 | #ifdef CONFIG_BLOCK | 566 | #ifdef CONFIG_BLOCK |
567 | } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { | 567 | } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { |
568 | ceph_msg_data_set_bio(msg, osd_data->bio, length); | 568 | ceph_msg_data_add_bio(msg, osd_data->bio, length); |
569 | #endif | 569 | #endif |
570 | } else { | 570 | } else { |
571 | BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE); | 571 | BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE); |
@@ -600,18 +600,18 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req, | |||
600 | dst->extent.truncate_seq = | 600 | dst->extent.truncate_seq = |
601 | cpu_to_le32(src->extent.truncate_seq); | 601 | cpu_to_le32(src->extent.truncate_seq); |
602 | if (src->op == CEPH_OSD_OP_WRITE) | 602 | if (src->op == CEPH_OSD_OP_WRITE) |
603 | ceph_osdc_msg_data_set(req->r_request, | 603 | ceph_osdc_msg_data_add(req->r_request, |
604 | &src->extent.osd_data); | 604 | &src->extent.osd_data); |
605 | else | 605 | else |
606 | ceph_osdc_msg_data_set(req->r_reply, | 606 | ceph_osdc_msg_data_add(req->r_reply, |
607 | &src->extent.osd_data); | 607 | &src->extent.osd_data); |
608 | break; | 608 | break; |
609 | case CEPH_OSD_OP_CALL: | 609 | case CEPH_OSD_OP_CALL: |
610 | dst->cls.class_len = src->cls.class_len; | 610 | dst->cls.class_len = src->cls.class_len; |
611 | dst->cls.method_len = src->cls.method_len; | 611 | dst->cls.method_len = src->cls.method_len; |
612 | dst->cls.indata_len = cpu_to_le32(src->cls.request_data_len); | 612 | dst->cls.indata_len = cpu_to_le32(src->cls.request_data_len); |
613 | ceph_osdc_msg_data_set(req->r_reply, &src->cls.response_data); | 613 | ceph_osdc_msg_data_add(req->r_reply, &src->cls.response_data); |
614 | ceph_osdc_msg_data_set(req->r_request, &src->cls.request_info); | 614 | ceph_osdc_msg_data_add(req->r_request, &src->cls.request_info); |
615 | BUG_ON(src->cls.request_info.type != | 615 | BUG_ON(src->cls.request_info.type != |
616 | CEPH_OSD_DATA_TYPE_PAGELIST); | 616 | CEPH_OSD_DATA_TYPE_PAGELIST); |
617 | request_data_len = src->cls.request_info.pagelist->length; | 617 | request_data_len = src->cls.request_info.pagelist->length; |