Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128479
b: refs/heads/master
c: f510cfe
h: refs/heads/master
i:
  128477: e8d84ad
  128475: 2878cbe
  128471: 4ada096
  128463: e1b912e
  128447: 7c56bb8
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent e2863e7 commit 5a0651e
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 88 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: ae5252bd51a252b7b8b02289337c36774835101c
refs/heads/master: f510cfecfc98759d75283823cfccf0cc0d59a4c6
10 changes: 8 additions & 2 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ static int __btrfs_cow_block(struct btrfs_trans_handle *trans,
if (IS_ERR(cow))
return PTR_ERR(cow);

cow->alloc_addr = (unsigned long)__builtin_return_address(0);
if (buf->len != root->sectorsize || cow->len != root->sectorsize)
WARN_ON(1);

Expand Down Expand Up @@ -132,6 +133,7 @@ int btrfs_cow_block(struct btrfs_trans_handle *trans,
struct extent_buffer **cow_ret)
{
u64 search_start;
int ret;
if (trans->transaction != root->fs_info->running_transaction) {
printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid,
root->fs_info->running_transaction->transid);
Expand All @@ -148,8 +150,10 @@ int btrfs_cow_block(struct btrfs_trans_handle *trans,
}

search_start = extent_buffer_blocknr(buf) & ~((u64)65535);
return __btrfs_cow_block(trans, root, buf, parent,
ret = __btrfs_cow_block(trans, root, buf, parent,
parent_slot, cow_ret, search_start, 0);
(*cow_ret)->alloc_addr = (unsigned long)__builtin_return_address(0);
return ret;
}

static int close_blocks(u64 blocknr, u64 other)
Expand Down Expand Up @@ -1013,8 +1017,10 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
if (sret)
return sret;
b = p->nodes[level];
if (!b)
if (!b) {
btrfs_release_path(NULL, p);
goto again;
}
slot = p->slots[level];
BUG_ON(btrfs_header_nritems(b) == 1);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ struct btrfs_fs_info {
struct radix_tree_root pinned_radix;
struct radix_tree_root block_group_radix;
struct radix_tree_root block_group_data_radix;
struct radix_tree_root extent_map_radix;
struct radix_tree_root extent_ins_radix;
struct extent_map_tree free_space_cache;
u64 generation;
u64 last_trans_committed;
struct btrfs_transaction *running_transaction;
Expand Down
17 changes: 14 additions & 3 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,25 @@ struct extent_buffer *btrfs_find_tree_block(struct btrfs_root *root,
u64 blocknr)
{
struct inode *btree_inode = root->fs_info->btree_inode;
return find_extent_buffer(&BTRFS_I(btree_inode)->extent_tree,
struct extent_buffer *eb;
eb = find_extent_buffer(&BTRFS_I(btree_inode)->extent_tree,
blocknr * root->sectorsize,
root->sectorsize, GFP_NOFS);
if (eb)
eb->alloc_addr = (unsigned long)__builtin_return_address(0);
return eb;
}

struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
u64 blocknr)
{
struct inode *btree_inode = root->fs_info->btree_inode;
return alloc_extent_buffer(&BTRFS_I(btree_inode)->extent_tree,
struct extent_buffer *eb;
eb = alloc_extent_buffer(&BTRFS_I(btree_inode)->extent_tree,
blocknr * root->sectorsize,
root->sectorsize, GFP_NOFS);
eb->alloc_addr = (unsigned long)__builtin_return_address(0);
return eb;
}

struct extent_map *btree_get_extent(struct inode *inode, struct page *page,
Expand Down Expand Up @@ -226,6 +233,7 @@ struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 blocknr)
return NULL;
read_extent_buffer_pages(&BTRFS_I(btree_inode)->extent_tree,
buf, 1);
buf->alloc_addr = (unsigned long)__builtin_return_address(0);
return buf;
}

Expand Down Expand Up @@ -426,7 +434,6 @@ struct btrfs_root *open_ctree(struct super_block *sb)
}
init_bit_radix(&fs_info->pinned_radix);
init_bit_radix(&fs_info->pending_del_radix);
init_bit_radix(&fs_info->extent_map_radix);
init_bit_radix(&fs_info->extent_ins_radix);
INIT_RADIX_TREE(&fs_info->fs_roots_radix, GFP_NOFS);
INIT_RADIX_TREE(&fs_info->block_group_radix, GFP_KERNEL);
Expand All @@ -449,6 +456,8 @@ struct btrfs_root *open_ctree(struct super_block *sb)
extent_map_tree_init(&BTRFS_I(fs_info->btree_inode)->extent_tree,
fs_info->btree_inode->i_mapping,
GFP_NOFS);
extent_map_tree_init(&fs_info->free_space_cache,
fs_info->btree_inode->i_mapping, GFP_NOFS);
fs_info->do_barriers = 1;
fs_info->closing = 0;

Expand Down Expand Up @@ -594,8 +603,10 @@ int close_ctree(struct btrfs_root *root)

if (fs_info->extent_root->node)
free_extent_buffer(fs_info->extent_root->node);

if (fs_info->tree_root->node)
free_extent_buffer(fs_info->tree_root->node);

free_extent_buffer(fs_info->sb_buffer);
truncate_inode_pages(fs_info->btree_inode->i_mapping, 0);
iput(fs_info->btree_inode);
Expand Down
Loading

0 comments on commit 5a0651e

Please sign in to comment.