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>
This commit is contained in:
parent
781e3bcf0e
commit
d2d9ac6aae
@ -31,7 +31,7 @@ static int __check_free_space_extents(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_fs_info *fs_info,
|
struct btrfs_fs_info *fs_info,
|
||||||
struct btrfs_block_group_cache *cache,
|
struct btrfs_block_group_cache *cache,
|
||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
struct free_space_extent *extents,
|
const struct free_space_extent * const extents,
|
||||||
unsigned int num_extents)
|
unsigned int num_extents)
|
||||||
{
|
{
|
||||||
struct btrfs_free_space_info *info;
|
struct btrfs_free_space_info *info;
|
||||||
@ -120,7 +120,7 @@ static int check_free_space_extents(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_fs_info *fs_info,
|
struct btrfs_fs_info *fs_info,
|
||||||
struct btrfs_block_group_cache *cache,
|
struct btrfs_block_group_cache *cache,
|
||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
struct free_space_extent *extents,
|
const struct free_space_extent * const extents,
|
||||||
unsigned int num_extents)
|
unsigned int num_extents)
|
||||||
{
|
{
|
||||||
struct btrfs_free_space_info *info;
|
struct btrfs_free_space_info *info;
|
||||||
@ -165,7 +165,7 @@ static int test_empty_block_group(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {
|
const struct free_space_extent extents[] = {
|
||||||
{cache->key.objectid, cache->key.offset},
|
{cache->key.objectid, cache->key.offset},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ static int test_remove_all(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {};
|
const struct free_space_extent extents[] = {};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = __remove_from_free_space_tree(trans, fs_info, cache, path,
|
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,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {
|
const struct free_space_extent extents[] = {
|
||||||
{cache->key.objectid + alignment,
|
{cache->key.objectid + alignment,
|
||||||
cache->key.offset - alignment},
|
cache->key.offset - alignment},
|
||||||
};
|
};
|
||||||
@ -224,7 +224,7 @@ static int test_remove_end(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {
|
const struct free_space_extent extents[] = {
|
||||||
{cache->key.objectid, cache->key.offset - alignment},
|
{cache->key.objectid, cache->key.offset - alignment},
|
||||||
};
|
};
|
||||||
int ret;
|
int ret;
|
||||||
@ -248,7 +248,7 @@ static int test_remove_middle(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {
|
const struct free_space_extent extents[] = {
|
||||||
{cache->key.objectid, alignment},
|
{cache->key.objectid, alignment},
|
||||||
{cache->key.objectid + 2 * alignment,
|
{cache->key.objectid + 2 * alignment,
|
||||||
cache->key.offset - 2 * alignment},
|
cache->key.offset - 2 * alignment},
|
||||||
@ -273,7 +273,7 @@ static int test_merge_left(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {
|
const struct free_space_extent extents[] = {
|
||||||
{cache->key.objectid, 2 * alignment},
|
{cache->key.objectid, 2 * alignment},
|
||||||
};
|
};
|
||||||
int ret;
|
int ret;
|
||||||
@ -311,7 +311,7 @@ static int test_merge_right(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {
|
const struct free_space_extent extents[] = {
|
||||||
{cache->key.objectid + alignment, 2 * alignment},
|
{cache->key.objectid + alignment, 2 * alignment},
|
||||||
};
|
};
|
||||||
int ret;
|
int ret;
|
||||||
@ -350,7 +350,7 @@ static int test_merge_both(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {
|
const struct free_space_extent extents[] = {
|
||||||
{cache->key.objectid, 3 * alignment},
|
{cache->key.objectid, 3 * alignment},
|
||||||
};
|
};
|
||||||
int ret;
|
int ret;
|
||||||
@ -396,7 +396,7 @@ static int test_merge_none(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_path *path,
|
struct btrfs_path *path,
|
||||||
u32 alignment)
|
u32 alignment)
|
||||||
{
|
{
|
||||||
struct free_space_extent extents[] = {
|
const struct free_space_extent extents[] = {
|
||||||
{cache->key.objectid, alignment},
|
{cache->key.objectid, alignment},
|
||||||
{cache->key.objectid + 2 * alignment, alignment},
|
{cache->key.objectid + 2 * alignment, alignment},
|
||||||
{cache->key.objectid + 4 * alignment, alignment},
|
{cache->key.objectid + 4 * alignment, alignment},
|
||||||
|
Loading…
Reference in New Issue
Block a user