diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-06-03 08:55:11 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-07-27 12:55:30 +0200 |
commit | 8b8a979f1fc69054f99abab80daeae89aba3f19b (patch) | |
tree | b0302db317fffb7f63ed91e7d997a3ed194c90a1 | |
parent | 8769af96cf6355ae96c808265a05171226b4b6e7 (diff) |
btrfs: make btrfs_qgroup_free_data take btrfs_inode
It passes btrfs_inode to its callee so change the interface.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/delalloc-space.c | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 7 | ||||
-rw-r--r-- | fs/btrfs/ordered-data.c | 3 | ||||
-rw-r--r-- | fs/btrfs/qgroup.c | 4 | ||||
-rw-r--r-- | fs/btrfs/qgroup.h | 6 |
5 files changed, 11 insertions, 11 deletions
diff --git a/fs/btrfs/delalloc-space.c b/fs/btrfs/delalloc-space.c index d05648f882ca..31440137accf 100644 --- a/fs/btrfs/delalloc-space.c +++ b/fs/btrfs/delalloc-space.c @@ -301,7 +301,7 @@ void btrfs_free_reserved_data_space(struct inode *inode, start = round_down(start, root->fs_info->sectorsize); btrfs_free_reserved_data_space_noquota(inode, len); - btrfs_qgroup_free_data(inode, reserved, start, len); + btrfs_qgroup_free_data(BTRFS_I(inode), reserved, start, len); } /** diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index bd51365e53fb..ec3d13303ebc 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -354,7 +354,7 @@ out: * And at reserve time, it's always aligned to page size, so * just free one page here. */ - btrfs_qgroup_free_data(inode, NULL, 0, PAGE_SIZE); + btrfs_qgroup_free_data(BTRFS_I(inode), NULL, 0, PAGE_SIZE); btrfs_free_path(path); btrfs_end_transaction(trans); return ret; @@ -4994,7 +4994,8 @@ static void evict_inode_truncate_pages(struct inode *inode) * Note, end is the bytenr of last byte, so we need + 1 here. */ if (state_flags & EXTENT_DELALLOC) - btrfs_qgroup_free_data(inode, NULL, start, end - start + 1); + btrfs_qgroup_free_data(BTRFS_I(inode), NULL, start, + end - start + 1); clear_extent_bit(io_tree, start, end, EXTENT_LOCKED | EXTENT_DELALLOC | @@ -8178,7 +8179,7 @@ again: * bit of its io_tree, and free the qgroup reserved data space. * Since the IO will never happen for this page. */ - btrfs_qgroup_free_data(inode, NULL, page_start, PAGE_SIZE); + btrfs_qgroup_free_data(BTRFS_I(inode), NULL, page_start, PAGE_SIZE); if (!inode_evicting) { clear_extent_bit(tree, page_start, page_end, EXTENT_LOCKED | EXTENT_DELALLOC | EXTENT_DELALLOC_NEW | diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index cb737729f610..5f9ba8280560 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -173,8 +173,7 @@ static int __btrfs_add_ordered_extent(struct btrfs_inode *inode, u64 file_offset if (type == BTRFS_ORDERED_NOCOW || type == BTRFS_ORDERED_PREALLOC) { /* For nocow write, we can release the qgroup rsv right now */ - ret = btrfs_qgroup_free_data(&inode->vfs_inode, NULL, file_offset, - num_bytes); + ret = btrfs_qgroup_free_data(inode, NULL, file_offset, num_bytes); if (ret < 0) return ret; ret = 0; diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index de2812ee73c1..7795c7616fe8 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -3592,10 +3592,10 @@ out: * * NOTE: This function may sleep for memory allocation. */ -int btrfs_qgroup_free_data(struct inode *inode, +int btrfs_qgroup_free_data(struct btrfs_inode *inode, struct extent_changeset *reserved, u64 start, u64 len) { - return __btrfs_qgroup_release_data(BTRFS_I(inode), reserved, start, len, 1); + return __btrfs_qgroup_release_data(inode, reserved, start, len, 1); } /* diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h index 3be5198a3719..0449bfd6fe45 100644 --- a/fs/btrfs/qgroup.h +++ b/fs/btrfs/qgroup.h @@ -347,9 +347,9 @@ int btrfs_verify_qgroup_counts(struct btrfs_fs_info *fs_info, u64 qgroupid, int btrfs_qgroup_reserve_data(struct inode *inode, struct extent_changeset **reserved, u64 start, u64 len); int btrfs_qgroup_release_data(struct inode *inode, u64 start, u64 len); -int btrfs_qgroup_free_data(struct inode *inode, - struct extent_changeset *reserved, u64 start, u64 len); - +int btrfs_qgroup_free_data(struct btrfs_inode *inode, + struct extent_changeset *reserved, u64 start, + u64 len); int __btrfs_qgroup_reserve_meta(struct btrfs_root *root, int num_bytes, enum btrfs_qgroup_rsv_type type, bool enforce); /* Reserve metadata space for pertrans and prealloc type */ |