Re: Why "splice" doesn't splice between two non-pipes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 27 Jun 2014 20:34:42 +0400 Askar Safin <safinaskar@xxxxxxx> 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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux