aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-06-11 15:57:13 -0400
committerSage Weil <sage@inktank.com>2012-07-06 00:14:16 -0400
commit572c588edadaa3da3992bd8a0fed830bbcc861f8 (patch)
tree3de334c5d18565a3451bfd991f9ab54c2187dca2 /net/ceph
parentdf6ad1f97342ebc4270128222e896541405eecdb (diff)
libceph: move init of bio_iter
If a message has a non-null bio pointer, its bio_iter field is initialized in write_partial_msg_pages() if this has not been done already. This is really a one-time setup operation for sending a message's (bio) data, so move that initialization code into prepare_write_message_data() which serves that purpose. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 7b5ff4545bf3..fedad914b238 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -603,6 +603,10 @@ static void prepare_write_message_data(struct ceph_connection *con)
603 con->out_msg_pos.page_pos = msg->page_alignment; 603 con->out_msg_pos.page_pos = msg->page_alignment;
604 else 604 else
605 con->out_msg_pos.page_pos = 0; 605 con->out_msg_pos.page_pos = 0;
606#ifdef CONFIG_BLOCK
607 if (msg->bio && !msg->bio_iter)
608 init_bio_iter(msg->bio, &msg->bio_iter, &msg->bio_seg);
609#endif
606 con->out_msg_pos.data_pos = 0; 610 con->out_msg_pos.data_pos = 0;
607 con->out_msg_pos.did_page_crc = false; 611 con->out_msg_pos.did_page_crc = false;
608 con->out_more = 1; /* data + footer will follow */ 612 con->out_more = 1; /* data + footer will follow */
@@ -942,11 +946,6 @@ static int write_partial_msg_pages(struct ceph_connection *con)
942 con, msg, con->out_msg_pos.page, msg->nr_pages, 946 con, msg, con->out_msg_pos.page, msg->nr_pages,
943 con->out_msg_pos.page_pos); 947 con->out_msg_pos.page_pos);
944 948
945#ifdef CONFIG_BLOCK
946 if (msg->bio && !msg->bio_iter)
947 init_bio_iter(msg->bio, &msg->bio_iter, &msg->bio_seg);
948#endif
949
950 while (data_len > con->out_msg_pos.data_pos) { 949 while (data_len > con->out_msg_pos.data_pos) {
951 struct page *page = NULL; 950 struct page *page = NULL;
952 int max_write = PAGE_SIZE; 951 int max_write = PAGE_SIZE;