Btrfs: use a btree inode instead of sb_getblk
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 176c6dc..b2ae8e7 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -172,8 +172,8 @@
struct buffer_head *bh;
if (!pending) {
- bh = sb_find_get_block(root->fs_info->sb, blocknr);
- if (bh) {
+ bh = btrfs_find_tree_block(root, blocknr);
+ if (bh && buffer_uptodate(bh)) {
header = btrfs_buffer_header(bh);
if (btrfs_header_generation(header) ==
root->fs_info->running_transaction->transid) {
@@ -291,12 +291,10 @@
*root, u64 blocknr, u64 num_blocks, int pin)
{
struct btrfs_root *extent_root = root->fs_info->extent_root;
- struct buffer_head *t;
int pending_ret;
int ret;
if (root == extent_root) {
- t = find_tree_block(root, blocknr);
pin_down_block(root, blocknr, 1);
return 0;
}
@@ -482,7 +480,7 @@
BUG();
return NULL;
}
- buf = find_tree_block(root, ins.objectid);
+ buf = btrfs_find_create_tree_block(root, ins.objectid);
set_buffer_uptodate(buf);
return buf;
}