Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Feb 2001 08:53:43 +0600 (ALMT)
From:      Boris Popov <bp@butya.kz>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: Darwin VFSisms - VOP_COPYFILE()
Message-ID:  <Pine.BSF.4.21.0102120835250.55784-100000@lion.butya.kz>
In-Reply-To: <Pine.NEB.3.96L.1010211114208.64780G-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 11 Feb 2001, Robert Watson wrote:

> vop_copyfile {
>     IN WILLRELE struct vnode *fvp;
>     IN WILLRELE struct vnode *tdvp;
>     IN WILLRELE struct vnode *tvp;
>     IN struct componentname *tcnp;
>     IN int mode;
>     IN int flags;
> };
> 
> network twice.  My understanding is that Apple introduced this call for
> AppleShare, which does support the remote copy semantic.  I don't know,
> but would guess that smb/cifs offers a similar RPC.  Presumably the VOP

	Yes, SMB protocol have similar RPC and NCP (NetWare Core Protocol
have it too).

> would have the opportunity to return EXDEV, as rename() does, to indicate
> that the copy cannot be done magically, and that the userland utility
> should fall back on doing it the old-fashioned way.

	Correct.

> They provide a couple of flags for the flags field:
> 
> sys/fcntl.h:#define CPF_OVERWRITE 1
> sys/fcntl.h:#define CPF_IGNORE_MODE 2
> sys/fcntl.h:#define CPF_MASK (CPF_OVERWRITE|CPF_IGNORE_MODE)

	'IGNORE_MODE' sounds a bit unclear.

> I'm not sure if their construction of the VOP is right, and we should
> discuss the semantics with regards to preserving various types of file
> attributes (copyfile() might do the preservation a lot better than a
> userland utility, for example), locking, etc.  In particular, I'm not sure
> I like the (mode) argument, which presumably specifies the mode of the new
> file.  I'd like copyfile() to preserve all existing protection attributes
> (and other attributes) of the source file that the underlying file system
> knows about.  This would make it scale more easily into alternative file
> system types where the protection of file extended attributes differ.

	Well, I think behavior of VOP_COPYFILE should very well
documented, because any misbehavior may lead to significant data loss.

	The major problem is that copyfile-like RPCs are very OS/protocol
specific. For example, NCP allows user to copy any number of bytes from
specified offset in the source file to specified offset in the destination
file. SMB protocol doesn't support any of these parameters. But SMB
protocol offers ability to copy multiple files (using wildcards) and even
a MOVE RPC which deletes file(s) after copy.

	I'm unsure, but some sort of 'capabilities' bits would be useful.

--
Boris Popov
http://www.butya.kz/~bp/



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0102120835250.55784-100000>