Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349608
b: refs/heads/master
c: eb6b88d
h: refs/heads/master
v: v3
  • Loading branch information
Jan Schmidt authored and Chris Mason committed Feb 6, 2013
1 parent 52502a8 commit 9aadc24
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24f8ebe9189c91f1b3ecfaadd27ef0cb7c74907f
refs/heads/master: eb6b88d92c6df083dd09a8c471011e3788dfd7c6
22 changes: 10 additions & 12 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4534,7 +4534,7 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes)
unsigned nr_extents = 0;
int extra_reserve = 0;
enum btrfs_reserve_flush_enum flush = BTRFS_RESERVE_FLUSH_ALL;
int ret;
int ret = 0;
bool delalloc_lock = true;

/* If we are a free space inode we need to not flush since we will be in
Expand Down Expand Up @@ -4579,20 +4579,18 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes)
csum_bytes = BTRFS_I(inode)->csum_bytes;
spin_unlock(&BTRFS_I(inode)->lock);

if (root->fs_info->quota_enabled) {
if (root->fs_info->quota_enabled)
ret = btrfs_qgroup_reserve(root, num_bytes +
nr_extents * root->leafsize);
if (ret) {
spin_lock(&BTRFS_I(inode)->lock);
calc_csum_metadata_size(inode, num_bytes, 0);
spin_unlock(&BTRFS_I(inode)->lock);
if (delalloc_lock)
mutex_unlock(&BTRFS_I(inode)->delalloc_mutex);
return ret;
}
}

ret = reserve_metadata_bytes(root, block_rsv, to_reserve, flush);
/*
* ret != 0 here means the qgroup reservation failed, we go straight to
* the shared error handling then.
*/
if (ret == 0)
ret = reserve_metadata_bytes(root, block_rsv,
to_reserve, flush);

if (ret) {
u64 to_free = 0;
unsigned dropped;
Expand Down

0 comments on commit 9aadc24

Please sign in to comment.