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>
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 78b5ae5..2947e94 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3577,7 +3577,7 @@
* doing the truncate.
*/
while (1) {
- ret = btrfs_block_rsv_check(NULL, root, rsv, min_size, 0, 1);
+ ret = btrfs_block_rsv_check(root, rsv, min_size, 0, 1);
if (ret) {
printk(KERN_WARNING "Could not get space for a "
"delete, will truncate on mount %d\n", ret);
@@ -6577,7 +6577,7 @@
btrfs_add_ordered_operation(trans, root, inode);
while (1) {
- ret = btrfs_block_rsv_check(trans, root, rsv, min_size, 0, 1);
+ ret = btrfs_block_rsv_check(root, rsv, min_size, 0, 1);
if (ret) {
/*
* This can only happen with the original transaction we