summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-06-08 17:49:37 +0300
committerDavid Sterba <dsterba@suse.com>2018-10-23 14:48:41 +0200
commit6de2debdb0bb3bfac1483165b03c290696ef115c (patch)
treec427e4a0de7a2aa0d74491ae76d2bd511efbe40e /extent-tree.c
parent909357e86799a338f40c9e997d1e3ba4adde3f89 (diff)
btrfs-progs: Remove old delayed refs infrastructure
Given that the new delayed refs infrastructure is implemented and wired up, there is no point in keeping the old code. So just remove it. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c137
1 files changed, 0 insertions, 137 deletions
diff --git a/extent-tree.c b/extent-tree.c
index 977e2c9..fd3bd58 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -52,8 +52,6 @@ static int __free_extent(struct btrfs_trans_handle *trans,
u64 bytenr, u64 num_bytes, u64 parent,
u64 root_objectid, u64 owner_objectid,
u64 owner_offset, int refs_to_drop);
-static int finish_current_insert(struct btrfs_trans_handle *trans);
-static int del_pending_extents(struct btrfs_trans_handle *trans);
static struct btrfs_block_group_cache *
btrfs_find_block_group(struct btrfs_root *root, struct btrfs_block_group_cache
*hint, u64 search_start, int data, int owner);
@@ -1422,13 +1420,6 @@ out:
return err;
}
-int btrfs_extent_post_op(struct btrfs_trans_handle *trans)
-{
- finish_current_insert(trans);
- del_pending_extents(trans);
- return 0;
-}
-
int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u64 bytenr,
u64 offset, int metadata, u64 *refs, u64 *flags)
@@ -2012,74 +2003,6 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
return 0;
}
-static int extent_root_pending_ops(struct btrfs_fs_info *info)
-{
- u64 start;
- u64 end;
- int ret;
-
- ret = find_first_extent_bit(&info->extent_ins, 0, &start,
- &end, EXTENT_LOCKED);
- if (!ret) {
- ret = find_first_extent_bit(&info->pending_del, 0, &start, &end,
- EXTENT_LOCKED);
- }
- return ret == 0;
-
-}
-static int finish_current_insert(struct btrfs_trans_handle *trans)
-{
- u64 start;
- u64 end;
- u64 priv;
- struct btrfs_fs_info *info = trans->fs_info;
- struct btrfs_root *extent_root = info->extent_root;
- struct pending_extent_op *extent_op;
- struct btrfs_key key;
- int ret;
- int skinny_metadata =
- btrfs_fs_incompat(extent_root->fs_info, SKINNY_METADATA);
-
-
- while(1) {
- ret = find_first_extent_bit(&info->extent_ins, 0, &start,
- &end, EXTENT_LOCKED);
- if (ret)
- break;
-
- ret = get_state_private(&info->extent_ins, start, &priv);
- BUG_ON(ret);
- extent_op = (struct pending_extent_op *)(unsigned long)priv;
-
- if (extent_op->type == PENDING_EXTENT_INSERT) {
- key.objectid = start;
- if (skinny_metadata) {
- key.offset = extent_op->level;
- key.type = BTRFS_METADATA_ITEM_KEY;
- } else {
- key.offset = extent_op->num_bytes;
- key.type = BTRFS_EXTENT_ITEM_KEY;
- }
-
- ret = alloc_reserved_tree_block(trans,
- extent_root->root_key.objectid,
- trans->transid,
- extent_op->flags,
- &extent_op->key,
- extent_op->level, &key);
- BUG_ON(ret);
- } else {
- BUG_ON(1);
- }
-
-
- printf("shouldn't be executed\n");
- clear_extent_bits(&info->extent_ins, start, end, EXTENT_LOCKED);
- kfree(extent_op);
- }
- return 0;
-}
-
static int pin_down_bytes(struct btrfs_trans_handle *trans, u64 bytenr,
u64 num_bytes, int is_data)
{
@@ -2376,66 +2299,6 @@ fail:
return ret;
}
-/*
- * find all the blocks marked as pending in the radix tree and remove
- * them from the extent map
- */
-static int del_pending_extents(struct btrfs_trans_handle *trans)
-{
- int ret;
- int err = 0;
- u64 start;
- u64 end;
- u64 priv;
- struct extent_io_tree *pending_del;
- struct extent_io_tree *extent_ins;
- struct pending_extent_op *extent_op;
- struct btrfs_fs_info *fs_info = trans->fs_info;
- struct btrfs_root *extent_root = fs_info->extent_root;
-
- extent_ins = &extent_root->fs_info->extent_ins;
- pending_del = &extent_root->fs_info->pending_del;
-
- while(1) {
- ret = find_first_extent_bit(pending_del, 0, &start, &end,
- EXTENT_LOCKED);
- if (ret)
- break;
-
- ret = get_state_private(pending_del, start, &priv);
- BUG_ON(ret);
- extent_op = (struct pending_extent_op *)(unsigned long)priv;
-
- clear_extent_bits(pending_del, start, end, EXTENT_LOCKED);
-
- if (!test_range_bit(extent_ins, start, end,
- EXTENT_LOCKED, 0)) {
- ret = __free_extent(trans, start, end + 1 - start, 0,
- extent_root->root_key.objectid,
- extent_op->level, 0, 1);
- kfree(extent_op);
- } else {
- kfree(extent_op);
- ret = get_state_private(extent_ins, start, &priv);
- BUG_ON(ret);
- extent_op = (struct pending_extent_op *)
- (unsigned long)priv;
-
- clear_extent_bits(extent_ins, start, end,
- EXTENT_LOCKED);
-
- if (extent_op->type == PENDING_BACKREF_UPDATE)
- BUG_ON(1);
-
- kfree(extent_op);
- }
- if (ret)
- err = ret;
- }
- return err;
-}
-
-
int btrfs_free_tree_block(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct extent_buffer *buf,