From 01ced6c651db7694ecb73fbaa145d319f0b1e15d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 1 Jun 2010 16:59:57 -0700 Subject: [PATCH] copy_stream: always try to move pages instead of copying For most case in the forseeable future it's a no-op, but since FUSE will support it in 2.6.35, some folks will be able to use it again. --- lib/io/splice.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/io/splice.rb b/lib/io/splice.rb index d7065e4..61832f8 100644 --- a/lib/io/splice.rb +++ b/lib/io/splice.rb @@ -37,7 +37,7 @@ class IO if len while len > 0 nr = len > PIPE_CAPA ? PIPE_CAPA : len - nr = IO.splice(src, nil, dst, nil, nr, 0) + nr = IO.splice(src, nil, dst, nil, nr, F_MOVE) if nr == 0 raise EOFError, "unexpected EOF with #{len} bytes left" end @@ -46,7 +46,7 @@ class IO else rv = 0 begin - nr = IO.splice(src, nil, dst, nil, PIPE_CAPA, 0) + nr = IO.splice(src, nil, dst, nil, PIPE_CAPA, F_MOVE) rv += nr rescue EOFError break @@ -69,10 +69,10 @@ class IO else rv = 0 begin - nr = IO.splice(src, nil, w, nil, PIPE_CAPA, 0) + nr = IO.splice(src, nil, w, nil, PIPE_CAPA, F_MOVE) rv += nr begin - nr -= IO.splice(r, nil, dst, nil, nr, 0) + nr -= IO.splice(r, nil, dst, nil, nr, F_MOVE) end while nr > 0 rescue EOFError break -- 2.11.4.GIT