Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296526
b: refs/heads/master
c: 9bd1966
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder committed Mar 22, 2012
1 parent f21e3fb commit cb00ed2
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 0cdf9e60189a87356a865a96dbafc2240af5c91d
refs/heads/master: 9bd1966344bf975b5ce65e80fd6bacc41b4325a8
11 changes: 6 additions & 5 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ static int write_partial_msg_pages(struct ceph_connection *con)
struct page *page = NULL;
void *kaddr = NULL;
int max_write = PAGE_SIZE;
int page_shift = 0;
int bio_offset = 0;

total_max_write = data_len - trail_len -
con->out_msg_pos.data_pos;
Expand Down Expand Up @@ -874,9 +874,9 @@ static int write_partial_msg_pages(struct ceph_connection *con)

bv = bio_iovec_idx(msg->bio_iter, msg->bio_seg);
page = bv->bv_page;
page_shift = bv->bv_offset;
bio_offset = bv->bv_offset;
if (do_datacrc)
kaddr = kmap(page) + page_shift;
kaddr = kmap(page);
max_write = bv->bv_len;
#endif
} else {
Expand All @@ -888,17 +888,18 @@ static int write_partial_msg_pages(struct ceph_connection *con)
total_max_write);

if (do_datacrc && !con->out_msg_pos.did_page_crc) {
void *base;
u32 crc;
void *base = kaddr + con->out_msg_pos.page_pos;
u32 tmpcrc = le32_to_cpu(con->out_msg->footer.data_crc);

BUG_ON(kaddr == NULL);
base = kaddr + con->out_msg_pos.page_pos + bio_offset;
crc = crc32c(tmpcrc, base, len);
con->out_msg->footer.data_crc = cpu_to_le32(crc);
con->out_msg_pos.did_page_crc = true;
}
ret = ceph_tcp_sendpage(con->sock, page,
con->out_msg_pos.page_pos + page_shift,
con->out_msg_pos.page_pos + bio_offset,
len, 1);

if (do_datacrc)
Expand Down

0 comments on commit cb00ed2

Please sign in to comment.