Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296523
b: refs/heads/master
c: 3173913
h: refs/heads/master
i:
  296521: f1272ee
  296519: 16c4c4f
v: v3
  • Loading branch information
Alex Elder committed Mar 22, 2012
1 parent 819f166 commit b3dfd15
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 37675b0f42a8f7699c3602350d1c3b2a1698a3d3
refs/heads/master: 31739139f3ed7be802dd9019ec8d8cc910e3d241
20 changes: 15 additions & 5 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,19 @@ static int ceph_tcp_sendmsg(struct socket *sock, struct kvec *iov,
return r;
}

static int ceph_tcp_sendpage(struct socket *sock, struct page *page,
int offset, size_t size, int more)
{
int flags = MSG_DONTWAIT | MSG_NOSIGNAL | (more ? MSG_MORE : MSG_EOR);
int ret;

ret = kernel_sendpage(sock, page, offset, size, flags);
if (ret == -EAGAIN)
ret = 0;

return ret;
}


/*
* Shutdown/close the socket for the given connection.
Expand Down Expand Up @@ -944,12 +957,9 @@ static int write_partial_skip(struct ceph_connection *con)
int ret;

while (con->out_skip > 0) {
struct kvec iov = {
.iov_base = zero_page_address,
.iov_len = min(con->out_skip, (int)PAGE_CACHE_SIZE)
};
size_t size = min(con->out_skip, (int) PAGE_CACHE_SIZE);

ret = ceph_tcp_sendmsg(con->sock, &iov, 1, iov.iov_len, 1);
ret = ceph_tcp_sendpage(con->sock, zero_page, 0, size, 1);
if (ret <= 0)
goto out;
con->out_skip -= ret;
Expand Down

0 comments on commit b3dfd15

Please sign in to comment.