diff options
-rw-r--r-- | fs/btrfs/ctree.h | 2 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 | ||||
-rw-r--r-- | fs/btrfs/free-space-cache.c | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 6 | ||||
-rw-r--r-- | fs/btrfs/relocation.c | 4 | ||||
-rw-r--r-- | fs/btrfs/transaction.c | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 2e18b068841b..caa73cd8c00a 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2244,7 +2244,7 @@ int btrfs_block_rsv_add(struct btrfs_trans_handle *trans, | |||
2244 | int btrfs_block_rsv_check(struct btrfs_trans_handle *trans, | 2244 | int btrfs_block_rsv_check(struct btrfs_trans_handle *trans, |
2245 | struct btrfs_root *root, | 2245 | struct btrfs_root *root, |
2246 | struct btrfs_block_rsv *block_rsv, | 2246 | struct btrfs_block_rsv *block_rsv, |
2247 | u64 min_reserved, int min_factor); | 2247 | u64 min_reserved, int min_factor, int flush); |
2248 | int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src_rsv, | 2248 | int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src_rsv, |
2249 | struct btrfs_block_rsv *dst_rsv, | 2249 | struct btrfs_block_rsv *dst_rsv, |
2250 | u64 num_bytes); | 2250 | u64 num_bytes); |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index d05967e9d613..a71fcf506531 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3705,7 +3705,7 @@ int btrfs_block_rsv_add(struct btrfs_trans_handle *trans, | |||
3705 | int btrfs_block_rsv_check(struct btrfs_trans_handle *trans, | 3705 | int btrfs_block_rsv_check(struct btrfs_trans_handle *trans, |
3706 | struct btrfs_root *root, | 3706 | struct btrfs_root *root, |
3707 | struct btrfs_block_rsv *block_rsv, | 3707 | struct btrfs_block_rsv *block_rsv, |
3708 | u64 min_reserved, int min_factor) | 3708 | u64 min_reserved, int min_factor, int flush) |
3709 | { | 3709 | { |
3710 | u64 num_bytes = 0; | 3710 | u64 num_bytes = 0; |
3711 | int ret = -ENOSPC; | 3711 | int ret = -ENOSPC; |
@@ -3728,7 +3728,7 @@ int btrfs_block_rsv_check(struct btrfs_trans_handle *trans, | |||
3728 | if (!ret) | 3728 | if (!ret) |
3729 | return 0; | 3729 | return 0; |
3730 | 3730 | ||
3731 | ret = reserve_metadata_bytes(trans, root, block_rsv, num_bytes, 0); | 3731 | ret = reserve_metadata_bytes(trans, root, block_rsv, num_bytes, flush); |
3732 | if (!ret) { | 3732 | if (!ret) { |
3733 | block_rsv_add_bytes(block_rsv, num_bytes, 0); | 3733 | block_rsv_add_bytes(block_rsv, num_bytes, 0); |
3734 | return 0; | 3734 | return 0; |
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index ecc1a4f85d20..b0122e19db6b 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -199,7 +199,7 @@ int btrfs_truncate_free_space_cache(struct btrfs_root *root, | |||
199 | trans->block_rsv = root->orphan_block_rsv; | 199 | trans->block_rsv = root->orphan_block_rsv; |
200 | ret = btrfs_block_rsv_check(trans, root, | 200 | ret = btrfs_block_rsv_check(trans, root, |
201 | root->orphan_block_rsv, | 201 | root->orphan_block_rsv, |
202 | 0, 5); | 202 | 0, 5, 0); |
203 | if (ret) | 203 | if (ret) |
204 | return ret; | 204 | return ret; |
205 | 205 | ||
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8316b570db55..e40b9239660d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -3576,10 +3576,10 @@ void btrfs_evict_inode(struct inode *inode) | |||
3576 | * doing the truncate. | 3576 | * doing the truncate. |
3577 | */ | 3577 | */ |
3578 | while (1) { | 3578 | while (1) { |
3579 | ret = btrfs_block_rsv_check(NULL, root, rsv, min_size, 0); | 3579 | ret = btrfs_block_rsv_check(NULL, root, rsv, min_size, 0, 1); |
3580 | if (ret) { | 3580 | if (ret) { |
3581 | printk(KERN_WARNING "Could not get space for a " | 3581 | printk(KERN_WARNING "Could not get space for a " |
3582 | "delete, will truncate on mount\n"); | 3582 | "delete, will truncate on mount %d\n", ret); |
3583 | btrfs_orphan_del(NULL, inode); | 3583 | btrfs_orphan_del(NULL, inode); |
3584 | btrfs_free_block_rsv(root, rsv); | 3584 | btrfs_free_block_rsv(root, rsv); |
3585 | goto no_delete; | 3585 | goto no_delete; |
@@ -6575,7 +6575,7 @@ static int btrfs_truncate(struct inode *inode) | |||
6575 | btrfs_add_ordered_operation(trans, root, inode); | 6575 | btrfs_add_ordered_operation(trans, root, inode); |
6576 | 6576 | ||
6577 | while (1) { | 6577 | while (1) { |
6578 | ret = btrfs_block_rsv_check(trans, root, rsv, min_size, 0); | 6578 | ret = btrfs_block_rsv_check(trans, root, rsv, min_size, 0, 1); |
6579 | if (ret) { | 6579 | if (ret) { |
6580 | /* | 6580 | /* |
6581 | * This can only happen with the original transaction we | 6581 | * This can only happen with the original transaction we |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index aeaed99e9cfe..fd9ac66434b0 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -2042,7 +2042,7 @@ static noinline_for_stack int merge_reloc_root(struct reloc_control *rc, | |||
2042 | trans->block_rsv = rc->block_rsv; | 2042 | trans->block_rsv = rc->block_rsv; |
2043 | 2043 | ||
2044 | ret = btrfs_block_rsv_check(trans, root, rc->block_rsv, | 2044 | ret = btrfs_block_rsv_check(trans, root, rc->block_rsv, |
2045 | min_reserved, 0); | 2045 | min_reserved, 0, 0); |
2046 | if (ret) { | 2046 | if (ret) { |
2047 | BUG_ON(ret != -EAGAIN); | 2047 | BUG_ON(ret != -EAGAIN); |
2048 | ret = btrfs_commit_transaction(trans, root); | 2048 | ret = btrfs_commit_transaction(trans, root); |
@@ -3775,7 +3775,7 @@ restart: | |||
3775 | } | 3775 | } |
3776 | 3776 | ||
3777 | ret = btrfs_block_rsv_check(trans, rc->extent_root, | 3777 | ret = btrfs_block_rsv_check(trans, rc->extent_root, |
3778 | rc->block_rsv, 0, 5); | 3778 | rc->block_rsv, 0, 5, 0); |
3779 | if (ret < 0) { | 3779 | if (ret < 0) { |
3780 | if (ret != -EAGAIN) { | 3780 | if (ret != -EAGAIN) { |
3781 | err = ret; | 3781 | err = ret; |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 3e20cc8c1c06..a1d8c322c1ba 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -419,7 +419,7 @@ static int should_end_transaction(struct btrfs_trans_handle *trans, | |||
419 | { | 419 | { |
420 | int ret; | 420 | int ret; |
421 | ret = btrfs_block_rsv_check(trans, root, | 421 | ret = btrfs_block_rsv_check(trans, root, |
422 | &root->fs_info->global_block_rsv, 0, 5); | 422 | &root->fs_info->global_block_rsv, 0, 5, 0); |
423 | return ret ? 1 : 0; | 423 | return ret ? 1 : 0; |
424 | } | 424 | } |
425 | 425 | ||