summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2017-02-20 06:51:00 -0500
committerDavid Sterba <dsterba@suse.com>2017-02-28 05:30:10 -0500
commitaefa6115c04ee561302e133ab5916246cd3695f7 (patch)
tree8d5c36fdba3bb43dfc139844a962e5dfd014290e /fs/btrfs/tree-log.c
parent73f2e545b68f6af033fd2c083ca9dc3079e79083 (diff)
btrfs: Make check_parent_dirs_for_sync take btrfs_inode
Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 071f64944711..399561b039c3 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -5045,14 +5045,14 @@ static bool btrfs_must_commit_transaction(struct btrfs_trans_handle *trans,
5045 * a full commit is required. 5045 * a full commit is required.
5046 */ 5046 */
5047static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans, 5047static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans,
5048 struct inode *inode, 5048 struct btrfs_inode *inode,
5049 struct dentry *parent, 5049 struct dentry *parent,
5050 struct super_block *sb, 5050 struct super_block *sb,
5051 u64 last_committed) 5051 u64 last_committed)
5052{ 5052{
5053 int ret = 0; 5053 int ret = 0;
5054 struct dentry *old_parent = NULL; 5054 struct dentry *old_parent = NULL;
5055 struct inode *orig_inode = inode; 5055 struct btrfs_inode *orig_inode = inode;
5056 5056
5057 /* 5057 /*
5058 * for regular files, if its inode is already on disk, we don't 5058 * for regular files, if its inode is already on disk, we don't
@@ -5060,15 +5060,15 @@ static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans,
5060 * we can use the last_unlink_trans field to record renames 5060 * we can use the last_unlink_trans field to record renames
5061 * and other fun in this file. 5061 * and other fun in this file.
5062 */ 5062 */
5063 if (S_ISREG(inode->i_mode) && 5063 if (S_ISREG(inode->vfs_inode.i_mode) &&
5064 BTRFS_I(inode)->generation <= last_committed && 5064 inode->generation <= last_committed &&
5065 BTRFS_I(inode)->last_unlink_trans <= last_committed) 5065 inode->last_unlink_trans <= last_committed)
5066 goto out; 5066 goto out;
5067 5067
5068 if (!S_ISDIR(inode->i_mode)) { 5068 if (!S_ISDIR(inode->vfs_inode.i_mode)) {
5069 if (!parent || d_really_is_negative(parent) || sb != parent->d_sb) 5069 if (!parent || d_really_is_negative(parent) || sb != parent->d_sb)
5070 goto out; 5070 goto out;
5071 inode = d_inode(parent); 5071 inode = BTRFS_I(d_inode(parent));
5072 } 5072 }
5073 5073
5074 while (1) { 5074 while (1) {
@@ -5079,10 +5079,10 @@ static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans,
5079 * think this inode has already been logged. 5079 * think this inode has already been logged.
5080 */ 5080 */
5081 if (inode != orig_inode) 5081 if (inode != orig_inode)
5082 BTRFS_I(inode)->logged_trans = trans->transid; 5082 inode->logged_trans = trans->transid;
5083 smp_mb(); 5083 smp_mb();
5084 5084
5085 if (btrfs_must_commit_transaction(trans, BTRFS_I(inode))) { 5085 if (btrfs_must_commit_transaction(trans, inode)) {
5086 ret = 1; 5086 ret = 1;
5087 break; 5087 break;
5088 } 5088 }
@@ -5091,8 +5091,8 @@ static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans,
5091 break; 5091 break;
5092 5092
5093 if (IS_ROOT(parent)) { 5093 if (IS_ROOT(parent)) {
5094 inode = d_inode(parent); 5094 inode = BTRFS_I(d_inode(parent));
5095 if (btrfs_must_commit_transaction(trans, BTRFS_I(inode))) 5095 if (btrfs_must_commit_transaction(trans, inode))
5096 ret = 1; 5096 ret = 1;
5097 break; 5097 break;
5098 } 5098 }
@@ -5100,7 +5100,7 @@ static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans,
5100 parent = dget_parent(parent); 5100 parent = dget_parent(parent);
5101 dput(old_parent); 5101 dput(old_parent);
5102 old_parent = parent; 5102 old_parent = parent;
5103 inode = d_inode(parent); 5103 inode = BTRFS_I(d_inode(parent));
5104 5104
5105 } 5105 }
5106 dput(old_parent); 5106 dput(old_parent);
@@ -5429,7 +5429,7 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans,
5429 goto end_no_trans; 5429 goto end_no_trans;
5430 } 5430 }
5431 5431
5432 ret = check_parent_dirs_for_sync(trans, inode, parent, 5432 ret = check_parent_dirs_for_sync(trans, BTRFS_I(inode), parent,
5433 sb, last_committed); 5433 sb, last_committed);
5434 if (ret) 5434 if (ret)
5435 goto end_no_trans; 5435 goto end_no_trans;