linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why "splice" doesn't splice between two non-pipes?
@ 2014-06-27 16:34 Askar Safin
  2014-06-28  8:38 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Askar Safin @ 2014-06-27 16:34 UTC (permalink / raw)
  To: linux-fsdevel

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);
 }
 
 /*

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-28 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-27 16:34 Why "splice" doesn't splice between two non-pipes? Askar Safin
2014-06-28  8:38 ` NeilBrown
2014-06-28 14:39   ` Askar Safin

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).