aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Borisov <n.borisov.lkml@gmail.com>2017-01-17 17:31:46 -0500
committerDavid Sterba <dsterba@suse.com>2017-02-14 09:50:56 -0500
commit94c91a1f3982164017deee8601d34f8c1bac8309 (patch)
treecd575c985ddfb2f063f7f363186c55c1ef9610d4
parent207e7d92aa231b37873adf7aca8a66576c48831f (diff)
btrfs: Make __add_inode_ref take btrfs_inode
Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/tree-log.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 64c323eefc68..5b164ccbb3c0 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -992,7 +992,8 @@ static inline int __add_inode_ref(struct btrfs_trans_handle *trans,
992 struct btrfs_root *root, 992 struct btrfs_root *root,
993 struct btrfs_path *path, 993 struct btrfs_path *path,
994 struct btrfs_root *log_root, 994 struct btrfs_root *log_root,
995 struct inode *dir, struct inode *inode, 995 struct btrfs_inode *dir,
996 struct btrfs_inode *inode,
996 struct extent_buffer *eb, 997 struct extent_buffer *eb,
997 u64 inode_objectid, u64 parent_objectid, 998 u64 inode_objectid, u64 parent_objectid,
998 u64 ref_index, char *name, int namelen, 999 u64 ref_index, char *name, int namelen,
@@ -1048,11 +1049,10 @@ again:
1048 parent_objectid, 1049 parent_objectid,
1049 victim_name, 1050 victim_name,
1050 victim_name_len)) { 1051 victim_name_len)) {
1051 inc_nlink(inode); 1052 inc_nlink(&inode->vfs_inode);
1052 btrfs_release_path(path); 1053 btrfs_release_path(path);
1053 1054
1054 ret = btrfs_unlink_inode(trans, root, 1055 ret = btrfs_unlink_inode(trans, root, dir, inode,
1055 BTRFS_I(dir), BTRFS_I(inode),
1056 victim_name, victim_name_len); 1056 victim_name, victim_name_len);
1057 kfree(victim_name); 1057 kfree(victim_name);
1058 if (ret) 1058 if (ret)
@@ -1116,14 +1116,14 @@ again:
1116 victim_name_len)) { 1116 victim_name_len)) {
1117 ret = -ENOENT; 1117 ret = -ENOENT;
1118 victim_parent = read_one_inode(root, 1118 victim_parent = read_one_inode(root,
1119 parent_objectid); 1119 parent_objectid);
1120 if (victim_parent) { 1120 if (victim_parent) {
1121 inc_nlink(inode); 1121 inc_nlink(&inode->vfs_inode);
1122 btrfs_release_path(path); 1122 btrfs_release_path(path);
1123 1123
1124 ret = btrfs_unlink_inode(trans, root, 1124 ret = btrfs_unlink_inode(trans, root,
1125 BTRFS_I(victim_parent), 1125 BTRFS_I(victim_parent),
1126 BTRFS_I(inode), 1126 inode,
1127 victim_name, 1127 victim_name,
1128 victim_name_len); 1128 victim_name_len);
1129 if (!ret) 1129 if (!ret)
@@ -1149,20 +1149,20 @@ next:
1149 btrfs_release_path(path); 1149 btrfs_release_path(path);
1150 1150
1151 /* look for a conflicting sequence number */ 1151 /* look for a conflicting sequence number */
1152 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(BTRFS_I(dir)), 1152 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir),
1153 ref_index, name, namelen, 0); 1153 ref_index, name, namelen, 0);
1154 if (di && !IS_ERR(di)) { 1154 if (di && !IS_ERR(di)) {
1155 ret = drop_one_dir_item(trans, root, path, BTRFS_I(dir), di); 1155 ret = drop_one_dir_item(trans, root, path, dir, di);
1156 if (ret) 1156 if (ret)
1157 return ret; 1157 return ret;
1158 } 1158 }
1159 btrfs_release_path(path); 1159 btrfs_release_path(path);
1160 1160
1161 /* look for a conflicing name */ 1161 /* look for a conflicing name */
1162 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(BTRFS_I(dir)), 1162 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir),
1163 name, namelen, 0); 1163 name, namelen, 0);
1164 if (di && !IS_ERR(di)) { 1164 if (di && !IS_ERR(di)) {
1165 ret = drop_one_dir_item(trans, root, path, BTRFS_I(dir), di); 1165 ret = drop_one_dir_item(trans, root, path, dir, di);
1166 if (ret) 1166 if (ret)
1167 return ret; 1167 return ret;
1168 } 1168 }
@@ -1308,7 +1308,8 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
1308 1308
1309 if (!search_done) { 1309 if (!search_done) {
1310 ret = __add_inode_ref(trans, root, path, log, 1310 ret = __add_inode_ref(trans, root, path, log,
1311 dir, inode, eb, 1311 BTRFS_I(dir),
1312 BTRFS_I(inode), eb,
1312 inode_objectid, 1313 inode_objectid,
1313 parent_objectid, 1314 parent_objectid,
1314 ref_index, name, namelen, 1315 ref_index, name, namelen,