From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gu Zheng Subject: Re: question about splice Date: Fri, 26 Jul 2013 15:17:27 +0800 Message-ID: <51F22287.8050204@cn.fujitsu.com> References: <201307261507562231224@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: viro , linux-fsdevel , linux-kernel To: majianpeng Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:26547 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752878Ab3GZHsZ convert rfc822-to-8bit (ORCPT ); Fri, 26 Jul 2013 03:48:25 -0400 In-Reply-To: <201307261507562231224@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Jianpeng, On 07/26/2013 03:08 PM, majianpeng wrote: > Hi all, > I used splice and found a prolem(at least i call). > The demo is: > A:splice(regularfileA--->pipe); > B:splice(pipe--->regularfileB) > Before do B, we modify the data of regA which now in pipe. The data t= o regularfileB willbe change. > If we used the buff > A:read(regA, buff); > B: write(buff, regB); > After A, the contend of regA can't effect the buff. > Review the code of splice,I know the pipe share the pagecache of regA= =2E Right. And also this is the splice's original design intention, using s= hare mmap rather than copy_to_user/copy_from_user in order to achieve zero-copy. Thanks, Gu > Maybe this is not a problem or am i missing something? >=20 > Thanks! > Jianpeng MaN=E5=AB=A5=E5=8F=89=E9=9D=A3=E7=AC=A1y=EE=8C=B7=E6=B0=8Ab=E7= =9E=82=EE=83=91=E5=8D=83v=E8=B1=9D=EF=BF=BD)=E8=97=93{.n=EF=BF=BD+=E5=A3= =8F=EE=9A=8F{=E7=9D=89=E8=B5=99zX=D0=A4=17=E6=B4=9D=E5=A1=84}=EE=9F=BB=E8= =B4=A2=E7=88=96=EF=BF=BD&j:+v=E5=A2=BE=EF=BF=BD=07=E7=8F=A3=E8=B5=99zZ+= =E2=82=AC=EF=BF=BD+zf=EF=BC=82=E7=A9=90=E6=AE=98=EE=9D=84=E5=95=B3=E5=97= =83i=EF=BF=BD=EE=8E=8Dz=EF=BF=BD=1E=E7=95=90=E3=82=A2=EF=BF=BD?=E6=AB=92= =E7=92=80=EF=BF=BD&=EF=BF=BD)=E6=92=B7=1Bf=E6=97=9F^j=E8=B0=A6y=EE=9C=B3= =E5=91=A9@A=E7=8E=9C=E5=9B=A4=7F=EF=BF=BD=0C0=E9=B9=85h=EF=BF=BD=0F=E9=8D= =9Ci=7F -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html