From: Steve French <smfltc@us.ibm.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: "Jörn Engel" <joern@wohnheim.fh-wedel.de>,
"Andrew Morton" <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] copyfile: copyfile
Date: 08 Sep 2004 12:09:57 -0500 [thread overview]
Message-ID: <1094663397.22419.41.camel@stevef95.austin.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0409070656150.2299@ppc970.osdl.org>
On Tue, 2004-09-07 at 09:06, Linus Torvalds wrote:
> For cifs to be able to use it, the "copyfile()" interface needs to
> basically just be a pathname operation (ie a "dir->i_op->copy()"), not a
> "struct file" operation. It's more like the VFS "->rename()" or "->link"
> operations, in other words. And it should return -EXDEV the same way
> rename returns EXDEV if the files aren't on the same filesystem.
>
> I think you should be able to copy the "sys_link()" code for almost all of
> the top-level stuff. The only real difference being
>
> - error = dir->i_op->link(old_dentry, dir, new_dentry);
> + error = dir->i_op->copy(old_dentry, dir, new_dentry);
>
> answer may be that filesystems that don't support this as a "native op"
> and can't do it quickly should just return an error, and then users can
> copy their multi-gigabyte files by hand, like they used to.
Yes - the CIFS protocol operation for copy requires syntax similar to
the link or rename examples. The protocol operation for CIFS copy
requires:
1) a source filename (and a tree identifier - which identifies which
server export ie share the path is relative to)
2) a target filename (and target tree identifier)
3) source and target on the same server - The client filesystem can
enforce the last requirement that the source and target be on the same
server (although some servers also will reject it if the source and
target are not on the same filesystem on the same server) by simply
returning EXDEV to the VFS if the source and target are on different
servers.
Using a similar i_op to the link i_op contains sufficient information
for me to turn on the CIFSSMBCopy function in the fs/cifs code.
There are a couple of obvious copy options which probably could be
mapped onto the cifs network protocol but are not required.
4)Something like a "FAIL_IF_EXISTS" flag (do not copy the file if the
target file exists)
5) a "copy subtree" flag indicating whether the copy is for the
file/directory or for the whole subtree.
As in link, returning an error when the filesystem can not perform the
operation should be expected by the layers above.
Defining a handle (file struct) based copy operation is not as useful.
I believe that as a result of the copy request that most CIFS servers
typically would copy file attributes (such as in the case of cifs
servers the dos attributes) and extended attributes (xattrs, and NTFS
alternate data streams if the server supports them) but ACLs for the
existing file would not be copied to the new file. That seems like
reasonable default common sense semantics. Allowing the client to
interrupt a network file copy that has been submitted to the server will
not always be possible, but it is at least easier to preserve atomicity
in the case of a single copy operation going over the network than it
would be if the copy is broken apart by the client and as individual
open/read/close open/write/close
next prev parent reply other threads:[~2004-09-08 17:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-07 12:09 [PATCH 1/4] copyfile: generic_sendpage Jörn Engel
2004-09-07 12:11 ` [PATCH 2/4] copyfile: sendfile Jörn Engel
2004-09-07 12:12 ` [PATCH 3/4] copyfile: sendfile_loop Jörn Engel
2004-09-07 12:15 ` [PATCH 4/4] copyfile: copyfile Jörn Engel
2004-09-07 14:06 ` Linus Torvalds
2004-09-07 14:19 ` Anton Altaparmakov
2004-09-07 14:51 ` Jörn Engel
2004-09-07 14:59 ` Linus Torvalds
2004-09-07 15:21 ` Jörn Engel
2004-09-07 15:28 ` Linus Torvalds
2004-09-09 15:04 ` Herbert Poetzl
2004-09-08 17:09 ` Steve French [this message]
2004-09-07 15:32 ` [PATCH 1/4] copyfile: generic_sendpage David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1094663397.22419.41.camel@stevef95.austin.ibm.com \
--to=smfltc@us.ibm.com \
--cc=akpm@osdl.org \
--cc=joern@wohnheim.fh-wedel.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®