aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-08-30 12:34:28 -0400
committerJosef Bacik <josef@redhat.com>2011-10-19 15:12:44 -0400
commit4a92b1b8d2810db4ea0c34616b94c0b3810fa027 (patch)
treedd01cff1987b8178be84f8b750951497b7f525a7 /fs/btrfs/transaction.c
parentd02c9955ded7fc56dd1edc987558b084ccb03eb4 (diff)
Btrfs: stop passing a trans handle all around the reservation code
The only thing that we need to have a trans handle for is in reserve_metadata_bytes and thats to know how much flushing we can do. So instead of passing it around, just check current->journal_info for a trans_handle so we know if we can commit a transaction to try and free up space or not. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index a770f4bd9d31..8d6f4c78f73f 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -275,7 +275,7 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,
275 */ 275 */
276 if (num_items > 0 && root != root->fs_info->chunk_root) { 276 if (num_items > 0 && root != root->fs_info->chunk_root) {
277 num_bytes = btrfs_calc_trans_metadata_size(root, num_items); 277 num_bytes = btrfs_calc_trans_metadata_size(root, num_items);
278 ret = btrfs_block_rsv_add(NULL, root, 278 ret = btrfs_block_rsv_add(root,
279 &root->fs_info->trans_block_rsv, 279 &root->fs_info->trans_block_rsv,
280 num_bytes); 280 num_bytes);
281 if (ret) 281 if (ret)
@@ -418,8 +418,8 @@ static int should_end_transaction(struct btrfs_trans_handle *trans,
418 struct btrfs_root *root) 418 struct btrfs_root *root)
419{ 419{
420 int ret; 420 int ret;
421 ret = btrfs_block_rsv_check(trans, root, 421 ret = btrfs_block_rsv_check(root, &root->fs_info->global_block_rsv, 0,
422 &root->fs_info->global_block_rsv, 0, 5, 0); 422 5, 0);
423 return ret ? 1 : 0; 423 return ret ? 1 : 0;
424} 424}
425 425
@@ -914,7 +914,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
914 btrfs_reloc_pre_snapshot(trans, pending, &to_reserve); 914 btrfs_reloc_pre_snapshot(trans, pending, &to_reserve);
915 915
916 if (to_reserve > 0) { 916 if (to_reserve > 0) {
917 ret = btrfs_block_rsv_add(trans, root, &pending->block_rsv, 917 ret = btrfs_block_rsv_add(root, &pending->block_rsv,
918 to_reserve); 918 to_reserve);
919 if (ret) { 919 if (ret) {
920 pending->error = ret; 920 pending->error = ret;