diff options
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r-- | fs/btrfs/backref.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index f3187938e081..208d8aa5b07e 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -283,9 +283,7 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info, | |||
283 | goto out; | 283 | goto out; |
284 | } | 284 | } |
285 | 285 | ||
286 | rcu_read_lock(); | 286 | root_level = btrfs_old_root_level(root, time_seq); |
287 | root_level = btrfs_header_level(root->node); | ||
288 | rcu_read_unlock(); | ||
289 | 287 | ||
290 | if (root_level + 1 == level) | 288 | if (root_level + 1 == level) |
291 | goto out; | 289 | goto out; |
@@ -1177,16 +1175,15 @@ int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid, | |||
1177 | return ret; | 1175 | return ret; |
1178 | } | 1176 | } |
1179 | 1177 | ||
1180 | static char *ref_to_path(struct btrfs_root *fs_root, | 1178 | char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, |
1181 | struct btrfs_path *path, | 1179 | u32 name_len, unsigned long name_off, |
1182 | u32 name_len, unsigned long name_off, | 1180 | struct extent_buffer *eb_in, u64 parent, |
1183 | struct extent_buffer *eb_in, u64 parent, | 1181 | char *dest, u32 size) |
1184 | char *dest, u32 size) | ||
1185 | { | 1182 | { |
1186 | int slot; | 1183 | int slot; |
1187 | u64 next_inum; | 1184 | u64 next_inum; |
1188 | int ret; | 1185 | int ret; |
1189 | s64 bytes_left = size - 1; | 1186 | s64 bytes_left = ((s64)size) - 1; |
1190 | struct extent_buffer *eb = eb_in; | 1187 | struct extent_buffer *eb = eb_in; |
1191 | struct btrfs_key found_key; | 1188 | struct btrfs_key found_key; |
1192 | int leave_spinning = path->leave_spinning; | 1189 | int leave_spinning = path->leave_spinning; |
@@ -1266,10 +1263,10 @@ char *btrfs_iref_to_path(struct btrfs_root *fs_root, | |||
1266 | struct extent_buffer *eb_in, u64 parent, | 1263 | struct extent_buffer *eb_in, u64 parent, |
1267 | char *dest, u32 size) | 1264 | char *dest, u32 size) |
1268 | { | 1265 | { |
1269 | return ref_to_path(fs_root, path, | 1266 | return btrfs_ref_to_path(fs_root, path, |
1270 | btrfs_inode_ref_name_len(eb_in, iref), | 1267 | btrfs_inode_ref_name_len(eb_in, iref), |
1271 | (unsigned long)(iref + 1), | 1268 | (unsigned long)(iref + 1), |
1272 | eb_in, parent, dest, size); | 1269 | eb_in, parent, dest, size); |
1273 | } | 1270 | } |
1274 | 1271 | ||
1275 | /* | 1272 | /* |
@@ -1715,9 +1712,8 @@ static int inode_to_path(u64 inum, u32 name_len, unsigned long name_off, | |||
1715 | ipath->fspath->bytes_left - s_ptr : 0; | 1712 | ipath->fspath->bytes_left - s_ptr : 0; |
1716 | 1713 | ||
1717 | fspath_min = (char *)ipath->fspath->val + (i + 1) * s_ptr; | 1714 | fspath_min = (char *)ipath->fspath->val + (i + 1) * s_ptr; |
1718 | fspath = ref_to_path(ipath->fs_root, ipath->btrfs_path, name_len, | 1715 | fspath = btrfs_ref_to_path(ipath->fs_root, ipath->btrfs_path, name_len, |
1719 | name_off, eb, inum, fspath_min, | 1716 | name_off, eb, inum, fspath_min, bytes_left); |
1720 | bytes_left); | ||
1721 | if (IS_ERR(fspath)) | 1717 | if (IS_ERR(fspath)) |
1722 | return PTR_ERR(fspath); | 1718 | return PTR_ERR(fspath); |
1723 | 1719 | ||