mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
libceph: move init of bio_iter
(cherry picked from commit 572c588eda
)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ec53635e8f
commit
67e5007aca
1 changed files with 4 additions and 5 deletions
|
@ -603,6 +603,10 @@ static void prepare_write_message_data(struct ceph_connection *con)
|
||||||
con->out_msg_pos.page_pos = msg->page_alignment;
|
con->out_msg_pos.page_pos = msg->page_alignment;
|
||||||
else
|
else
|
||||||
con->out_msg_pos.page_pos = 0;
|
con->out_msg_pos.page_pos = 0;
|
||||||
|
#ifdef CONFIG_BLOCK
|
||||||
|
if (msg->bio && !msg->bio_iter)
|
||||||
|
init_bio_iter(msg->bio, &msg->bio_iter, &msg->bio_seg);
|
||||||
|
#endif
|
||||||
con->out_msg_pos.data_pos = 0;
|
con->out_msg_pos.data_pos = 0;
|
||||||
con->out_msg_pos.did_page_crc = false;
|
con->out_msg_pos.did_page_crc = false;
|
||||||
con->out_more = 1; /* data + footer will follow */
|
con->out_more = 1; /* data + footer will follow */
|
||||||
|
@ -942,11 +946,6 @@ static int write_partial_msg_pages(struct ceph_connection *con)
|
||||||
con, msg, con->out_msg_pos.page, msg->nr_pages,
|
con, msg, con->out_msg_pos.page, msg->nr_pages,
|
||||||
con->out_msg_pos.page_pos);
|
con->out_msg_pos.page_pos);
|
||||||
|
|
||||||
#ifdef CONFIG_BLOCK
|
|
||||||
if (msg->bio && !msg->bio_iter)
|
|
||||||
init_bio_iter(msg->bio, &msg->bio_iter, &msg->bio_seg);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (data_len > con->out_msg_pos.data_pos) {
|
while (data_len > con->out_msg_pos.data_pos) {
|
||||||
struct page *page = NULL;
|
struct page *page = NULL;
|
||||||
int max_write = PAGE_SIZE;
|
int max_write = PAGE_SIZE;
|
||||||
|
|
Loading…
Reference in a new issue