aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index ef22cd951c0c..7223b0b4bc38 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1664,7 +1664,7 @@ struct dentry *ext4_get_parent(struct dentry *child)
1664 struct ext4_dir_entry_2 * de; 1664 struct ext4_dir_entry_2 * de;
1665 struct buffer_head *bh; 1665 struct buffer_head *bh;
1666 1666
1667 bh = ext4_find_entry(child->d_inode, &dotdot, &de, NULL); 1667 bh = ext4_find_entry(d_inode(child), &dotdot, &de, NULL);
1668 if (IS_ERR(bh)) 1668 if (IS_ERR(bh))
1669 return (struct dentry *) bh; 1669 return (struct dentry *) bh;
1670 if (!bh) 1670 if (!bh)
@@ -1672,13 +1672,13 @@ struct dentry *ext4_get_parent(struct dentry *child)
1672 ino = le32_to_cpu(de->inode); 1672 ino = le32_to_cpu(de->inode);
1673 brelse(bh); 1673 brelse(bh);
1674 1674
1675 if (!ext4_valid_inum(child->d_inode->i_sb, ino)) { 1675 if (!ext4_valid_inum(d_inode(child)->i_sb, ino)) {
1676 EXT4_ERROR_INODE(child->d_inode, 1676 EXT4_ERROR_INODE(d_inode(child),
1677 "bad parent inode number: %u", ino); 1677 "bad parent inode number: %u", ino);
1678 return ERR_PTR(-EIO); 1678 return ERR_PTR(-EIO);
1679 } 1679 }
1680 1680
1681 return d_obtain_alias(ext4_iget_normal(child->d_inode->i_sb, ino)); 1681 return d_obtain_alias(ext4_iget_normal(d_inode(child)->i_sb, ino));
1682} 1682}
1683 1683
1684/* 1684/*
@@ -1988,7 +1988,7 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
1988 struct inode *inode, struct ext4_dir_entry_2 *de, 1988 struct inode *inode, struct ext4_dir_entry_2 *de,
1989 struct buffer_head *bh) 1989 struct buffer_head *bh)
1990{ 1990{
1991 struct inode *dir = dentry->d_parent->d_inode; 1991 struct inode *dir = d_inode(dentry->d_parent);
1992 const char *name = dentry->d_name.name; 1992 const char *name = dentry->d_name.name;
1993 int namelen = dentry->d_name.len; 1993 int namelen = dentry->d_name.len;
1994 unsigned int blocksize = dir->i_sb->s_blocksize; 1994 unsigned int blocksize = dir->i_sb->s_blocksize;
@@ -2048,7 +2048,7 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
2048static int make_indexed_dir(handle_t *handle, struct dentry *dentry, 2048static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
2049 struct inode *inode, struct buffer_head *bh) 2049 struct inode *inode, struct buffer_head *bh)
2050{ 2050{
2051 struct inode *dir = dentry->d_parent->d_inode; 2051 struct inode *dir = d_inode(dentry->d_parent);
2052#ifdef CONFIG_EXT4_FS_ENCRYPTION 2052#ifdef CONFIG_EXT4_FS_ENCRYPTION
2053 struct ext4_fname_crypto_ctx *ctx = NULL; 2053 struct ext4_fname_crypto_ctx *ctx = NULL;
2054 int res; 2054 int res;
@@ -2202,7 +2202,7 @@ out_frames:
2202static int ext4_add_entry(handle_t *handle, struct dentry *dentry, 2202static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
2203 struct inode *inode) 2203 struct inode *inode)
2204{ 2204{
2205 struct inode *dir = dentry->d_parent->d_inode; 2205 struct inode *dir = d_inode(dentry->d_parent);
2206 struct buffer_head *bh = NULL; 2206 struct buffer_head *bh = NULL;
2207 struct ext4_dir_entry_2 *de; 2207 struct ext4_dir_entry_2 *de;
2208 struct ext4_dir_entry_tail *t; 2208 struct ext4_dir_entry_tail *t;
@@ -2287,7 +2287,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
2287 struct dx_entry *entries, *at; 2287 struct dx_entry *entries, *at;
2288 struct dx_hash_info hinfo; 2288 struct dx_hash_info hinfo;
2289 struct buffer_head *bh; 2289 struct buffer_head *bh;
2290 struct inode *dir = dentry->d_parent->d_inode; 2290 struct inode *dir = d_inode(dentry->d_parent);
2291 struct super_block *sb = dir->i_sb; 2291 struct super_block *sb = dir->i_sb;
2292 struct ext4_dir_entry_2 *de; 2292 struct ext4_dir_entry_2 *de;
2293 int err; 2293 int err;
@@ -3063,7 +3063,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
3063 /* Initialize quotas before so that eventual writes go in 3063 /* Initialize quotas before so that eventual writes go in
3064 * separate transaction */ 3064 * separate transaction */
3065 dquot_initialize(dir); 3065 dquot_initialize(dir);
3066 dquot_initialize(dentry->d_inode); 3066 dquot_initialize(d_inode(dentry));
3067 3067
3068 retval = -ENOENT; 3068 retval = -ENOENT;
3069 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL); 3069 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL);
@@ -3072,7 +3072,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
3072 if (!bh) 3072 if (!bh)
3073 goto end_rmdir; 3073 goto end_rmdir;
3074 3074
3075 inode = dentry->d_inode; 3075 inode = d_inode(dentry);
3076 3076
3077 retval = -EIO; 3077 retval = -EIO;
3078 if (le32_to_cpu(de->inode) != inode->i_ino) 3078 if (le32_to_cpu(de->inode) != inode->i_ino)
@@ -3132,7 +3132,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry)
3132 /* Initialize quotas before so that eventual writes go 3132 /* Initialize quotas before so that eventual writes go
3133 * in separate transaction */ 3133 * in separate transaction */
3134 dquot_initialize(dir); 3134 dquot_initialize(dir);
3135 dquot_initialize(dentry->d_inode); 3135 dquot_initialize(d_inode(dentry));
3136 3136
3137 retval = -ENOENT; 3137 retval = -ENOENT;
3138 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL); 3138 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL);
@@ -3141,7 +3141,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry)
3141 if (!bh) 3141 if (!bh)
3142 goto end_unlink; 3142 goto end_unlink;
3143 3143
3144 inode = dentry->d_inode; 3144 inode = d_inode(dentry);
3145 3145
3146 retval = -EIO; 3146 retval = -EIO;
3147 if (le32_to_cpu(de->inode) != inode->i_ino) 3147 if (le32_to_cpu(de->inode) != inode->i_ino)
@@ -3339,7 +3339,7 @@ static int ext4_link(struct dentry *old_dentry,
3339 struct inode *dir, struct dentry *dentry) 3339 struct inode *dir, struct dentry *dentry)
3340{ 3340{
3341 handle_t *handle; 3341 handle_t *handle;
3342 struct inode *inode = old_dentry->d_inode; 3342 struct inode *inode = d_inode(old_dentry);
3343 int err, retries = 0; 3343 int err, retries = 0;
3344 3344
3345 if (inode->i_nlink >= EXT4_LINK_MAX) 3345 if (inode->i_nlink >= EXT4_LINK_MAX)
@@ -3613,12 +3613,12 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
3613 struct ext4_renament old = { 3613 struct ext4_renament old = {
3614 .dir = old_dir, 3614 .dir = old_dir,
3615 .dentry = old_dentry, 3615 .dentry = old_dentry,
3616 .inode = old_dentry->d_inode, 3616 .inode = d_inode(old_dentry),
3617 }; 3617 };
3618 struct ext4_renament new = { 3618 struct ext4_renament new = {
3619 .dir = new_dir, 3619 .dir = new_dir,
3620 .dentry = new_dentry, 3620 .dentry = new_dentry,
3621 .inode = new_dentry->d_inode, 3621 .inode = d_inode(new_dentry),
3622 }; 3622 };
3623 int force_reread; 3623 int force_reread;
3624 int retval; 3624 int retval;
@@ -3809,12 +3809,12 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
3809 struct ext4_renament old = { 3809 struct ext4_renament old = {
3810 .dir = old_dir, 3810 .dir = old_dir,
3811 .dentry = old_dentry, 3811 .dentry = old_dentry,
3812 .inode = old_dentry->d_inode, 3812 .inode = d_inode(old_dentry),
3813 }; 3813 };
3814 struct ext4_renament new = { 3814 struct ext4_renament new = {
3815 .dir = new_dir, 3815 .dir = new_dir,
3816 .dentry = new_dentry, 3816 .dentry = new_dentry,
3817 .inode = new_dentry->d_inode, 3817 .inode = d_inode(new_dentry),
3818 }; 3818 };
3819 u8 new_file_type; 3819 u8 new_file_type;
3820 int retval; 3820 int retval;