diff options
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index fd105c172c8b..faef1d64394d 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2549,7 +2549,6 @@ static long btrfs_fallocate(struct file *file, int mode, { struct inode *inode = file_inode(file); struct extent_state *cached_state = NULL; - struct btrfs_root *root = BTRFS_I(inode)->root; u64 cur_offset; u64 last_byte; u64 alloc_start; @@ -2577,11 +2576,6 @@ static long btrfs_fallocate(struct file *file, int mode, ret = btrfs_check_data_free_space(inode, alloc_end - alloc_start); if (ret) return ret; - if (root->fs_info->quota_enabled) { - ret = btrfs_qgroup_reserve(root, alloc_end - alloc_start); - if (ret) - goto out_reserve_fail; - } mutex_lock(&inode->i_mutex); ret = inode_newsize_ok(inode, alloc_end); @@ -2674,6 +2668,7 @@ static long btrfs_fallocate(struct file *file, int mode, } else if (actual_end > inode->i_size && !(mode & FALLOC_FL_KEEP_SIZE)) { struct btrfs_trans_handle *trans; + struct btrfs_root *root = BTRFS_I(inode)->root; /* * We didn't need to allocate any more space, but we @@ -2710,9 +2705,6 @@ static long btrfs_fallocate(struct file *file, int mode, &cached_state, GFP_NOFS); out: mutex_unlock(&inode->i_mutex); - if (root->fs_info->quota_enabled) - btrfs_qgroup_free(root, alloc_end - alloc_start); -out_reserve_fail: /* Let go of our reservation. */ btrfs_free_reserved_data_space(inode, alloc_end - alloc_start); return ret; |