Re: [PATCH 1/3] copyfile: generic_sendpage

From: Gunnar Ritter
Date: Tue Sep 07 2004 - 07:05:00 EST


JÃrn Engel <joern@xxxxxxxxxxxxxxxxxxxx> 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.

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