Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298776
b: refs/heads/master
c: 35f9c09
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Apr 5, 2012
1 parent 2008584 commit 644fbaf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 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: 78d50217baf36093ab320f95bae0d6452daec85c
refs/heads/master: 35f9c09fe9c72eb8ca2b8e89a593e1c151f28fc2
5 changes: 4 additions & 1 deletion trunk/fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/uio.h>
#include <linux/security.h>
#include <linux/gfp.h>
#include <linux/socket.h>

/*
* Attempt to steal a page from a pipe buffer. This should perhaps go into
Expand Down Expand Up @@ -690,7 +691,9 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
if (!likely(file->f_op && file->f_op->sendpage))
return -EINVAL;

more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len;
more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
if (sd->len < sd->total_len)
more |= MSG_SENDPAGE_NOTLAST;
return file->f_op->sendpage(file, buf->page, buf->offset,
sd->len, &pos, more);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ struct ucred {
#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
#define MSG_MORE 0x8000 /* Sender will send more */
#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */

#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
#define MSG_EOF MSG_FIN

#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
}

out:
if (copied && !(flags & MSG_MORE))
if (copied && !(flags & MSG_SENDPAGE_NOTLAST))
tcp_push(sk, flags, mss_now, tp->nonagle);
return copied;

Expand Down
6 changes: 3 additions & 3 deletions trunk/net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,9 @@ static ssize_t sock_sendpage(struct file *file, struct page *page,

sock = file->private_data;

flags = !(file->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT;
if (more)
flags |= MSG_MORE;
flags = (file->f_flags & O_NONBLOCK) ? MSG_DONTWAIT : 0;
/* more is a combination of MSG_MORE and MSG_SENDPAGE_NOTLAST */
flags |= more;

return kernel_sendpage(sock, page, offset, size, flags);
}
Expand Down

0 comments on commit 644fbaf

Please sign in to comment.