• Steve French's avatar
    CIFS: SMB2/SMB3 Copy offload support (refcopy) phase 1 · 41c1358e
    Steve French authored
    This first patch adds the ability for us to do a server side copy
    (ie fast copy offloaded to the server to perform, aka refcopy)
    
    "cp --reflink"
    
    of one file to another located on the same server.  This
    is much faster than traditional copy (which requires
    reading and writing over the network and extra
    memcpys).
    
    This first version is not going to be copy
    files larger than about 1MB (to Samba) until I add
    support for multiple chunks and for autoconfiguring
    the chunksize.
    
    It includes:
    1) processing of the ioctl
    2) marshalling and sending the SMB2/SMB3 fsctl over the network
    3) simple parsing of the response
    
    It does not include yet (these will be in followon patches to come soon):
    1) support for multiple chunks
    2) support for autoconfiguring and remembering the chunksize
    3) Support for the older style copychunk which Samba 4.1 server supports
    (because this requires write permission on the target file, which
    cp does not give you, apparently per-posix).  This may require
    a distinct tool (other than cp) and other ioctl to implement.
    Reviewed-by: default avatarPavel Shilovsky <piastry@etersoft.ru>
    Signed-off-by: default avatarSteve French <smfrench@gmail.com>
    41c1358e
smb2ops.c 39.2 KB