]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
btrfs: remove ignore_offset argument from btrfs_find_all_roots()
authorFilipe Manana <fdmanana@suse.com>
Thu, 22 Jul 2021 14:58:10 +0000 (15:58 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Aug 2021 11:19:01 +0000 (13:19 +0200)
Currently all the callers of btrfs_find_all_roots() pass a value of false
for its ignore_offset argument. This makes the argument pointless and we
can remove it and make btrfs_find_all_roots() always pass false as the
ignore_offset argument for btrfs_find_all_roots_safe(). So just do that.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/backref.c
fs/btrfs/backref.h
fs/btrfs/qgroup.c
fs/btrfs/tests/qgroup-tests.c

index 728c728d03f3c60ffc72bf40ddb867110db21bb9..f735b8798ba1276d321899ef8d902ba0e1e63bc3 100644 (file)
@@ -1488,14 +1488,14 @@ static int btrfs_find_all_roots_safe(struct btrfs_trans_handle *trans,
 int btrfs_find_all_roots(struct btrfs_trans_handle *trans,
                         struct btrfs_fs_info *fs_info, u64 bytenr,
                         u64 time_seq, struct ulist **roots,
-                        bool ignore_offset, bool skip_commit_root_sem)
+                        bool skip_commit_root_sem)
 {
        int ret;
 
        if (!trans && !skip_commit_root_sem)
                down_read(&fs_info->commit_root_sem);
        ret = btrfs_find_all_roots_safe(trans, fs_info, bytenr,
-                                       time_seq, roots, ignore_offset);
+                                       time_seq, roots, false);
        if (!trans && !skip_commit_root_sem)
                up_read(&fs_info->commit_root_sem);
        return ret;
index ff5f07f9940bd9bb7ae99e69617f0a63715f2abb..ba454032dbe2271152ed91ed48e475ac8bcf46a4 100644 (file)
@@ -47,7 +47,7 @@ int btrfs_find_all_leafs(struct btrfs_trans_handle *trans,
                         const u64 *extent_item_pos, bool ignore_offset);
 int btrfs_find_all_roots(struct btrfs_trans_handle *trans,
                         struct btrfs_fs_info *fs_info, u64 bytenr,
-                        u64 time_seq, struct ulist **roots, bool ignore_offset,
+                        u64 time_seq, struct ulist **roots,
                         bool skip_commit_root_sem);
 char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path,
                        u32 name_len, unsigned long name_off,
index 0fa121171ca17fc286538f5b67ece77beb696df5..db680f5be745a0fd80cd8678b2190dfff8bdaa5c 100644 (file)
@@ -1733,7 +1733,7 @@ int btrfs_qgroup_trace_extent_post(struct btrfs_trans_handle *trans,
        ASSERT(trans != NULL);
 
        ret = btrfs_find_all_roots(NULL, trans->fs_info, bytenr, 0, &old_root,
-                                  false, true);
+                                  true);
        if (ret < 0) {
                trans->fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
                btrfs_warn(trans->fs_info,
@@ -2651,7 +2651,7 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans)
                                /* Search commit root to find old_roots */
                                ret = btrfs_find_all_roots(NULL, fs_info,
                                                record->bytenr, 0,
-                                               &record->old_roots, false, false);
+                                               &record->old_roots, false);
                                if (ret < 0)
                                        goto cleanup;
                        }
@@ -2667,7 +2667,7 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans)
                         * current root. It's safe inside commit_transaction().
                         */
                        ret = btrfs_find_all_roots(trans, fs_info,
-                          record->bytenr, BTRFS_SEQ_LAST, &new_roots, false, false);
+                          record->bytenr, BTRFS_SEQ_LAST, &new_roots, false);
                        if (ret < 0)
                                goto cleanup;
                        if (qgroup_to_skip) {
@@ -3201,7 +3201,7 @@ static int qgroup_rescan_leaf(struct btrfs_trans_handle *trans,
                        num_bytes = found.offset;
 
                ret = btrfs_find_all_roots(NULL, fs_info, found.objectid, 0,
-                                          &roots, false, false);
+                                          &roots, false);
                if (ret < 0)
                        goto out;
                /* For rescan, just pass old_roots as NULL */
index 98b5aaba46f165c203320080765ca8ff0846e7a3..19ba7d5b7d8ff471906d1157572848b563a15b06 100644 (file)
@@ -223,8 +223,7 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
         * we can only call btrfs_qgroup_account_extent() directly to test
         * quota.
         */
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
        if (ret) {
                ulist_free(old_roots);
                test_err("couldn't find old roots: %d", ret);
@@ -236,8 +235,7 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
        if (ret)
                return ret;
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
        if (ret) {
                ulist_free(old_roots);
                ulist_free(new_roots);
@@ -260,8 +258,7 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
        old_roots = NULL;
        new_roots = NULL;
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
        if (ret) {
                ulist_free(old_roots);
                test_err("couldn't find old roots: %d", ret);
@@ -272,8 +269,7 @@ static int test_no_shared_qgroup(struct btrfs_root *root,
        if (ret)
                return -EINVAL;
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
        if (ret) {
                ulist_free(old_roots);
                ulist_free(new_roots);
@@ -324,8 +320,7 @@ static int test_multiple_refs(struct btrfs_root *root,
                return ret;
        }
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
        if (ret) {
                ulist_free(old_roots);
                test_err("couldn't find old roots: %d", ret);
@@ -337,8 +332,7 @@ static int test_multiple_refs(struct btrfs_root *root,
        if (ret)
                return ret;
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
        if (ret) {
                ulist_free(old_roots);
                ulist_free(new_roots);
@@ -359,8 +353,7 @@ static int test_multiple_refs(struct btrfs_root *root,
                return -EINVAL;
        }
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
        if (ret) {
                ulist_free(old_roots);
                test_err("couldn't find old roots: %d", ret);
@@ -372,8 +365,7 @@ static int test_multiple_refs(struct btrfs_root *root,
        if (ret)
                return ret;
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
        if (ret) {
                ulist_free(old_roots);
                ulist_free(new_roots);
@@ -400,8 +392,7 @@ static int test_multiple_refs(struct btrfs_root *root,
                return -EINVAL;
        }
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false);
        if (ret) {
                ulist_free(old_roots);
                test_err("couldn't find old roots: %d", ret);
@@ -413,8 +404,7 @@ static int test_multiple_refs(struct btrfs_root *root,
        if (ret)
                return ret;
 
-       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots,
-                       false, false);
+       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false);
        if (ret) {
                ulist_free(old_roots);
                ulist_free(new_roots);