Re: sendfile(2) behaviour has changed ?

From: David S. Miller (
Date: Wed Oct 16 2002 - 04:59:35 EST

   From: Matti Aarnio <>
   Date: Wed, 16 Oct 2002 12:10:46 +0300

   On Wed, Oct 16, 2002 at 10:49:08AM +0200, Zilvinas Valinskas wrote:
> Is this expected behaviour ? that sendfile(2) on 2.5.4x linux kernel requires
> socket as an output fd paramter ?
     It has only been intended for output to a TCP stream socket.

To be honest, I'm not so sure about this.

For example, I definitely see us supporting this in the
opposite direction when commodity 10gbit hits the market.

Initially I thought "sys_receivefile()" but it makes no
sense when we have a system call that is perfectly capable
of describing the tcp_socket --> page_cache operation.

And I don't think the vfs copy operation using sendfile
is such a bad thing either. It definitely opens the door
for some interesting optimizations. For example, if the
source page is not mapped by a process it could be possible
to just unhash it, mark it dirty, then hash it into the
destination file. Exactly 2 I/O operations and the cpu
doesn't touch the data at all.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Oct 23 2002 - 22:00:27 EST