From: NeilBrown <neilb@suse.de>
To: Askar Safin <safinaskar@mail.ru>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Why "splice" doesn't splice between two non-pipes?
Date: Sat, 28 Jun 2014 18:38:48 +1000 [thread overview]
Message-ID: <20140628183848.735f58c4@notabene.brown> (raw)
In-Reply-To: <1403886882.636943870@f261.i.mail.ru>
[-- Attachment #1: Type: text/plain, Size: 932 bytes --]
On Fri, 27 Jun 2014 20:34:42 +0400 Askar Safin <safinaskar@mail.ru> wrote:
> Why "splice" doesn't splice between two non-pipes? I think such splice would be very useful (not only file-to-socket). For example, for dd, cp, cp -r. Also, it seems, the kernel already supports splice between non-pipes (do_splice_direct function), this function is just not available to userspace. (The patch is just an idea, not tested. I don't know how to actually add this feature.)
>
> ==
> Askar Safin
>
> diff --git a/fs/splice.c b/fs/splice.c
> index d37431d..ffb95db 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -1394,7 +1394,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
> return ret;
> }
>
> - return -EINVAL;
> + return do_splice_direct(in, off_in, out, off_out, len, flags);
> }
>
> /*
Consider using "sendfile" instead of "splice".
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2014-06-28 8:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-27 16:34 Why "splice" doesn't splice between two non-pipes? Askar Safin
2014-06-28 8:38 ` NeilBrown [this message]
2014-06-28 14:39 ` Askar Safin
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=20140628183848.735f58c4@notabene.brown \
--to=neilb@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=safinaskar@mail.ru \
/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;
as well as URLs for NNTP newsgroup(s).