aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 43192e10cc43..811576346a92 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4016,16 +4016,16 @@ static int btrfs_unlink(struct inode *dir, struct dentry *dentry)
4016{ 4016{
4017 struct btrfs_root *root = BTRFS_I(dir)->root; 4017 struct btrfs_root *root = BTRFS_I(dir)->root;
4018 struct btrfs_trans_handle *trans; 4018 struct btrfs_trans_handle *trans;
4019 struct inode *inode = dentry->d_inode; 4019 struct inode *inode = d_inode(dentry);
4020 int ret; 4020 int ret;
4021 4021
4022 trans = __unlink_start_trans(dir); 4022 trans = __unlink_start_trans(dir);
4023 if (IS_ERR(trans)) 4023 if (IS_ERR(trans))
4024 return PTR_ERR(trans); 4024 return PTR_ERR(trans);
4025 4025
4026 btrfs_record_unlink_dir(trans, dir, dentry->d_inode, 0); 4026 btrfs_record_unlink_dir(trans, dir, d_inode(dentry), 0);
4027 4027
4028 ret = btrfs_unlink_inode(trans, root, dir, dentry->d_inode, 4028 ret = btrfs_unlink_inode(trans, root, dir, d_inode(dentry),
4029 dentry->d_name.name, dentry->d_name.len); 4029 dentry->d_name.name, dentry->d_name.len);
4030 if (ret) 4030 if (ret)
4031 goto out; 4031 goto out;
@@ -4124,7 +4124,7 @@ out:
4124 4124
4125static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) 4125static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
4126{ 4126{
4127 struct inode *inode = dentry->d_inode; 4127 struct inode *inode = d_inode(dentry);
4128 int err = 0; 4128 int err = 0;
4129 struct btrfs_root *root = BTRFS_I(dir)->root; 4129 struct btrfs_root *root = BTRFS_I(dir)->root;
4130 struct btrfs_trans_handle *trans; 4130 struct btrfs_trans_handle *trans;
@@ -4151,7 +4151,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
4151 goto out; 4151 goto out;
4152 4152
4153 /* now the directory is empty */ 4153 /* now the directory is empty */
4154 err = btrfs_unlink_inode(trans, root, dir, dentry->d_inode, 4154 err = btrfs_unlink_inode(trans, root, dir, d_inode(dentry),
4155 dentry->d_name.name, dentry->d_name.len); 4155 dentry->d_name.name, dentry->d_name.len);
4156 if (!err) 4156 if (!err)
4157 btrfs_i_size_write(inode, 0); 4157 btrfs_i_size_write(inode, 0);
@@ -4826,7 +4826,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
4826 4826
4827static int btrfs_setattr(struct dentry *dentry, struct iattr *attr) 4827static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
4828{ 4828{
4829 struct inode *inode = dentry->d_inode; 4829 struct inode *inode = d_inode(dentry);
4830 struct btrfs_root *root = BTRFS_I(inode)->root; 4830 struct btrfs_root *root = BTRFS_I(inode)->root;
4831 int err; 4831 int err;
4832 4832
@@ -5416,10 +5416,10 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
5416static int btrfs_dentry_delete(const struct dentry *dentry) 5416static int btrfs_dentry_delete(const struct dentry *dentry)
5417{ 5417{
5418 struct btrfs_root *root; 5418 struct btrfs_root *root;
5419 struct inode *inode = dentry->d_inode; 5419 struct inode *inode = d_inode(dentry);
5420 5420
5421 if (!inode && !IS_ROOT(dentry)) 5421 if (!inode && !IS_ROOT(dentry))
5422 inode = dentry->d_parent->d_inode; 5422 inode = d_inode(dentry->d_parent);
5423 5423
5424 if (inode) { 5424 if (inode) {
5425 root = BTRFS_I(inode)->root; 5425 root = BTRFS_I(inode)->root;
@@ -6226,7 +6226,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
6226{ 6226{
6227 struct btrfs_trans_handle *trans; 6227 struct btrfs_trans_handle *trans;
6228 struct btrfs_root *root = BTRFS_I(dir)->root; 6228 struct btrfs_root *root = BTRFS_I(dir)->root;
6229 struct inode *inode = old_dentry->d_inode; 6229 struct inode *inode = d_inode(old_dentry);
6230 u64 index; 6230 u64 index;
6231 int err; 6231 int err;
6232 int drop_inode = 0; 6232 int drop_inode = 0;
@@ -8875,7 +8875,7 @@ static int btrfs_getattr(struct vfsmount *mnt,
8875 struct dentry *dentry, struct kstat *stat) 8875 struct dentry *dentry, struct kstat *stat)
8876{ 8876{
8877 u64 delalloc_bytes; 8877 u64 delalloc_bytes;
8878 struct inode *inode = dentry->d_inode; 8878 struct inode *inode = d_inode(dentry);
8879 u32 blocksize = inode->i_sb->s_blocksize; 8879 u32 blocksize = inode->i_sb->s_blocksize;
8880 8880
8881 generic_fillattr(inode, stat); 8881 generic_fillattr(inode, stat);
@@ -8896,8 +8896,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
8896 struct btrfs_trans_handle *trans; 8896 struct btrfs_trans_handle *trans;
8897 struct btrfs_root *root = BTRFS_I(old_dir)->root; 8897 struct btrfs_root *root = BTRFS_I(old_dir)->root;
8898 struct btrfs_root *dest = BTRFS_I(new_dir)->root; 8898 struct btrfs_root *dest = BTRFS_I(new_dir)->root;
8899 struct inode *new_inode = new_dentry->d_inode; 8899 struct inode *new_inode = d_inode(new_dentry);
8900 struct inode *old_inode = old_dentry->d_inode; 8900 struct inode *old_inode = d_inode(old_dentry);
8901 struct timespec ctime = CURRENT_TIME; 8901 struct timespec ctime = CURRENT_TIME;
8902 u64 index = 0; 8902 u64 index = 0;
8903 u64 root_objectid; 8903 u64 root_objectid;
@@ -9009,7 +9009,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
9009 old_dentry->d_name.len); 9009 old_dentry->d_name.len);
9010 } else { 9010 } else {
9011 ret = __btrfs_unlink_inode(trans, root, old_dir, 9011 ret = __btrfs_unlink_inode(trans, root, old_dir,
9012 old_dentry->d_inode, 9012 d_inode(old_dentry),
9013 old_dentry->d_name.name, 9013 old_dentry->d_name.name,
9014 old_dentry->d_name.len); 9014 old_dentry->d_name.len);
9015 if (!ret) 9015 if (!ret)
@@ -9033,12 +9033,12 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
9033 BUG_ON(new_inode->i_nlink == 0); 9033 BUG_ON(new_inode->i_nlink == 0);
9034 } else { 9034 } else {
9035 ret = btrfs_unlink_inode(trans, dest, new_dir, 9035 ret = btrfs_unlink_inode(trans, dest, new_dir,
9036 new_dentry->d_inode, 9036 d_inode(new_dentry),
9037 new_dentry->d_name.name, 9037 new_dentry->d_name.name,
9038 new_dentry->d_name.len); 9038 new_dentry->d_name.len);
9039 } 9039 }
9040 if (!ret && new_inode->i_nlink == 0) 9040 if (!ret && new_inode->i_nlink == 0)
9041 ret = btrfs_orphan_add(trans, new_dentry->d_inode); 9041 ret = btrfs_orphan_add(trans, d_inode(new_dentry));
9042 if (ret) { 9042 if (ret) {
9043 btrfs_abort_transaction(trans, root, ret); 9043 btrfs_abort_transaction(trans, root, ret);
9044 goto out_fail; 9044 goto out_fail;