Re: [PATCH] splice support #2

From: Ingo Molnar
Date: Fri Mar 31 2006 - 07:27:00 EST



* Linus Torvalds <torvalds@xxxxxxxx> wrote:

> The reason it goes through a pipe is two-fold:
>
> - the pipe _is_ the buffer. The reason sendfile() sucks is that sendfile
> cannot work with <n> different buffer representations. sendfile() only
> works with _one_ buffer representation, namely the "page cache of the
> file".

The main problem of sendfile() is that it exposes an incoming-fd
'offset', which pretty much hardcodes the assumption that the incoming
file is a pagecache-backed object. I believe the flush_fd solution to
sys_splice() would solve that range of problems, and thus slice could be
used for offset-less file objects too.

all the remaining problems of sendfile() just derive from this basic
pagecache assumption that is hardcoded in the ABI. Once this one is
overcome (and i believe fd_flush overcomes it), there's no reason why we
couldnt implement the complete range of sys_splice() transfers.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/