Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296520
b: refs/heads/master
c: f42299e
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder committed Mar 22, 2012
1 parent 16c4c4f commit 999d7bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 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: fe3ad593e2c34457ffa6233014ab19f4d36f85f2
refs/heads/master: f42299e6c3883c69c14079b8c88fe33815b2dcc3
23 changes: 12 additions & 11 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,17 +747,18 @@ static int write_partial_kvec(struct ceph_connection *con)
con->out_kvec_bytes -= ret;
if (con->out_kvec_bytes == 0)
break; /* done */
while (ret > 0) {
if (ret >= con->out_kvec_cur->iov_len) {
ret -= con->out_kvec_cur->iov_len;
con->out_kvec_cur++;
con->out_kvec_left--;
} else {
con->out_kvec_cur->iov_len -= ret;
con->out_kvec_cur->iov_base += ret;
ret = 0;
break;
}

/* account for full iov entries consumed */
while (ret >= con->out_kvec_cur->iov_len) {
BUG_ON(!con->out_kvec_left);
ret -= con->out_kvec_cur->iov_len;
con->out_kvec_cur++;
con->out_kvec_left--;
}
/* and for a partially-consumed entry */
if (ret) {
con->out_kvec_cur->iov_len -= ret;
con->out_kvec_cur->iov_base += ret;
}
}
con->out_kvec_left = 0;
Expand Down

0 comments on commit 999d7bc

Please sign in to comment.