Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / fs / ext4 / namei.c
index 7cc3918e2f1894b5ded68ca80cc9b59169d46469..31e21de56432d194e1e95eaa5d326e32c0cbcdc2 100644 (file)
@@ -2791,7 +2791,7 @@ static int ext4_add_nondir(handle_t *handle,
  * If the create succeeds, we fill in the inode information
  * with d_instantiate().
  */
-static int ext4_create(struct user_namespace *mnt_userns, struct inode *dir,
+static int ext4_create(struct mnt_idmap *idmap, struct inode *dir,
                       struct dentry *dentry, umode_t mode, bool excl)
 {
        handle_t *handle;
@@ -2805,7 +2805,7 @@ static int ext4_create(struct user_namespace *mnt_userns, struct inode *dir,
        credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) +
                   EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3);
 retry:
-       inode = ext4_new_inode_start_handle(mnt_userns, dir, mode, &dentry->d_name,
+       inode = ext4_new_inode_start_handle(idmap, dir, mode, &dentry->d_name,
                                            0, NULL, EXT4_HT_DIR, credits);
        handle = ext4_journal_current_handle();
        err = PTR_ERR(inode);
@@ -2826,7 +2826,7 @@ retry:
        return err;
 }
 
-static int ext4_mknod(struct user_namespace *mnt_userns, struct inode *dir,
+static int ext4_mknod(struct mnt_idmap *idmap, struct inode *dir,
                      struct dentry *dentry, umode_t mode, dev_t rdev)
 {
        handle_t *handle;
@@ -2840,7 +2840,7 @@ static int ext4_mknod(struct user_namespace *mnt_userns, struct inode *dir,
        credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) +
                   EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3);
 retry:
-       inode = ext4_new_inode_start_handle(mnt_userns, dir, mode, &dentry->d_name,
+       inode = ext4_new_inode_start_handle(idmap, dir, mode, &dentry->d_name,
                                            0, NULL, EXT4_HT_DIR, credits);
        handle = ext4_journal_current_handle();
        err = PTR_ERR(inode);
@@ -2860,7 +2860,7 @@ retry:
        return err;
 }
 
-static int ext4_tmpfile(struct user_namespace *mnt_userns, struct inode *dir,
+static int ext4_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
                        struct file *file, umode_t mode)
 {
        handle_t *handle;
@@ -2872,7 +2872,7 @@ static int ext4_tmpfile(struct user_namespace *mnt_userns, struct inode *dir,
                return err;
 
 retry:
-       inode = ext4_new_inode_start_handle(mnt_userns, dir, mode,
+       inode = ext4_new_inode_start_handle(idmap, dir, mode,
                                            NULL, 0, NULL,
                                            EXT4_HT_DIR,
                        EXT4_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) +
@@ -2971,7 +2971,7 @@ out:
        return err;
 }
 
-static int ext4_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
+static int ext4_mkdir(struct mnt_idmap *idmap, struct inode *dir,
                      struct dentry *dentry, umode_t mode)
 {
        handle_t *handle;
@@ -2988,7 +2988,7 @@ static int ext4_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
        credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) +
                   EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3);
 retry:
-       inode = ext4_new_inode_start_handle(mnt_userns, dir, S_IFDIR | mode,
+       inode = ext4_new_inode_start_handle(idmap, dir, S_IFDIR | mode,
                                            &dentry->d_name,
                                            0, NULL, EXT4_HT_DIR, credits);
        handle = ext4_journal_current_handle();
@@ -3338,7 +3338,7 @@ out:
        return err;
 }
 
-static int ext4_symlink(struct user_namespace *mnt_userns, struct inode *dir,
+static int ext4_symlink(struct mnt_idmap *idmap, struct inode *dir,
                        struct dentry *dentry, const char *symname)
 {
        handle_t *handle;
@@ -3369,7 +3369,7 @@ static int ext4_symlink(struct user_namespace *mnt_userns, struct inode *dir,
        credits = EXT4_DATA_TRANS_BLOCKS(dir->i_sb) +
                  EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3;
 retry:
-       inode = ext4_new_inode_start_handle(mnt_userns, dir, S_IFLNK|S_IRWXUGO,
+       inode = ext4_new_inode_start_handle(idmap, dir, S_IFLNK|S_IRWXUGO,
                                            &dentry->d_name, 0, NULL,
                                            EXT4_HT_DIR, credits);
        handle = ext4_journal_current_handle();
@@ -3720,7 +3720,7 @@ static void ext4_update_dir_count(handle_t *handle, struct ext4_renament *ent)
        }
 }
 
-static struct inode *ext4_whiteout_for_rename(struct user_namespace *mnt_userns,
+static struct inode *ext4_whiteout_for_rename(struct mnt_idmap *idmap,
                                              struct ext4_renament *ent,
                                              int credits, handle_t **h)
 {
@@ -3735,7 +3735,7 @@ static struct inode *ext4_whiteout_for_rename(struct user_namespace *mnt_userns,
        credits += (EXT4_MAXQUOTAS_TRANS_BLOCKS(ent->dir->i_sb) +
                    EXT4_XATTR_TRANS_BLOCKS + 4);
 retry:
-       wh = ext4_new_inode_start_handle(mnt_userns, ent->dir,
+       wh = ext4_new_inode_start_handle(idmap, ent->dir,
                                         S_IFCHR | WHITEOUT_MODE,
                                         &ent->dentry->d_name, 0, NULL,
                                         EXT4_HT_DIR, credits);
@@ -3763,7 +3763,7 @@ retry:
  * while new_{dentry,inode) refers to the destination dentry/inode
  * This comes from rename(const char *oldpath, const char *newpath)
  */
-static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
+static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir,
                       struct dentry *old_dentry, struct inode *new_dir,
                       struct dentry *new_dentry, unsigned int flags)
 {
@@ -3862,7 +3862,7 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
                        goto release_bh;
                }
        } else {
-               whiteout = ext4_whiteout_for_rename(mnt_userns, &old, credits, &handle);
+               whiteout = ext4_whiteout_for_rename(idmap, &old, credits, &handle);
                if (IS_ERR(whiteout)) {
                        retval = PTR_ERR(whiteout);
                        goto release_bh;
@@ -4176,7 +4176,7 @@ end_rename:
        return retval;
 }
 
-static int ext4_rename2(struct user_namespace *mnt_userns,
+static int ext4_rename2(struct mnt_idmap *idmap,
                        struct inode *old_dir, struct dentry *old_dentry,
                        struct inode *new_dir, struct dentry *new_dentry,
                        unsigned int flags)
@@ -4199,7 +4199,7 @@ static int ext4_rename2(struct user_namespace *mnt_userns,
                                         new_dir, new_dentry);
        }
 
-       return ext4_rename(mnt_userns, old_dir, old_dentry, new_dir, new_dentry, flags);
+       return ext4_rename(idmap, old_dir, old_dentry, new_dir, new_dentry, flags);
 }
 
 /*