]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: make btrfs_qgroup_free_data take btrfs_inode
authorNikolay Borisov <nborisov@suse.com>
Wed, 3 Jun 2020 05:55:11 +0000 (08:55 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:30 +0000 (12:55 +0200)
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>
fs/btrfs/delalloc-space.c
fs/btrfs/inode.c
fs/btrfs/ordered-data.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h

index d05648f882ca93fc3051236d078811c7fdfdf481..31440137accf84d711039fda543b0a0d4d3902f3 100644 (file)
@@ -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);
 }
 
 /**
index bd51365e53fb70db689b279798d7d055889a0eee..ec3d13303ebcc5b8b7f8d930e681dd4cb3e363d1 100644 (file)
@@ -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 |
index cb737729f6107ca71575da56bd23b6bc665dd4e7..5f9ba8280560c184202626be639b7b341f40cd2b 100644 (file)
@@ -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;
index de2812ee73c14803850cb1d5544fb1c6b3803cd3..7795c7616fe88b70e1a349def6db4e5194c07936 100644 (file)
@@ -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);
 }
 
 /*
index 3be5198a37195f9eee7f7461c5890642c358340c..0449bfd6fe459ab6f6bf4bc2559109f348416d90 100644 (file)
@@ -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 */