aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r--fs/btrfs/backref.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 8729cf68d2fe..f55721ff9385 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1246,25 +1246,6 @@ int btrfs_check_shared(struct btrfs_trans_handle *trans,
1246 return ret; 1246 return ret;
1247} 1247}
1248 1248
1249/*
1250 * this makes the path point to (inum INODE_ITEM ioff)
1251 */
1252int inode_item_info(u64 inum, u64 ioff, struct btrfs_root *fs_root,
1253 struct btrfs_path *path)
1254{
1255 struct btrfs_key key;
1256 return btrfs_find_item(fs_root, path, inum, ioff,
1257 BTRFS_INODE_ITEM_KEY, &key);
1258}
1259
1260static int inode_ref_info(u64 inum, u64 ioff, struct btrfs_root *fs_root,
1261 struct btrfs_path *path,
1262 struct btrfs_key *found_key)
1263{
1264 return btrfs_find_item(fs_root, path, inum, ioff,
1265 BTRFS_INODE_REF_KEY, found_key);
1266}
1267
1268int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid, 1249int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid,
1269 u64 start_off, struct btrfs_path *path, 1250 u64 start_off, struct btrfs_path *path,
1270 struct btrfs_inode_extref **ret_extref, 1251 struct btrfs_inode_extref **ret_extref,
@@ -1374,7 +1355,8 @@ char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path,
1374 btrfs_tree_read_unlock_blocking(eb); 1355 btrfs_tree_read_unlock_blocking(eb);
1375 free_extent_buffer(eb); 1356 free_extent_buffer(eb);
1376 } 1357 }
1377 ret = inode_ref_info(parent, 0, fs_root, path, &found_key); 1358 ret = btrfs_find_item(fs_root, path, parent, 0,
1359 BTRFS_INODE_REF_KEY, &found_key);
1378 if (ret > 0) 1360 if (ret > 0)
1379 ret = -ENOENT; 1361 ret = -ENOENT;
1380 if (ret) 1362 if (ret)
@@ -1727,8 +1709,10 @@ static int iterate_inode_refs(u64 inum, struct btrfs_root *fs_root,
1727 struct btrfs_key found_key; 1709 struct btrfs_key found_key;
1728 1710
1729 while (!ret) { 1711 while (!ret) {
1730 ret = inode_ref_info(inum, parent ? parent+1 : 0, fs_root, path, 1712 ret = btrfs_find_item(fs_root, path, inum,
1731 &found_key); 1713 parent ? parent + 1 : 0, BTRFS_INODE_REF_KEY,
1714 &found_key);
1715
1732 if (ret < 0) 1716 if (ret < 0)
1733 break; 1717 break;
1734 if (ret) { 1718 if (ret) {