Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128937
b: refs/heads/master
c: d00aff0
h: refs/heads/master
i:
  128935: 55b9cd9
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 089f058 commit 61bc6dd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 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: 3a5f1d458ad1610a06e38f0be2fbc6ac215439c0
refs/heads/master: d00aff00139b40f2e9c60299d76aac29d72e48ba
5 changes: 2 additions & 3 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,8 @@ int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans,
WARN_ON(btrfs_header_level(eb) != 0);
WARN_ON(btrfs_header_nritems(eb) != 0);

ret = btrfs_free_extent(trans, fs_info->tree_root,
eb->start, eb->len,
BTRFS_TREE_LOG_OBJECTID, 0, 0, 0, 1);
ret = btrfs_free_reserved_extent(fs_info->tree_root,
eb->start, eb->len);
BUG_ON(ret);

free_extent_buffer(eb);
Expand Down
19 changes: 14 additions & 5 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1872,8 +1872,15 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
return 0;
}
/* if metadata always pin */
if (owner_objectid < BTRFS_FIRST_FREE_OBJECTID)
if (owner_objectid < BTRFS_FIRST_FREE_OBJECTID) {
if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) {
/* btrfs_free_reserved_extent */
set_extent_dirty(&root->fs_info->free_space_cache,
bytenr, bytenr + num_bytes - 1, GFP_NOFS);
return 0;
}
pin = 1;
}

/* if data pin when any transaction has committed this */
if (ref_generation != trans->transid)
Expand Down Expand Up @@ -2361,11 +2368,13 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
min_alloc_size, empty_size, hint_byte,
search_end, ins, data);
BUG_ON(ret);
ret = __btrfs_alloc_reserved_extent(trans, root, root_objectid,
ref_generation, owner,
owner_offset, ins);
BUG_ON(ret);
if (root_objectid != BTRFS_TREE_LOG_OBJECTID) {
ret = __btrfs_alloc_reserved_extent(trans, root, root_objectid,
ref_generation, owner,
owner_offset, ins);
BUG_ON(ret);

}
maybe_unlock_mutex(root);
return ret;
}
Expand Down
20 changes: 7 additions & 13 deletions trunk/fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -1728,9 +1728,8 @@ static int noinline walk_down_log_tree(struct btrfs_trans_handle *trans,

WARN_ON(root_owner !=
BTRFS_TREE_LOG_OBJECTID);
ret = btrfs_free_extent(trans, root, bytenr,
blocksize, root_owner,
root_gen, 0, 0, 1);
ret = btrfs_free_reserved_extent(root,
bytenr, blocksize);
BUG_ON(ret);
}
free_extent_buffer(next);
Expand Down Expand Up @@ -1775,8 +1774,7 @@ static int noinline walk_down_log_tree(struct btrfs_trans_handle *trans,
BUG_ON(ret);
}
WARN_ON(root_owner != BTRFS_TREE_LOG_OBJECTID);
ret = btrfs_free_extent(trans, root, bytenr, blocksize,
root_owner, root_gen, 0, 0, 1);
ret = btrfs_free_reserved_extent(root, bytenr, blocksize);
BUG_ON(ret);
}
free_extent_buffer(path->nodes[*level]);
Expand Down Expand Up @@ -1837,10 +1835,9 @@ static int noinline walk_up_log_tree(struct btrfs_trans_handle *trans,
}

WARN_ON(root_owner != BTRFS_TREE_LOG_OBJECTID);
ret = btrfs_free_extent(trans, root,
ret = btrfs_free_reserved_extent(root,
path->nodes[*level]->start,
path->nodes[*level]->len,
root_owner, root_gen, 0, 0, 1);
path->nodes[*level]->len);
BUG_ON(ret);
}
free_extent_buffer(path->nodes[*level]);
Expand Down Expand Up @@ -1910,11 +1907,8 @@ static int walk_log_tree(struct btrfs_trans_handle *trans,
}
WARN_ON(log->root_key.objectid !=
BTRFS_TREE_LOG_OBJECTID);
ret = btrfs_free_extent(trans, log,
next->start, next->len,
log->root_key.objectid,
btrfs_header_generation(next),
0, 0, 1);
ret = btrfs_free_reserved_extent(log, next->start,
next->len);
BUG_ON(ret);
}
}
Expand Down

0 comments on commit 61bc6dd

Please sign in to comment.