Re: [PATCH] generic_file_sendpage

2005-07-20 Thread Herbert Poetzl
On Fri, Jul 15, 2005 at 01:22:55PM +0200, Jörn Engel wrote: > On Fri, 15 July 2005 04:06:11 -0700, Andrew Morton wrote: > > > + > > > + /* There is no sane reason to use O_DIRECT */ > > > + BUG_ON(file->f_flags & O_DIRECT); > > > > err, this seems like an easy way for people to make the kernel go

Re: [PATCH] generic_file_sendpage

2005-07-20 Thread Jan Blunck
Linus Torvalds wrote: "sendfile()" in general I think has been a mistake. It's too specialized, and the interface has always sucked. Ok, you're right. I will have a look at the pipe buffer stuff. As Andrew pointed out, it actually needs to limit the number of buffers in flight partly because

Re: [PATCH] generic_file_sendpage

2005-07-15 Thread Linus Torvalds
On Fri, 15 Jul 2005, Jan Engelhardt wrote: > > > >This is why I want to get rid of sendfile(). It's a fundamentally broken > >interface. Really. In contrast, the pipe buffers _can_ be used for direct > >socket->file interfaces. > > How will userspace access these pipe buffers? You can fill them

Re: [PATCH] generic_file_sendpage

2005-07-15 Thread Jan Engelhardt
>> >With union mount and cowlink, there are two users already. cp(1) >> >could use it as well, even if the improvement is quite minimal. >> >> FTP PUT could use this too - ... > >No, FTP PUT _cannot_ use it, exactly because sendfile() can't do anything >but file sources (and not even all file so

Re: [PATCH] generic_file_sendpage

2005-07-15 Thread Linus Torvalds
On Fri, 15 Jul 2005, Jan Engelhardt wrote: > > >> I don't know if we want to add this feature, really. It's such a > >> specialised thing. > > > >With union mount and cowlink, there are two users already. cp(1) > >could use it as well, even if the improvement is quite minimal. > > FTP PUT coul

Re: [PATCH] generic_file_sendpage

2005-07-15 Thread Linus Torvalds
On Fri, 15 Jul 2005, Andrew Morton wrote: > > I don't know if we want to add this feature, really. It's such a > specialised thing. It is, in this format, and I agree - I don't want to add it. What I'd really like to see is somebody taking a look at my old "pipe as a zero-copy buffer" patches

Re: [PATCH] generic_file_sendpage

2005-07-15 Thread Jan Engelhardt
>> I don't know if we want to add this feature, really. It's such a >> specialised thing. > >With union mount and cowlink, there are two users already. cp(1) >could use it as well, even if the improvement is quite minimal. FTP PUT could use this too - currently, only FTPGETs can use sendfile bec

Re: [PATCH] generic_file_sendpage (updated patch)

2005-07-15 Thread Jan Blunck
Andrew Morton wrote: > >>+static inline size_t >>+filemap_copy_from_kernel(struct page *page, unsigned long offset, >>+const char *buf, unsigned bytes) >>+{ >>+ char *kaddr; >>+ >>+ kaddr = kmap(page); >>+ memcpy(kaddr + offset, buf, bytes); >>+ kunm

Re: [PATCH] generic_file_sendpage

2005-07-15 Thread Jörn Engel
On Fri, 15 July 2005 04:06:11 -0700, Andrew Morton wrote: > > + > > + /* There is no sane reason to use O_DIRECT */ > > + BUG_ON(file->f_flags & O_DIRECT); > > err, this seems like an easy way for people to make the kernel go BUG. Is there a sane use for O_DIRECT in combination with sendfile(

Re: [PATCH] generic_file_sendpage

2005-07-15 Thread Andrew Morton
Jan Blunck <[EMAIL PROTECTED]> wrote: > > This is a generic sendpage() for regular files. > > +static inline size_t > +filemap_copy_from_kernel(struct page *page, unsigned long offset, > + const char *buf, unsigned bytes) > +{ > + char *kaddr; > + > + kaddr = kmap(pag

[PATCH] generic_file_sendpage

2005-07-15 Thread Jan Blunck
This is a generic sendpage() for regular files. With generic_file_sendpage() it is possible to use sendfile() on file targets, instead of only sending data to sockets. This implementation is basically an extension of Joern's original patch (http://marc.theaimsgroup.com/?l=linux-kernel&m=10945