Merge remote-tracking branch 'ovl/rename2' into for-linus
[cascardo/linux.git] / fs / ext2 / namei.c
index edb7b8c..7d66b20 100644 (file)
@@ -328,7 +328,8 @@ static int ext2_rmdir (struct inode * dir, struct dentry *dentry)
 }
 
 static int ext2_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 inode * old_inode = d_inode(old_dentry);
        struct inode * new_inode = d_inode(new_dentry);
@@ -338,6 +339,9 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
        struct ext2_dir_entry_2 * old_de;
        int err;
 
+       if (flags & ~RENAME_NOREPLACE)
+               return -EINVAL;
+
        err = dquot_initialize(old_dir);
        if (err)
                goto out;