Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373383
b: refs/heads/master
c: 643c68a
h: refs/heads/master
i:
  373381: c1ca030
  373379: b65c07d
  373375: 02dbabe
v: v3
  • Loading branch information
Alex Elder authored and Sage Weil committed May 2, 2013
1 parent fe17d7a commit 7a05ba9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c59b4a278f9b7a418ad8af933fd7b341df64393
refs/heads/master: 643c68a4a990612720479078f3450d5b766da9f2
9 changes: 4 additions & 5 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1460,8 +1460,8 @@ static u32 ceph_crc32c_page(u32 crc, struct page *page,
static int write_partial_message_data(struct ceph_connection *con)
{
struct ceph_msg *msg = con->out_msg;
struct ceph_msg_data_cursor *cursor = &msg->data.cursor;
struct ceph_msg_pos *msg_pos = &con->out_msg_pos;
unsigned int data_len = le32_to_cpu(msg->hdr.data_len);
bool do_datacrc = !con->msgr->nocrc;
int ret;

Expand All @@ -1479,7 +1479,7 @@ static int write_partial_message_data(struct ceph_connection *con)
* need to map the page. If we have no pages, they have
* been revoked, so use the zero page.
*/
while (data_len > msg_pos->data_pos) {
while (cursor->resid) {
struct page *page;
size_t page_offset;
size_t length;
Expand All @@ -1489,7 +1489,6 @@ static int write_partial_message_data(struct ceph_connection *con)
&last_piece);
if (do_datacrc && !msg_pos->did_page_crc) {
u32 crc = le32_to_cpu(msg->footer.data_crc);

crc = ceph_crc32c_page(crc, page, page_offset, length);
msg->footer.data_crc = cpu_to_le32(crc);
msg_pos->did_page_crc = true;
Expand Down Expand Up @@ -2158,7 +2157,7 @@ static int read_partial_message_section(struct ceph_connection *con,
static int read_partial_msg_data(struct ceph_connection *con)
{
struct ceph_msg *msg = con->in_msg;
struct ceph_msg_pos *msg_pos = &con->in_msg_pos;
struct ceph_msg_data_cursor *cursor = &msg->data.cursor;
const bool do_datacrc = !con->msgr->nocrc;
unsigned int data_len;
struct page *page;
Expand All @@ -2171,7 +2170,7 @@ static int read_partial_msg_data(struct ceph_connection *con)
return -EIO;

data_len = le32_to_cpu(con->in_hdr.data_len);
while (msg_pos->data_pos < data_len) {
while (cursor->resid) {
page = ceph_msg_data_next(&msg->data, &page_offset, &length,
NULL);
ret = ceph_tcp_recvpage(con->sock, page, page_offset, length);
Expand Down

0 comments on commit 7a05ba9

Please sign in to comment.