diff options
| -rw-r--r-- | fs/btrfs/extent-tree.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 92146a5afdc1..96c613bfe157 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
| @@ -5110,7 +5110,11 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes) | |||
| 5110 | num_bytes = ALIGN(num_bytes, root->sectorsize); | 5110 | num_bytes = ALIGN(num_bytes, root->sectorsize); |
| 5111 | 5111 | ||
| 5112 | spin_lock(&BTRFS_I(inode)->lock); | 5112 | spin_lock(&BTRFS_I(inode)->lock); |
| 5113 | BTRFS_I(inode)->outstanding_extents++; | 5113 | nr_extents = (unsigned)div64_u64(num_bytes + |
| 5114 | BTRFS_MAX_EXTENT_SIZE - 1, | ||
| 5115 | BTRFS_MAX_EXTENT_SIZE); | ||
| 5116 | BTRFS_I(inode)->outstanding_extents += nr_extents; | ||
| 5117 | nr_extents = 0; | ||
| 5114 | 5118 | ||
| 5115 | if (BTRFS_I(inode)->outstanding_extents > | 5119 | if (BTRFS_I(inode)->outstanding_extents > |
| 5116 | BTRFS_I(inode)->reserved_extents) | 5120 | BTRFS_I(inode)->reserved_extents) |
