mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
fs: make remaining filesystems use .rename2
This is trivial to do: - add flags argument to foo_rename() - check if flags is zero - assign foo_rename() to .rename2 instead of .rename This doesn't mean it's impossible to support RENAME_NOREPLACE for these filesystems, but it is not trivial, like for local filesystems. RENAME_NOREPLACE must guarantee atomicity (i.e. it shouldn't be possible for a file to be created on one host while it is overwritten by rename on another host). Filesystems converted: 9p, afs, ceph, coda, ecryptfs, kernfs, lustre, ncpfs, nfs, ocfs2, orangefs. After this, we can get rid of the duplicate interfaces for rename. Signed-off-by: Miklos Szeredi <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: David Howells <[email protected]> [AFS] Acked-by: Mike Marshall <[email protected]> Cc: Eric Van Hensbergen <[email protected]> Cc: Ilya Dryomov <[email protected]> Cc: Jan Harkes <[email protected]> Cc: Tyler Hicks <[email protected]> Cc: Oleg Drokin <[email protected]> Cc: Trond Myklebust <[email protected]> Cc: Mark Fasheh <[email protected]>
This commit is contained in:
parent
e0e0be8a83
commit
1cd66c93ba
17 changed files with 78 additions and 31 deletions
11
fs/afs/dir.c
11
fs/afs/dir.c
|
|
@ -38,7 +38,8 @@ static int afs_link(struct dentry *from, struct inode *dir,
|
|||
static int afs_symlink(struct inode *dir, struct dentry *dentry,
|
||||
const char *content);
|
||||
static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry);
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags);
|
||||
|
||||
const struct file_operations afs_dir_file_operations = {
|
||||
.open = afs_dir_open,
|
||||
|
|
@ -56,7 +57,7 @@ const struct inode_operations afs_dir_inode_operations = {
|
|||
.symlink = afs_symlink,
|
||||
.mkdir = afs_mkdir,
|
||||
.rmdir = afs_rmdir,
|
||||
.rename = afs_rename,
|
||||
.rename2 = afs_rename,
|
||||
.permission = afs_permission,
|
||||
.getattr = afs_getattr,
|
||||
.setattr = afs_setattr,
|
||||
|
|
@ -1083,12 +1084,16 @@ error:
|
|||
* rename a file in an AFS filesystem and/or move it between directories
|
||||
*/
|
||||
static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct afs_vnode *orig_dvnode, *new_dvnode, *vnode;
|
||||
struct key *key;
|
||||
int ret;
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
vnode = AFS_FS_I(d_inode(old_dentry));
|
||||
orig_dvnode = AFS_FS_I(old_dir);
|
||||
new_dvnode = AFS_FS_I(new_dir);
|
||||
|
|
|
|||
Loading…
Reference in a new issue