Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310833
b: refs/heads/master
c: 3d7806e
h: refs/heads/master
i:
  310831: d9ae608
v: v3
  • Loading branch information
Jan Schmidt committed Jun 14, 2012
1 parent 44f2420 commit 9280b6f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a95236d99fa56766f11056903439f55fe5038bcf
refs/heads/master: 3d7806eca43e73a9721d2e09369200ed93036bd0
7 changes: 4 additions & 3 deletions trunk/fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ static int __add_prelim_ref(struct list_head *head, u64 root_id,

static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path,
struct ulist *parents, int level,
struct btrfs_key *key, u64 wanted_disk_byte,
struct btrfs_key *key, u64 time_seq,
u64 wanted_disk_byte,
const u64 *extent_item_pos)
{
int ret;
Expand Down Expand Up @@ -212,7 +213,7 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path,
*/
while (1) {
eie = NULL;
ret = btrfs_next_leaf(root, path);
ret = btrfs_next_old_leaf(root, path, time_seq);
if (ret < 0)
return ret;
if (ret)
Expand Down Expand Up @@ -297,7 +298,7 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
if (level == 0)
btrfs_item_key_to_cpu(eb, &key, path->slots[0]);

ret = add_all_parents(root, path, parents, level, &key,
ret = add_all_parents(root, path, parents, level, &key, time_seq,
ref->wanted_disk_byte, extent_item_pos);
out:
btrfs_free_path(path);
Expand Down
11 changes: 10 additions & 1 deletion trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -5016,6 +5016,12 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
* returns < 0 on io errors.
*/
int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
{
return btrfs_next_old_leaf(root, path, 0);
}

int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
u64 time_seq)
{
int slot;
int level;
Expand All @@ -5041,7 +5047,10 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
path->keep_locks = 1;
path->leave_spinning = 1;

ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (time_seq)
ret = btrfs_search_old_slot(root, &key, path, time_seq);
else
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
path->keep_locks = 0;

if (ret < 0)
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -2753,6 +2753,8 @@ static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans,
}

int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path);
int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
u64 time_seq);
static inline int btrfs_next_item(struct btrfs_root *root, struct btrfs_path *p)
{
++p->slots[0];
Expand Down

0 comments on commit 9280b6f

Please sign in to comment.