]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: make qgroup_free_reserved_data take btrfs_inode
authorNikolay Borisov <nborisov@suse.com>
Wed, 3 Jun 2020 05:55:09 +0000 (08:55 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:30 +0000 (12:55 +0200)
It only uses btrfs_inode so can just as easily take it as an argument.

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 74eb984791098531190a8e202bdf2f06d945e871..d0031afe993a1fcee570485d0d615203d7c33d7f 100644 (file)
@@ -3491,10 +3491,10 @@ cleanup:
 }
 
 /* Free ranges specified by @reserved, normally in error path */
-static int qgroup_free_reserved_data(struct inode *inode,
+static int qgroup_free_reserved_data(struct btrfs_inode *inode,
                        struct extent_changeset *reserved, u64 start, u64 len)
 {
-       struct btrfs_root *root = BTRFS_I(inode)->root;
+       struct btrfs_root *root = inode->root;
        struct ulist_node *unode;
        struct ulist_iterator uiter;
        struct extent_changeset changeset;
@@ -3530,8 +3530,8 @@ static int qgroup_free_reserved_data(struct inode *inode,
                 * EXTENT_QGROUP_RESERVED, we won't double free.
                 * So not need to rush.
                 */
-               ret = clear_record_extent_bits(&BTRFS_I(inode)->io_tree,
-                               free_start, free_start + free_len - 1,
+               ret = clear_record_extent_bits(&inode->io_tree, free_start,
+                               free_start + free_len - 1,
                                EXTENT_QGROUP_RESERVED, &changeset);
                if (ret < 0)
                        goto out;
@@ -3560,7 +3560,8 @@ static int __btrfs_qgroup_release_data(struct inode *inode,
        /* In release case, we shouldn't have @reserved */
        WARN_ON(!free && reserved);
        if (free && reserved)
-               return qgroup_free_reserved_data(inode, reserved, start, len);
+               return qgroup_free_reserved_data(BTRFS_I(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);