Re: Gvfs and Server-side SMB copy



On Fri, 4 Nov 2016 14:00:06 -0700, Jeremy Allison <jra samba org>
wrote :

On Fri, Nov 04, 2016 at 09:00:21PM +0100, Saint Germain wrote:
On Fri, 4 Nov 2016 11:55:08 -0700, Jeremy Allison <jra samba org>
wrote :

However the copy doesn't seem to be done server-side. And especially
the copy doesn't seem to be done instantaneously (like what we
should expect from a copy with BTRFS reflink).

Perhaps I am misunderstanding something ?

I thought that Gvfs would use my smbclient (v4.4.6) and
automatically send the FSCTL_SRV_COPYCHUNK which would be
interpreted as BTRFS_IOC_CLONE_RANGE by the samba server (v4.2.10).

Connection manually through smbclient and issueing 'scopy'
instructions works (instantaneous copy) so the problem doesn't seem
to be on the server.

You are misunderstanding how gvfs works. It doesn't invoke smbclient,
but uses the libsmbclient library. This is a separate code base from
smbclient.

Both smbclient and libsmbclient call into an underlying library
whose ABI we don't expose externally to Samba, called the cli_XXX
functions.

The internal interface - cli_splice() works and is called directly
from smbclient via the 'scopy' command. That's why it works from
smbclient.

gvfs uses the libsmbclient interface, in which cli_splice is
exposed as the SMBC_splice_ctx() call. gvfs doesn't currently
call that interface from the gvfs_copy command, it needs to be
updated to do so. That's what we're planning to do.

Thanks for the explanation, indeed I misunderstood.
So any software using libsmbclient should call SMBC_splice_ctx in order
to trigger the server-side copy ?

Which available software is currently calling this SMBC_splice_ctx ?
Is it also valid for Windows and Mac platform ?
I think that I have read somewhere that Windows and Mac could trigger
this server-side copy, but I am not sure.

Thanks again !


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