File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -7772,6 +7772,7 @@ static int btrfs_get_blocks_direct_write(struct extent_map **map,
7772
7772
u64 block_start , orig_start , orig_block_len , ram_bytes ;
7773
7773
bool can_nocow = false;
7774
7774
bool space_reserved = false;
7775
+ u64 prev_len ;
7775
7776
int ret = 0 ;
7776
7777
7777
7778
/*
@@ -7799,6 +7800,7 @@ static int btrfs_get_blocks_direct_write(struct extent_map **map,
7799
7800
can_nocow = true;
7800
7801
}
7801
7802
7803
+ prev_len = len ;
7802
7804
if (can_nocow ) {
7803
7805
struct extent_map * em2 ;
7804
7806
@@ -7828,8 +7830,6 @@ static int btrfs_get_blocks_direct_write(struct extent_map **map,
7828
7830
goto out ;
7829
7831
}
7830
7832
} else {
7831
- const u64 prev_len = len ;
7832
-
7833
7833
/* Our caller expects us to free the input extent map. */
7834
7834
free_extent_map (em );
7835
7835
* map = NULL ;
@@ -7860,7 +7860,7 @@ static int btrfs_get_blocks_direct_write(struct extent_map **map,
7860
7860
* We have created our ordered extent, so we can now release our reservation
7861
7861
* for an outstanding extent.
7862
7862
*/
7863
- btrfs_delalloc_release_extents (BTRFS_I (inode ), len );
7863
+ btrfs_delalloc_release_extents (BTRFS_I (inode ), prev_len );
7864
7864
7865
7865
/*
7866
7866
* Need to update the i_size under the extent lock so buffered
You can’t perform that action at this time.
0 commit comments