Skip to content

Commit d2d9ac6

Browse files
committed
btrfs: tests: constify free space extent specs
We don't change the given extent ranges, mark them const to catch accidental changes. Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 781e3bc commit d2d9ac6

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

fs/btrfs/tests/free-space-tree-tests.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static int __check_free_space_extents(struct btrfs_trans_handle *trans,
3131
struct btrfs_fs_info *fs_info,
3232
struct btrfs_block_group_cache *cache,
3333
struct btrfs_path *path,
34-
struct free_space_extent *extents,
34+
const struct free_space_extent * const extents,
3535
unsigned int num_extents)
3636
{
3737
struct btrfs_free_space_info *info;
@@ -120,7 +120,7 @@ static int check_free_space_extents(struct btrfs_trans_handle *trans,
120120
struct btrfs_fs_info *fs_info,
121121
struct btrfs_block_group_cache *cache,
122122
struct btrfs_path *path,
123-
struct free_space_extent *extents,
123+
const struct free_space_extent * const extents,
124124
unsigned int num_extents)
125125
{
126126
struct btrfs_free_space_info *info;
@@ -165,7 +165,7 @@ static int test_empty_block_group(struct btrfs_trans_handle *trans,
165165
struct btrfs_path *path,
166166
u32 alignment)
167167
{
168-
struct free_space_extent extents[] = {
168+
const struct free_space_extent extents[] = {
169169
{cache->key.objectid, cache->key.offset},
170170
};
171171

@@ -179,7 +179,7 @@ static int test_remove_all(struct btrfs_trans_handle *trans,
179179
struct btrfs_path *path,
180180
u32 alignment)
181181
{
182-
struct free_space_extent extents[] = {};
182+
const struct free_space_extent extents[] = {};
183183
int ret;
184184

185185
ret = __remove_from_free_space_tree(trans, fs_info, cache, path,
@@ -200,7 +200,7 @@ static int test_remove_beginning(struct btrfs_trans_handle *trans,
200200
struct btrfs_path *path,
201201
u32 alignment)
202202
{
203-
struct free_space_extent extents[] = {
203+
const struct free_space_extent extents[] = {
204204
{cache->key.objectid + alignment,
205205
cache->key.offset - alignment},
206206
};
@@ -224,7 +224,7 @@ static int test_remove_end(struct btrfs_trans_handle *trans,
224224
struct btrfs_path *path,
225225
u32 alignment)
226226
{
227-
struct free_space_extent extents[] = {
227+
const struct free_space_extent extents[] = {
228228
{cache->key.objectid, cache->key.offset - alignment},
229229
};
230230
int ret;
@@ -248,7 +248,7 @@ static int test_remove_middle(struct btrfs_trans_handle *trans,
248248
struct btrfs_path *path,
249249
u32 alignment)
250250
{
251-
struct free_space_extent extents[] = {
251+
const struct free_space_extent extents[] = {
252252
{cache->key.objectid, alignment},
253253
{cache->key.objectid + 2 * alignment,
254254
cache->key.offset - 2 * alignment},
@@ -273,7 +273,7 @@ static int test_merge_left(struct btrfs_trans_handle *trans,
273273
struct btrfs_path *path,
274274
u32 alignment)
275275
{
276-
struct free_space_extent extents[] = {
276+
const struct free_space_extent extents[] = {
277277
{cache->key.objectid, 2 * alignment},
278278
};
279279
int ret;
@@ -311,7 +311,7 @@ static int test_merge_right(struct btrfs_trans_handle *trans,
311311
struct btrfs_path *path,
312312
u32 alignment)
313313
{
314-
struct free_space_extent extents[] = {
314+
const struct free_space_extent extents[] = {
315315
{cache->key.objectid + alignment, 2 * alignment},
316316
};
317317
int ret;
@@ -350,7 +350,7 @@ static int test_merge_both(struct btrfs_trans_handle *trans,
350350
struct btrfs_path *path,
351351
u32 alignment)
352352
{
353-
struct free_space_extent extents[] = {
353+
const struct free_space_extent extents[] = {
354354
{cache->key.objectid, 3 * alignment},
355355
};
356356
int ret;
@@ -396,7 +396,7 @@ static int test_merge_none(struct btrfs_trans_handle *trans,
396396
struct btrfs_path *path,
397397
u32 alignment)
398398
{
399-
struct free_space_extent extents[] = {
399+
const struct free_space_extent extents[] = {
400400
{cache->key.objectid, alignment},
401401
{cache->key.objectid + 2 * alignment, alignment},
402402
{cache->key.objectid + 4 * alignment, alignment},

0 commit comments

Comments
 (0)