lkml.org 
[lkml]   [2004]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] copyfile: generic_sendpage
On Tue, 7 September 2004 14:03:19 +0200, Gunnar Ritter wrote:
> Jörn Engel <joern@wohnheim.fh-wedel.de> wrote:
>
> Also it might perhaps make sense to add the kernel programmer's
> equivalent of
>
> > + while (count) {
> > + size_t n = min(count, (size_t)4096);
> > + ret = in_file->f_op->sendfile(in_file, ppos, n, actor,out_file);
> > + if (ret < 0) {
> > + if (done)
> > + return done;
> > + else
> > + return ret;
> > + }
> > +
> > + done += ret;
> > + count -= ret;
> > +
> > + if ((ret == 0) || signal_pending(current))
> {
> if (count == 0) {
> done = -1;
> errno = EINTR;
> }
> > + break;
> }
> > + cond_resched();
> > + }
> > + return done;
> > +}
>
> here, for write-like semantics, too.

Is that really needed? If in_file->f_op->sendfile() returns some
error, it's already handled above. If it returns 0, done remains 0
and we return 0, indicating EOF. And the check for pending signals
happens after handling the first chunk, so -EINTR shouldn't be
necessary.

But I could be stupid and miss something.

Jörn

--
Public Domain - Free as in Beer
General Public - Free as in Speech
BSD License - Free as in Enterprise
Shared Source - Free as in "Work will make you..."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.053 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site