Re: [PATCH] sendfile removal



On Thu, May 31 2007, Eric Dumazet wrote:
On Thu, 31 May 2007 12:33:16 +0200
Jens Axboe <jens.axboe@xxxxxxxxxx> wrote:

Hi,

This patch removes the ->sendfile() hook from the file_operations
structure, and replaces the sys_sendfile() mechanism to be based on
->splice_read() instead. There should be no functional changes.


- retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file);
+ fl = 0;
+ if (in_file->f_flags & O_NONBLOCK)
+ fl = SPLICE_F_NONBLOCK;
+
+ retval = do_splice_direct(in_file, ppos, out_file, count, fl);

I like this, but are you sure it wont break user land ?

Some applications might react badly if sendfile() returns EAGAIN ?

Yeah, I didn't actually intend for that to sneak in. I'd think that
userspace should handle it if they opened the file O_NONBLOCK (or used
fcntl()), but it's a change in behaviour none the less and probably not
a good idea.

Encourage those people to use splice() instead :-)

--
Jens Axboe

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



Relevant Pages

  • Re: [PATCH] sendfile removal
    ... Jens Axboe wrote: ... This patch removes the ->sendfilehook from the file_operations ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
    (Linux-Kernel)
  • Re: [PATCH] sendfile removal
    ... On Thu, May 31 2007, Jens Axboe wrote: ... This patch removes the ->sendfilehook from the file_operations ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: CFQ IO scheduler patch series - AIM7 DBase results on a 16-way IA64
    ... Jens Axboe wrote: ... It is only a single set of runs, on a single platform, but it is something to keep an eye on as the regression showed itself across the complete run. ... can you repeat that same run with this patch applied? ... which could account for increased system ...
    (Linux-Kernel)
  • Re: [PATCH][RFC] fast file mapping for loop
    ... On Tue, Jan 15 2008, Jens Axboe wrote: ... Here is a modified version of Jens' patch. ... having a hole. ... Change loop to use fast mapping only when the new address_space op is ...
    (Linux-Kernel)
  • Re: [PATCH] splice: fix problem with sys_tee and SPLICE_F_NONBLOCK
    ... Am Dienstag, den 19.02.2008, 22:25 +0100 schrieb Jens Axboe: ... my patch description was not correct. ... - return -EAGAIN if there are no data in the pipe, ... if (!ret) { ...
    (Linux-Kernel)