qgroup-tests.c (52ab7bca3583fa7a80b16232874784f8dcc4e560) qgroup-tests.c (770e0cc040b07eb54f6cb119a44bf6ff742338eb)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2013 Facebook. All rights reserved.
4 */
5
6#include <linux/types.h>
7#include "btrfs-tests.h"
8#include "../ctree.h"

--- 18 unchanged lines hidden (view full) ---

27 btrfs_init_dummy_trans(&trans, NULL);
28
29 ins.objectid = bytenr;
30 ins.type = BTRFS_EXTENT_ITEM_KEY;
31 ins.offset = num_bytes;
32
33 path = btrfs_alloc_path();
34 if (!path) {
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2013 Facebook. All rights reserved.
4 */
5
6#include <linux/types.h>
7#include "btrfs-tests.h"
8#include "../ctree.h"

--- 18 unchanged lines hidden (view full) ---

27 btrfs_init_dummy_trans(&trans, NULL);
28
29 ins.objectid = bytenr;
30 ins.type = BTRFS_EXTENT_ITEM_KEY;
31 ins.offset = num_bytes;
32
33 path = btrfs_alloc_path();
34 if (!path) {
35 test_err("couldn't allocate path");
35 test_std_err(TEST_ALLOC_ROOT);
36 return -ENOMEM;
37 }
38
39 path->leave_spinning = 1;
40 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size);
41 if (ret) {
42 test_err("couldn't insert ref %d", ret);
43 btrfs_free_path(path);

--- 33 unchanged lines hidden (view full) ---

77 btrfs_init_dummy_trans(&trans, NULL);
78
79 key.objectid = bytenr;
80 key.type = BTRFS_EXTENT_ITEM_KEY;
81 key.offset = num_bytes;
82
83 path = btrfs_alloc_path();
84 if (!path) {
36 return -ENOMEM;
37 }
38
39 path->leave_spinning = 1;
40 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size);
41 if (ret) {
42 test_err("couldn't insert ref %d", ret);
43 btrfs_free_path(path);

--- 33 unchanged lines hidden (view full) ---

77 btrfs_init_dummy_trans(&trans, NULL);
78
79 key.objectid = bytenr;
80 key.type = BTRFS_EXTENT_ITEM_KEY;
81 key.offset = num_bytes;
82
83 path = btrfs_alloc_path();
84 if (!path) {
85 test_err("couldn't allocate path");
85 test_std_err(TEST_ALLOC_ROOT);
86 return -ENOMEM;
87 }
88
89 path->leave_spinning = 1;
90 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1);
91 if (ret) {
92 test_err("couldn't find extent ref");
93 btrfs_free_path(path);

--- 33 unchanged lines hidden (view full) ---

127 btrfs_init_dummy_trans(&trans, NULL);
128
129 key.objectid = bytenr;
130 key.type = BTRFS_EXTENT_ITEM_KEY;
131 key.offset = num_bytes;
132
133 path = btrfs_alloc_path();
134 if (!path) {
86 return -ENOMEM;
87 }
88
89 path->leave_spinning = 1;
90 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1);
91 if (ret) {
92 test_err("couldn't find extent ref");
93 btrfs_free_path(path);

--- 33 unchanged lines hidden (view full) ---

127 btrfs_init_dummy_trans(&trans, NULL);
128
129 key.objectid = bytenr;
130 key.type = BTRFS_EXTENT_ITEM_KEY;
131 key.offset = num_bytes;
132
133 path = btrfs_alloc_path();
134 if (!path) {
135 test_err("couldn't allocate path");
135 test_std_err(TEST_ALLOC_ROOT);
136 return -ENOMEM;
137 }
138 path->leave_spinning = 1;
139
140 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1);
141 if (ret) {
142 test_err("didn't find our key %d", ret);
143 btrfs_free_path(path);

--- 17 unchanged lines hidden (view full) ---

161 btrfs_init_dummy_trans(&trans, NULL);
162
163 key.objectid = bytenr;
164 key.type = BTRFS_EXTENT_ITEM_KEY;
165 key.offset = num_bytes;
166
167 path = btrfs_alloc_path();
168 if (!path) {
136 return -ENOMEM;
137 }
138 path->leave_spinning = 1;
139
140 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1);
141 if (ret) {
142 test_err("didn't find our key %d", ret);
143 btrfs_free_path(path);

--- 17 unchanged lines hidden (view full) ---

161 btrfs_init_dummy_trans(&trans, NULL);
162
163 key.objectid = bytenr;
164 key.type = BTRFS_EXTENT_ITEM_KEY;
165 key.offset = num_bytes;
166
167 path = btrfs_alloc_path();
168 if (!path) {
169 test_err("couldn't allocate path");
169 test_std_err(TEST_ALLOC_ROOT);
170 return -ENOMEM;
171 }
172
173 path->leave_spinning = 1;
174 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1);
175 if (ret) {
176 test_err("couldn't find extent ref");
177 btrfs_free_path(path);

--- 357 unchanged lines hidden ---
170 return -ENOMEM;
171 }
172
173 path->leave_spinning = 1;
174 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1);
175 if (ret) {
176 test_err("couldn't find extent ref");
177 btrfs_free_path(path);

--- 357 unchanged lines hidden ---