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.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 56f00a25c003..ada4d24ed11b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4020,16 +4020,16 @@ static int btrfs_unlink(struct inode *dir, struct dentry *dentry)
4020{ 4020{
4021 struct btrfs_root *root = BTRFS_I(dir)->root; 4021 struct btrfs_root *root = BTRFS_I(dir)->root;
4022 struct btrfs_trans_handle *trans; 4022 struct btrfs_trans_handle *trans;
4023 struct inode *inode = dentry->d_inode; 4023 struct inode *inode = d_inode(dentry);
4024 int ret; 4024 int ret;
4025 4025
4026 trans = __unlink_start_trans(dir); 4026 trans = __unlink_start_trans(dir);
4027 if (IS_ERR(trans)) 4027 if (IS_ERR(trans))
4028 return PTR_ERR(trans); 4028 return PTR_ERR(trans);
4029 4029
4030 btrfs_record_unlink_dir(trans, dir, dentry->d_inode, 0); 4030 btrfs_record_unlink_dir(trans, dir, d_inode(dentry), 0);
4031 4031
4032 ret = btrfs_unlink_inode(trans, root, dir, dentry->d_inode, 4032 ret = btrfs_unlink_inode(trans, root, dir, d_inode(dentry),
4033 dentry->d_name.name, dentry->d_name.len); 4033 dentry->d_name.name, dentry->d_name.len);
4034 if (ret) 4034 if (ret)
4035 goto out; 4035 goto out;
@@ -4128,7 +4128,7 @@ out:
4128 4128
4129static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) 4129static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
4130{ 4130{
4131 struct inode *inode = dentry->d_inode; 4131 struct inode *inode = d_inode(dentry);
4132 int err = 0; 4132 int err = 0;
4133 struct btrfs_root *root = BTRFS_I(dir)->root; 4133 struct btrfs_root *root = BTRFS_I(dir)->root;
4134 struct btrfs_trans_handle *trans; 4134 struct btrfs_trans_handle *trans;
@@ -4155,7 +4155,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
4155 goto out; 4155 goto out;
4156 4156
4157 /* now the directory is empty */ 4157 /* now the directory is empty */
4158 err = btrfs_unlink_inode(trans, root, dir, dentry->d_inode, 4158 err = btrfs_unlink_inode(trans, root, dir, d_inode(dentry),
4159 dentry->d_name.name, dentry->d_name.len); 4159 dentry->d_name.name, dentry->d_name.len);
4160 if (!err) 4160 if (!err)
4161 btrfs_i_size_write(inode, 0); 4161 btrfs_i_size_write(inode, 0);
@@ -4915,7 +4915,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
4915 4915
4916static int btrfs_setattr(struct dentry *dentry, struct iattr *attr) 4916static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
4917{ 4917{
4918 struct inode *inode = dentry->d_inode; 4918 struct inode *inode = d_inode(dentry);
4919 struct btrfs_root *root = BTRFS_I(inode)->root; 4919 struct btrfs_root *root = BTRFS_I(inode)->root;
4920 int err; 4920 int err;
4921 4921
@@ -5547,10 +5547,10 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
5547static int btrfs_dentry_delete(const struct dentry *dentry) 5547static int btrfs_dentry_delete(const struct dentry *dentry)
5548{ 5548{
5549 struct btrfs_root *root; 5549 struct btrfs_root *root;
5550 struct inode *inode = dentry->d_inode; 5550 struct inode *inode = d_inode(dentry);
5551 5551
5552 if (!inode && !IS_ROOT(dentry)) 5552 if (!inode && !IS_ROOT(dentry))
5553 inode = dentry->d_parent->d_inode; 5553 inode = d_inode(dentry->d_parent);
5554 5554
5555 if (inode) { 5555 if (inode) {
5556 root = BTRFS_I(inode)->root; 5556 root = BTRFS_I(inode)->root;
@@ -6357,7 +6357,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
6357{ 6357{
6358 struct btrfs_trans_handle *trans; 6358 struct btrfs_trans_handle *trans;
6359 struct btrfs_root *root = BTRFS_I(dir)->root; 6359 struct btrfs_root *root = BTRFS_I(dir)->root;
6360 struct inode *inode = old_dentry->d_inode; 6360 struct inode *inode = d_inode(old_dentry);
6361 u64 index; 6361 u64 index;
6362 int err; 6362 int err;
6363 int drop_inode = 0; 6363 int drop_inode = 0;
@@ -8260,7 +8260,7 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
8260 if (check_direct_IO(BTRFS_I(inode)->root, iocb, iter, offset)) 8260 if (check_direct_IO(BTRFS_I(inode)->root, iocb, iter, offset))
8261 return 0; 8261 return 0;
8262 8262
8263 atomic_inc(&inode->i_dio_count); 8263 inode_dio_begin(inode);
8264 smp_mb__after_atomic(); 8264 smp_mb__after_atomic();
8265 8265
8266 /* 8266 /*
@@ -8300,7 +8300,7 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
8300 current->journal_info = &outstanding_extents; 8300 current->journal_info = &outstanding_extents;
8301 } else if (test_bit(BTRFS_INODE_READDIO_NEED_LOCK, 8301 } else if (test_bit(BTRFS_INODE_READDIO_NEED_LOCK,
8302 &BTRFS_I(inode)->runtime_flags)) { 8302 &BTRFS_I(inode)->runtime_flags)) {
8303 inode_dio_done(inode); 8303 inode_dio_end(inode);
8304 flags = DIO_LOCKING | DIO_SKIP_HOLES; 8304 flags = DIO_LOCKING | DIO_SKIP_HOLES;
8305 wakeup = false; 8305 wakeup = false;
8306 } 8306 }
@@ -8319,7 +8319,7 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
8319 } 8319 }
8320out: 8320out:
8321 if (wakeup) 8321 if (wakeup)
8322 inode_dio_done(inode); 8322 inode_dio_end(inode);
8323 if (relock) 8323 if (relock)
8324 mutex_lock(&inode->i_mutex); 8324 mutex_lock(&inode->i_mutex);
8325 8325
@@ -9006,7 +9006,7 @@ static int btrfs_getattr(struct vfsmount *mnt,
9006 struct dentry *dentry, struct kstat *stat) 9006 struct dentry *dentry, struct kstat *stat)
9007{ 9007{
9008 u64 delalloc_bytes; 9008 u64 delalloc_bytes;
9009 struct inode *inode = dentry->d_inode; 9009 struct inode *inode = d_inode(dentry);
9010 u32 blocksize = inode->i_sb->s_blocksize; 9010 u32 blocksize = inode->i_sb->s_blocksize;
9011 9011
9012 generic_fillattr(inode, stat); 9012 generic_fillattr(inode, stat);
@@ -9027,8 +9027,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
9027 struct btrfs_trans_handle *trans; 9027 struct btrfs_trans_handle *trans;
9028 struct btrfs_root *root = BTRFS_I(old_dir)->root; 9028 struct btrfs_root *root = BTRFS_I(old_dir)->root;
9029 struct btrfs_root *dest = BTRFS_I(new_dir)->root; 9029 struct btrfs_root *dest = BTRFS_I(new_dir)->root;
9030 struct inode *new_inode = new_dentry->d_inode; 9030 struct inode *new_inode = d_inode(new_dentry);
9031 struct inode *old_inode = old_dentry->d_inode; 9031 struct inode *old_inode = d_inode(old_dentry);
9032 struct timespec ctime = CURRENT_TIME; 9032 struct timespec ctime = CURRENT_TIME;
9033 u64 index = 0; 9033 u64 index = 0;
9034 u64 root_objectid; 9034 u64 root_objectid;
@@ -9140,7 +9140,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
9140 old_dentry->d_name.len); 9140 old_dentry->d_name.len);
9141 } else { 9141 } else {
9142 ret = __btrfs_unlink_inode(trans, root, old_dir, 9142 ret = __btrfs_unlink_inode(trans, root, old_dir,
9143 old_dentry->d_inode, 9143 d_inode(old_dentry),
9144 old_dentry->d_name.name, 9144 old_dentry->d_name.name,
9145 old_dentry->d_name.len); 9145 old_dentry->d_name.len);
9146 if (!ret) 9146 if (!ret)
@@ -9164,12 +9164,12 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
9164 BUG_ON(new_inode->i_nlink == 0); 9164 BUG_ON(new_inode->i_nlink == 0);
9165 } else { 9165 } else {
9166 ret = btrfs_unlink_inode(trans, dest, new_dir, 9166 ret = btrfs_unlink_inode(trans, dest, new_dir,
9167 new_dentry->d_inode, 9167 d_inode(new_dentry),
9168 new_dentry->d_name.name, 9168 new_dentry->d_name.name,
9169 new_dentry->d_name.len); 9169 new_dentry->d_name.len);
9170 } 9170 }
9171 if (!ret && new_inode->i_nlink == 0) 9171 if (!ret && new_inode->i_nlink == 0)
9172 ret = btrfs_orphan_add(trans, new_dentry->d_inode); 9172 ret = btrfs_orphan_add(trans, d_inode(new_dentry));
9173 if (ret) { 9173 if (ret) {
9174 btrfs_abort_transaction(trans, root, ret); 9174 btrfs_abort_transaction(trans, root, ret);
9175 goto out_fail; 9175 goto out_fail;