Commit cfdd4592 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: make btrfs_qgroup_check_reserved_leak take btrfs_inode

vfs_inode is used only for the inode number everything else requires
btrfs_inode.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
[ use btrfs_ino ]
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent d9094414
...@@ -8631,7 +8631,7 @@ void btrfs_destroy_inode(struct inode *inode) ...@@ -8631,7 +8631,7 @@ void btrfs_destroy_inode(struct inode *inode)
btrfs_put_ordered_extent(ordered); btrfs_put_ordered_extent(ordered);
} }
} }
btrfs_qgroup_check_reserved_leak(inode); btrfs_qgroup_check_reserved_leak(BTRFS_I(inode));
inode_tree_del(inode); inode_tree_del(inode);
btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0);
btrfs_inode_clear_file_extent_range(BTRFS_I(inode), 0, (u64)-1); btrfs_inode_clear_file_extent_range(BTRFS_I(inode), 0, (u64)-1);
......
...@@ -3784,7 +3784,7 @@ void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes) ...@@ -3784,7 +3784,7 @@ void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes)
* Check qgroup reserved space leaking, normally at destroy inode * Check qgroup reserved space leaking, normally at destroy inode
* time * time
*/ */
void btrfs_qgroup_check_reserved_leak(struct inode *inode) void btrfs_qgroup_check_reserved_leak(struct btrfs_inode *inode)
{ {
struct extent_changeset changeset; struct extent_changeset changeset;
struct ulist_node *unode; struct ulist_node *unode;
...@@ -3792,19 +3792,19 @@ void btrfs_qgroup_check_reserved_leak(struct inode *inode) ...@@ -3792,19 +3792,19 @@ void btrfs_qgroup_check_reserved_leak(struct inode *inode)
int ret; int ret;
extent_changeset_init(&changeset); extent_changeset_init(&changeset);
ret = clear_record_extent_bits(&BTRFS_I(inode)->io_tree, 0, (u64)-1, ret = clear_record_extent_bits(&inode->io_tree, 0, (u64)-1,
EXTENT_QGROUP_RESERVED, &changeset); EXTENT_QGROUP_RESERVED, &changeset);
WARN_ON(ret < 0); WARN_ON(ret < 0);
if (WARN_ON(changeset.bytes_changed)) { if (WARN_ON(changeset.bytes_changed)) {
ULIST_ITER_INIT(&iter); ULIST_ITER_INIT(&iter);
while ((unode = ulist_next(&changeset.range_changed, &iter))) { while ((unode = ulist_next(&changeset.range_changed, &iter))) {
btrfs_warn(BTRFS_I(inode)->root->fs_info, btrfs_warn(inode->root->fs_info,
"leaking qgroup reserved space, ino: %lu, start: %llu, end: %llu", "leaking qgroup reserved space, ino: %llu, start: %llu, end: %llu",
inode->i_ino, unode->val, unode->aux); btrfs_ino(inode), unode->val, unode->aux);
} }
btrfs_qgroup_free_refroot(BTRFS_I(inode)->root->fs_info, btrfs_qgroup_free_refroot(inode->root->fs_info,
BTRFS_I(inode)->root->root_key.objectid, inode->root->root_key.objectid,
changeset.bytes_changed, BTRFS_QGROUP_RSV_DATA); changeset.bytes_changed, BTRFS_QGROUP_RSV_DATA);
} }
......
...@@ -399,7 +399,7 @@ void btrfs_qgroup_free_meta_all_pertrans(struct btrfs_root *root); ...@@ -399,7 +399,7 @@ void btrfs_qgroup_free_meta_all_pertrans(struct btrfs_root *root);
*/ */
void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes); void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes);
void btrfs_qgroup_check_reserved_leak(struct inode *inode); void btrfs_qgroup_check_reserved_leak(struct btrfs_inode *inode);
/* btrfs_qgroup_swapped_blocks related functions */ /* btrfs_qgroup_swapped_blocks related functions */
void btrfs_qgroup_init_swapped_blocks( void btrfs_qgroup_init_swapped_blocks(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment