]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: make __btrfs_qgroup_release_data take btrfs_inode
authorNikolay Borisov <nborisov@suse.com>
Wed, 3 Jun 2020 05:55:10 +0000 (08:55 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:30 +0000 (12:55 +0200)
It uses vfs_inode only for a tracepoint so convert its interface to take
btrfs_inode directly.

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/qgroup.c

index d0031afe993a1fcee570485d0d615203d7c33d7f..de2812ee73c14803850cb1d5544fb1c6b3803cd3 100644 (file)
@@ -3545,7 +3545,7 @@ out:
        return ret;
 }
 
-static int __btrfs_qgroup_release_data(struct inode *inode,
+static int __btrfs_qgroup_release_data(struct btrfs_inode *inode,
                        struct extent_changeset *reserved, u64 start, u64 len,
                        int free)
 {
@@ -3553,28 +3553,26 @@ static int __btrfs_qgroup_release_data(struct inode *inode,
        int trace_op = QGROUP_RELEASE;
        int ret;
 
-       if (!test_bit(BTRFS_FS_QUOTA_ENABLED,
-                     &BTRFS_I(inode)->root->fs_info->flags))
+       if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &inode->root->fs_info->flags))
                return 0;
 
        /* In release case, we shouldn't have @reserved */
        WARN_ON(!free && reserved);
        if (free && reserved)
-               return qgroup_free_reserved_data(BTRFS_I(inode), reserved,
-                                                start, len);
+               return qgroup_free_reserved_data(inode, reserved, start, len);
        extent_changeset_init(&changeset);
-       ret = clear_record_extent_bits(&BTRFS_I(inode)->io_tree, start, 
-                       start + len -1, EXTENT_QGROUP_RESERVED, &changeset);
+       ret = clear_record_extent_bits(&inode->io_tree, start, start + len -1,
+                                      EXTENT_QGROUP_RESERVED, &changeset);
        if (ret < 0)
                goto out;
 
        if (free)
                trace_op = QGROUP_FREE;
-       trace_btrfs_qgroup_release_data(inode, start, len,
+       trace_btrfs_qgroup_release_data(&inode->vfs_inode, start, len,
                                        changeset.bytes_changed, trace_op);
        if (free)
-               btrfs_qgroup_free_refroot(BTRFS_I(inode)->root->fs_info,
-                               BTRFS_I(inode)->root->root_key.objectid,
+               btrfs_qgroup_free_refroot(inode->root->fs_info,
+                               inode->root->root_key.objectid,
                                changeset.bytes_changed, BTRFS_QGROUP_RSV_DATA);
        ret = changeset.bytes_changed;
 out:
@@ -3597,7 +3595,7 @@ out:
 int btrfs_qgroup_free_data(struct inode *inode,
                        struct extent_changeset *reserved, u64 start, u64 len)
 {
-       return __btrfs_qgroup_release_data(inode, reserved, start, len, 1);
+       return __btrfs_qgroup_release_data(BTRFS_I(inode), reserved, start, len, 1);
 }
 
 /*
@@ -3617,7 +3615,7 @@ int btrfs_qgroup_free_data(struct inode *inode,
  */
 int btrfs_qgroup_release_data(struct inode *inode, u64 start, u64 len)
 {
-       return __btrfs_qgroup_release_data(inode, NULL, start, len, 0);
+       return __btrfs_qgroup_release_data(BTRFS_I(inode), NULL, start, len, 0);
 }
 
 static void add_root_meta_rsv(struct btrfs_root *root, int num_bytes,