From: Bodo Eggert <harvested.in.lkml@7eggert.dyndns.org>
To: Pavel Machek <pavel@suse.cz>, Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@osdl.org>, Jeff Garzik <jeff@garzik.org>,
Jens Axboe <axboe@suse.de>,
linux-kernel@vger.kernel.org, akpm@osdl.org,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] splice support #2
Date: Mon, 03 Apr 2006 14:39:16 +0200 [thread overview]
Message-ID: <E1FQOLJ-0002ig-U5@be1.lrz> (raw)
In-Reply-To: <5XjoS-8t9-11@gated-at.bofh.it>
Pavel Machek <pavel@suse.cz> wrote:
>> We should extend the userspace API so that it is prepared to receive
>> 'excess data' via a separate 'flush excess data to' file descriptor:
>>
>> sys_splice(fd_in, fd_out, fd_flush, size,
>> max_flush_size, *bytes_flushed)
>
> I still see problems with error handling here. You get -EIO to
> userspace. How do you know if it is error reading fd_in, or error
> writing fd_out?
ACK.
Possibly you'll get an error reading from fd_in while also getting an error
flushing the data to fd_out, and an additional error while trying to rescue
the data on fd_flush.
Additionally you'll want to know the amount of transfered bytes even in case
of an error.
struct splice_fds {
int in_fd, int in_errno,
int out_fd, int out_errno,
/* used on transfer error to rescue the to-be-flushed data: */
int err_fd, int err_errno,
/* err_fd == -1 -> don't use */
int err_size
/* in: max. size, out: used size, unchanged if no error */
}
int sys_splice(struct splice_fds *fds, size, flags)
/* returns transfered_bytes even in case of an error */
Possible flags:
- Streaming, copied data won't be used too soon.
- Unconditionally use err_fd as a buffer, e.g. because we know that seeking
from in_fd to out_fd is slow while err_fd is mapped memory.
- fail if err_fd == -1 and an error could cause data loss (out_fd must have
a buffer like a pipe)
Dangers:
splice(in_fd = /dev/zero, out_fd = /dev/null, ...)
...
</brainstorming>
--
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.
next parent reply other threads:[~2006-04-03 12:40 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5W2gv-Tp-19@gated-at.bofh.it>
[not found] ` <5W48C-3KW-17@gated-at.bofh.it>
[not found] ` <5W48D-3KW-21@gated-at.bofh.it>
[not found] ` <5W8OT-2ms-17@gated-at.bofh.it>
[not found] ` <5WcfS-7x9-23@gated-at.bofh.it>
[not found] ` <5WcIT-8nr-13@gated-at.bofh.it>
[not found] ` <5Wm5I-53z-7@gated-at.bofh.it>
[not found] ` <5XjoS-8t9-11@gated-at.bofh.it>
2006-04-03 12:39 ` Bodo Eggert [this message]
2006-03-31 6:06 tridge
2006-03-31 6:59 ` Antonio Vargas
2006-03-31 7:37 ` tridge
2006-03-31 9:57 ` Jens Axboe
2006-03-31 19:11 ` Linus Torvalds
2006-03-31 19:40 ` Jens Axboe
2006-04-04 17:16 ` Andy Lutomirski
2006-04-04 17:34 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2006-03-31 0:03 linux
2006-03-30 10:06 Jens Axboe
2006-03-30 10:16 ` Andrew Morton
2006-03-30 10:24 ` Jens Axboe
2006-03-30 11:16 ` Andrew Morton
2006-03-30 11:55 ` Jens Axboe
2006-03-30 12:30 ` Jens Axboe
2006-03-30 12:30 ` Jens Axboe
2006-03-30 19:19 ` Andrew Morton
2006-03-30 12:00 ` Ingo Molnar
2006-03-30 12:05 ` Jens Axboe
2006-03-30 12:10 ` Ingo Molnar
2006-03-30 12:16 ` Jens Axboe
2006-03-30 12:38 ` Ingo Molnar
2006-03-30 12:42 ` Jens Axboe
2006-03-30 12:42 ` Ingo Molnar
2006-03-30 13:02 ` Jens Axboe
2006-03-30 14:20 ` Christoph Hellwig
2006-03-30 17:02 ` Linus Torvalds
2006-03-30 17:17 ` Linus Torvalds
2006-03-31 20:38 ` Hua Zhong
2006-03-31 20:49 ` Linus Torvalds
2006-03-30 20:48 ` Jeff Garzik
2006-03-30 21:16 ` Linus Torvalds
2006-03-31 0:59 ` Nick Piggin
2006-03-31 2:43 ` Andrew Morton
2006-03-31 2:51 ` Andrew Morton
2006-03-31 3:20 ` Nick Piggin
2006-03-31 6:35 ` Christoph Hellwig
2006-03-31 7:09 ` Ingo Molnar
2006-04-02 22:33 ` Pavel Machek
2006-03-31 12:46 ` Bernd Petrovitsch
2006-03-31 9:56 ` Jens Axboe
2006-03-31 12:18 ` Ingo Molnar
2006-03-31 12:23 ` Jens Axboe
2006-03-31 12:26 ` Jens Axboe
2006-03-31 12:47 ` Ingo Molnar
2006-03-31 18:18 ` Jens Axboe
2006-03-31 12:27 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1FQOLJ-0002ig-U5@be1.lrz \
--to=harvested.in.lkml@7eggert.dyndns.org \
--cc=7eggert@gmx.de \
--cc=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=hch@infradead.org \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pavel@suse.cz \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome