Re: [PATCH] splice support #2

From: Jeff Garzik
Date: Thu Mar 30 2006 - 15:45:19 EST



Let me pull back from the details a bit, to note a code pattern I'm beginning to see:

if (src_fd is a file &&
dest_fd is a socket)
sendfile()
else
hand code fd->fd data move

with splice this becomes

if (special case fd combination #1)
sendfile()
else (special case fd combination #2)
splice()
else
hand code fd->fd data move

Creating a syscall for each fd->fd data move case seems wasteful. I would rather that the kernel Does The Right Thing so the app doesn't have to support all these special cases. Handling the implicit buffer case in the kernel, when needed, means that the app is future-proofed: when another fd->fd optimization is implemented, the app automatically takes advantage of it.

Jeff


-
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/