|
@@ -3528,7 +3528,7 @@ void btrfs_evict_inode(struct inode *inode)
|
|
|
struct btrfs_trans_handle *trans;
|
|
|
struct btrfs_root *root = BTRFS_I(inode)->root;
|
|
|
struct btrfs_block_rsv *rsv;
|
|
|
- u64 min_size = btrfs_calc_trans_metadata_size(root, 2);
|
|
|
+ u64 min_size = btrfs_calc_trunc_metadata_size(root, 1);
|
|
|
unsigned long nr;
|
|
|
int ret;
|
|
|
|
|
@@ -6482,7 +6482,7 @@ static int btrfs_truncate(struct inode *inode)
|
|
|
struct btrfs_trans_handle *trans;
|
|
|
unsigned long nr;
|
|
|
u64 mask = root->sectorsize - 1;
|
|
|
- u64 min_size = btrfs_calc_trans_metadata_size(root, 2);
|
|
|
+ u64 min_size = btrfs_calc_trunc_metadata_size(root, 1);
|
|
|
|
|
|
ret = btrfs_truncate_page(inode->i_mapping, inode->i_size);
|
|
|
if (ret)
|
|
@@ -6532,12 +6532,12 @@ static int btrfs_truncate(struct inode *inode)
|
|
|
return -ENOMEM;
|
|
|
|
|
|
/*
|
|
|
- * 2 for the truncate slack space
|
|
|
+ * 1 for the truncate slack space
|
|
|
* 1 for the orphan item we're going to add
|
|
|
* 1 for the orphan item deletion
|
|
|
* 1 for updating the inode.
|
|
|
*/
|
|
|
- trans = btrfs_start_transaction(root, 5);
|
|
|
+ trans = btrfs_start_transaction(root, 4);
|
|
|
if (IS_ERR(trans)) {
|
|
|
err = PTR_ERR(trans);
|
|
|
goto out;
|