diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-06-28 06:11:16 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-07-23 10:32:51 -0400 |
commit | 9e8fb38e7d7a00e5f63bbb331f0ea4c02286d5e6 (patch) | |
tree | 239ba68a93cb3908b1c1269415632ab18c13f47d /fs | |
parent | ed80fcfac2565fa866d93ba14f0e75de17a8223e (diff) |
fs/9p: add 9P2000.L renameat operation
renameat - change name of file or directory
size[4] Trenameat tag[2] olddirfid[4] oldname[s] newdirfid[4] newname[s]
size[4] Rrenameat tag[2]
older Trename have the below request format
size[4] Trename tag[2] fid[4] newdirfid[4] name[s]
The rename message is used to change the name of a file, possibly moving it
to a new directory. The rename opreation is actually a directory opertation
and should ideally have olddirfid, if not we cannot represent the fid on server
with anything other than name. We will have to derive the old directory name
from fid in the Trename request.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/vfs_inode.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 3bbf705634b2..bce66f56c62c 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -904,9 +904,12 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
904 | 904 | ||
905 | down_write(&v9ses->rename_sem); | 905 | down_write(&v9ses->rename_sem); |
906 | if (v9fs_proto_dotl(v9ses)) { | 906 | if (v9fs_proto_dotl(v9ses)) { |
907 | retval = p9_client_rename(oldfid, newdirfid, | 907 | retval = p9_client_renameat(olddirfid, old_dentry->d_name.name, |
908 | (char *) new_dentry->d_name.name); | 908 | newdirfid, new_dentry->d_name.name); |
909 | if (retval != -ENOSYS) | 909 | if (retval == -EOPNOTSUPP) |
910 | retval = p9_client_rename(oldfid, newdirfid, | ||
911 | new_dentry->d_name.name); | ||
912 | if (retval != -EOPNOTSUPP) | ||
910 | goto clunk_newdir; | 913 | goto clunk_newdir; |
911 | } | 914 | } |
912 | if (old_dentry->d_parent != new_dentry->d_parent) { | 915 | if (old_dentry->d_parent != new_dentry->d_parent) { |