diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2015-10-08 06:19:37 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-10-21 21:41:09 -0400 |
commit | 51773bec7ea352f3b9afa11ecfc72324c7977335 (patch) | |
tree | 3d2c52d2424e01df54e3ac6bd060028d293235b1 /fs/btrfs/inode.c | |
parent | 14524a846eb52c18438e9bd5eb8cf1431fd57b44 (diff) |
btrfs: qgroup: Avoid calling btrfs_free_reserved_data_space in clear_bit_hook
In clear_bit_hook, qgroup reserved data is already handled quite well,
either released by finish_ordered_io or invalidatepage.
So calling btrfs_qgroup_free_data() here is completely meaningless, and
since btrfs_qgroup_free_data() will lock io_tree, so it can't be called
with io_tree lock hold.
This patch will add a new function
btrfs_free_reserved_data_space_noquota() for clear_bit_hook() to cease
the lockdep warning.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 6670792704e8..3229c1346ea2 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1776,8 +1776,8 @@ static void btrfs_clear_bit_hook(struct inode *inode, | |||
1776 | 1776 | ||
1777 | if (root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID | 1777 | if (root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID |
1778 | && do_list && !(state->state & EXTENT_NORESERVE)) | 1778 | && do_list && !(state->state & EXTENT_NORESERVE)) |
1779 | btrfs_free_reserved_data_space(inode, state->start, | 1779 | btrfs_free_reserved_data_space_noquota(inode, |
1780 | len); | 1780 | state->start, len); |
1781 | 1781 | ||
1782 | __percpu_counter_add(&root->fs_info->delalloc_bytes, -len, | 1782 | __percpu_counter_add(&root->fs_info->delalloc_bytes, -len, |
1783 | root->fs_info->delalloc_batch); | 1783 | root->fs_info->delalloc_batch); |