summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-09-11 15:54:42 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:07 -0400
commitd00aff00139b40f2e9c60299d76aac29d72e48ba (patch)
tree3ef3d84c42dc809cd92ab6339abd968fdede357d /fs/btrfs/tree-log.c
parent3a5f1d458ad1610a06e38f0be2fbc6ac215439c0 (diff)
Btrfs: Optimize tree log block allocations
Since tree log blocks get freed every transaction, they never really need to be written to disk. This skips the step where we update metadata to record they were allocated. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index f43ee33ec2d..5f77bee0f84 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -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);
@@ -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]);
@@ -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]);
@@ -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);
}
}