SUNRPC: Use MSG_SENDPAGE_NOTLAST when calling sendpage()

If we're sending more pages via kernel_sendpage(), then set
MSG_SENDPAGE_NOTLAST.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Trond Myklebust 2015-10-07 13:54:42 -04:00 committed by J. Bruce Fields
parent 0ad95472bf
commit 226453d8cf
2 changed files with 4 additions and 2 deletions

View File

@ -181,7 +181,7 @@ int svc_send_common(struct socket *sock, struct xdr_buf *xdr,
struct page **ppage = xdr->pages; struct page **ppage = xdr->pages;
size_t base = xdr->page_base; size_t base = xdr->page_base;
unsigned int pglen = xdr->page_len; unsigned int pglen = xdr->page_len;
unsigned int flags = MSG_MORE; unsigned int flags = MSG_MORE | MSG_SENDPAGE_NOTLAST;
int slen; int slen;
int len = 0; int len = 0;

View File

@ -360,8 +360,10 @@ static int xs_send_pagedata(struct socket *sock, struct xdr_buf *xdr, unsigned i
int flags = XS_SENDMSG_FLAGS; int flags = XS_SENDMSG_FLAGS;
remainder -= len; remainder -= len;
if (remainder != 0 || more) if (more)
flags |= MSG_MORE; flags |= MSG_MORE;
if (remainder != 0)
flags |= MSG_SENDPAGE_NOTLAST | MSG_MORE;
err = do_sendpage(sock, *ppage, base, len, flags); err = do_sendpage(sock, *ppage, base, len, flags);
if (remainder == 0 || err != len) if (remainder == 0 || err != len)
break; break;