|
@@ -228,7 +228,7 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
inode = btrfs_new_test_inode();
|
|
inode = btrfs_new_test_inode();
|
|
if (!inode) {
|
|
if (!inode) {
|
|
- test_msg("Couldn't allocate inode\n");
|
|
|
|
|
|
+ test_err("couldn't allocate inode");
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -238,19 +238,19 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize);
|
|
fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize);
|
|
if (!fs_info) {
|
|
if (!fs_info) {
|
|
- test_msg("Couldn't allocate dummy fs info\n");
|
|
|
|
|
|
+ test_err("couldn't allocate dummy fs info");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
root = btrfs_alloc_dummy_root(fs_info);
|
|
root = btrfs_alloc_dummy_root(fs_info);
|
|
if (IS_ERR(root)) {
|
|
if (IS_ERR(root)) {
|
|
- test_msg("Couldn't allocate root\n");
|
|
|
|
|
|
+ test_err("couldn't allocate root");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
root->node = alloc_dummy_extent_buffer(fs_info, nodesize);
|
|
root->node = alloc_dummy_extent_buffer(fs_info, nodesize);
|
|
if (!root->node) {
|
|
if (!root->node) {
|
|
- test_msg("Couldn't allocate dummy buffer\n");
|
|
|
|
|
|
+ test_err("couldn't allocate dummy buffer");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -268,11 +268,11 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 0, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 0, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
em = NULL;
|
|
em = NULL;
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
- test_msg("Expected a hole, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a hole, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
free_extent_map(em);
|
|
free_extent_map(em);
|
|
@@ -287,20 +287,21 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 0, (u64)-1, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 0, (u64)-1, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
- test_msg("Expected a hole, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a hole, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != 0 || em->len != 5) {
|
|
if (em->start != 0 || em->len != 5) {
|
|
- test_msg("Unexpected extent wanted start 0 len 5, got start "
|
|
|
|
- "%llu len %llu\n", em->start, em->len);
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start 0 len 5, got start %llu len %llu",
|
|
|
|
+ em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
offset = em->start + em->len;
|
|
offset = em->start + em->len;
|
|
@@ -308,21 +309,22 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != EXTENT_MAP_INLINE) {
|
|
if (em->block_start != EXTENT_MAP_INLINE) {
|
|
- test_msg("Expected an inline, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected an inline, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
if (em->start != offset || em->len != (sectorsize - 5)) {
|
|
if (em->start != offset || em->len != (sectorsize - 5)) {
|
|
- test_msg("Unexpected extent wanted start %llu len 1, got start "
|
|
|
|
- "%llu len %llu\n", offset, em->start, em->len);
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len 1, got start %llu len %llu",
|
|
|
|
+ offset, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
@@ -335,20 +337,21 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
- test_msg("Expected a hole, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a hole, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != 4) {
|
|
if (em->start != offset || em->len != 4) {
|
|
- test_msg("Unexpected extent wanted start %llu len 4, got start "
|
|
|
|
- "%llu len %llu\n", offset, em->start, em->len);
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len 4, got start %llu len %llu",
|
|
|
|
+ offset, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
offset = em->start + em->len;
|
|
offset = em->start + em->len;
|
|
@@ -357,24 +360,25 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
/* Regular extent */
|
|
/* Regular extent */
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize - 1) {
|
|
if (em->start != offset || em->len != sectorsize - 1) {
|
|
- test_msg("Unexpected extent wanted start %llu len 4095, got "
|
|
|
|
- "start %llu len %llu\n", offset, em->start, em->len);
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len 4095, got start %llu len %llu",
|
|
|
|
+ offset, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", em->start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", em->start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -384,25 +388,25 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
/* The next 3 are split extents */
|
|
/* The next 3 are split extents */
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", em->start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", em->start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -413,21 +417,21 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
- test_msg("Expected a hole, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a hole, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
offset = em->start + em->len;
|
|
offset = em->start + em->len;
|
|
@@ -435,31 +439,31 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != 2 * sectorsize) {
|
|
if (em->start != offset || em->len != 2 * sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, 2 * sectorsize, em->start, em->len);
|
|
offset, 2 * sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != orig_start) {
|
|
if (em->orig_start != orig_start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n",
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu",
|
|
orig_start, em->orig_start);
|
|
orig_start, em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
disk_bytenr += (em->start - orig_start);
|
|
disk_bytenr += (em->start - orig_start);
|
|
if (em->block_start != disk_bytenr) {
|
|
if (em->block_start != disk_bytenr) {
|
|
- test_msg("Wrong block start, want %llu, have %llu\n",
|
|
|
|
|
|
+ test_err("wrong block start, want %llu, have %llu",
|
|
disk_bytenr, em->block_start);
|
|
disk_bytenr, em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -469,26 +473,26 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
/* Prealloc extent */
|
|
/* Prealloc extent */
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != prealloc_only) {
|
|
if (em->flags != prealloc_only) {
|
|
- test_msg("Unexpected flags set, want %lu have %lu\n",
|
|
|
|
|
|
+ test_err("unexpected flags set, want %lu have %lu",
|
|
prealloc_only, em->flags);
|
|
prealloc_only, em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", em->start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", em->start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -498,26 +502,26 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
/* The next 3 are a half written prealloc extent */
|
|
/* The next 3 are a half written prealloc extent */
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != prealloc_only) {
|
|
if (em->flags != prealloc_only) {
|
|
- test_msg("Unexpected flags set, want %lu have %lu\n",
|
|
|
|
|
|
+ test_err("unexpected flags set, want %lu have %lu",
|
|
prealloc_only, em->flags);
|
|
prealloc_only, em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", em->start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", em->start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -528,30 +532,30 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_HOLE) {
|
|
if (em->block_start >= EXTENT_MAP_HOLE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != orig_start) {
|
|
if (em->orig_start != orig_start) {
|
|
- test_msg("Unexpected orig offset, wanted %llu, have %llu\n",
|
|
|
|
|
|
+ test_err("unexpected orig offset, wanted %llu, have %llu",
|
|
orig_start, em->orig_start);
|
|
orig_start, em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != (disk_bytenr + (em->start - em->orig_start))) {
|
|
if (em->block_start != (disk_bytenr + (em->start - em->orig_start))) {
|
|
- test_msg("Unexpected block start, wanted %llu, have %llu\n",
|
|
|
|
|
|
+ test_err("unexpected block start, wanted %llu, have %llu",
|
|
disk_bytenr + (em->start - em->orig_start),
|
|
disk_bytenr + (em->start - em->orig_start),
|
|
em->block_start);
|
|
em->block_start);
|
|
goto out;
|
|
goto out;
|
|
@@ -561,31 +565,31 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != 2 * sectorsize) {
|
|
if (em->start != offset || em->len != 2 * sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, 2 * sectorsize, em->start, em->len);
|
|
offset, 2 * sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != prealloc_only) {
|
|
if (em->flags != prealloc_only) {
|
|
- test_msg("Unexpected flags set, want %lu have %lu\n",
|
|
|
|
|
|
+ test_err("unexpected flags set, want %lu have %lu",
|
|
prealloc_only, em->flags);
|
|
prealloc_only, em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != orig_start) {
|
|
if (em->orig_start != orig_start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", orig_start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", orig_start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != (disk_bytenr + (em->start - em->orig_start))) {
|
|
if (em->block_start != (disk_bytenr + (em->start - em->orig_start))) {
|
|
- test_msg("Unexpected block start, wanted %llu, have %llu\n",
|
|
|
|
|
|
+ test_err("unexpected block start, wanted %llu, have %llu",
|
|
disk_bytenr + (em->start - em->orig_start),
|
|
disk_bytenr + (em->start - em->orig_start),
|
|
em->block_start);
|
|
em->block_start);
|
|
goto out;
|
|
goto out;
|
|
@@ -596,31 +600,31 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
/* Now for the compressed extent */
|
|
/* Now for the compressed extent */
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != 2 * sectorsize) {
|
|
if (em->start != offset || em->len != 2 * sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u,"
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, 2 * sectorsize, em->start, em->len);
|
|
offset, 2 * sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != compressed_only) {
|
|
if (em->flags != compressed_only) {
|
|
- test_msg("Unexpected flags set, want %lu have %lu\n",
|
|
|
|
|
|
+ test_err("unexpected flags set, want %lu have %lu",
|
|
compressed_only, em->flags);
|
|
compressed_only, em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n",
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu",
|
|
em->start, em->orig_start);
|
|
em->start, em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->compress_type != BTRFS_COMPRESS_ZLIB) {
|
|
if (em->compress_type != BTRFS_COMPRESS_ZLIB) {
|
|
- test_msg("Unexpected compress type, wanted %d, got %d\n",
|
|
|
|
|
|
+ test_err("unexpected compress type, wanted %d, got %d",
|
|
BTRFS_COMPRESS_ZLIB, em->compress_type);
|
|
BTRFS_COMPRESS_ZLIB, em->compress_type);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -630,31 +634,31 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
/* Split compressed extent */
|
|
/* Split compressed extent */
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u,"
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != compressed_only) {
|
|
if (em->flags != compressed_only) {
|
|
- test_msg("Unexpected flags set, want %lu have %lu\n",
|
|
|
|
|
|
+ test_err("unexpected flags set, want %lu have %lu",
|
|
compressed_only, em->flags);
|
|
compressed_only, em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n",
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu",
|
|
em->start, em->orig_start);
|
|
em->start, em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->compress_type != BTRFS_COMPRESS_ZLIB) {
|
|
if (em->compress_type != BTRFS_COMPRESS_ZLIB) {
|
|
- test_msg("Unexpected compress type, wanted %d, got %d\n",
|
|
|
|
|
|
+ test_err("unexpected compress type, wanted %d, got %d",
|
|
BTRFS_COMPRESS_ZLIB, em->compress_type);
|
|
BTRFS_COMPRESS_ZLIB, em->compress_type);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -665,25 +669,25 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", em->start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", em->start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -692,32 +696,32 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != disk_bytenr) {
|
|
if (em->block_start != disk_bytenr) {
|
|
- test_msg("Block start does not match, want %llu got %llu\n",
|
|
|
|
|
|
+ test_err("block start does not match, want %llu got %llu",
|
|
disk_bytenr, em->block_start);
|
|
disk_bytenr, em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != 2 * sectorsize) {
|
|
if (em->start != offset || em->len != 2 * sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, 2 * sectorsize, em->start, em->len);
|
|
offset, 2 * sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != compressed_only) {
|
|
if (em->flags != compressed_only) {
|
|
- test_msg("Unexpected flags set, want %lu have %lu\n",
|
|
|
|
|
|
+ test_err("unexpected flags set, want %lu have %lu",
|
|
compressed_only, em->flags);
|
|
compressed_only, em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != orig_start) {
|
|
if (em->orig_start != orig_start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n",
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu",
|
|
em->start, orig_start);
|
|
em->start, orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->compress_type != BTRFS_COMPRESS_ZLIB) {
|
|
if (em->compress_type != BTRFS_COMPRESS_ZLIB) {
|
|
- test_msg("Unexpected compress type, wanted %d, got %d\n",
|
|
|
|
|
|
+ test_err("unexpected compress type, wanted %d, got %d",
|
|
BTRFS_COMPRESS_ZLIB, em->compress_type);
|
|
BTRFS_COMPRESS_ZLIB, em->compress_type);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -728,25 +732,25 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset + 6,
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset + 6,
|
|
sectorsize, 0);
|
|
sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", em->start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", em->start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -755,11 +759,11 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, SZ_4M, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, SZ_4M, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
- test_msg("Expected a hole extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a hole extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
@@ -768,18 +772,18 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
* test.
|
|
* test.
|
|
*/
|
|
*/
|
|
if (em->start != offset || em->len != 3 * sectorsize) {
|
|
if (em->start != offset || em->len != 3 * sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, 3 * sectorsize, em->start, em->len);
|
|
offset, 3 * sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != vacancy_only) {
|
|
if (em->flags != vacancy_only) {
|
|
- test_msg("Unexpected flags set, want %lu have %lu\n",
|
|
|
|
|
|
+ test_err("unexpected flags set, want %lu have %lu",
|
|
vacancy_only, em->flags);
|
|
vacancy_only, em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", em->start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", em->start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -788,25 +792,25 @@ static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
if (em->start != offset || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %llu len %u,"
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %llu len %u, got start %llu len %llu",
|
|
offset, sectorsize, em->start, em->len);
|
|
offset, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, want 0 have %lu\n", em->flags);
|
|
|
|
|
|
+ test_err("unexpected flags set, want 0 have %lu", em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->orig_start != em->start) {
|
|
if (em->orig_start != em->start) {
|
|
- test_msg("Wrong orig offset, want %llu, have %llu\n", em->start,
|
|
|
|
|
|
+ test_err("wrong orig offset, want %llu, have %llu", em->start,
|
|
em->orig_start);
|
|
em->orig_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -830,7 +834,7 @@ static int test_hole_first(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
inode = btrfs_new_test_inode();
|
|
inode = btrfs_new_test_inode();
|
|
if (!inode) {
|
|
if (!inode) {
|
|
- test_msg("Couldn't allocate inode\n");
|
|
|
|
|
|
+ test_err("couldn't allocate inode");
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -840,19 +844,19 @@ static int test_hole_first(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize);
|
|
fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize);
|
|
if (!fs_info) {
|
|
if (!fs_info) {
|
|
- test_msg("Couldn't allocate dummy fs info\n");
|
|
|
|
|
|
+ test_err("couldn't allocate dummy fs info");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
root = btrfs_alloc_dummy_root(fs_info);
|
|
root = btrfs_alloc_dummy_root(fs_info);
|
|
if (IS_ERR(root)) {
|
|
if (IS_ERR(root)) {
|
|
- test_msg("Couldn't allocate root\n");
|
|
|
|
|
|
+ test_err("couldn't allocate root");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
root->node = alloc_dummy_extent_buffer(fs_info, nodesize);
|
|
root->node = alloc_dummy_extent_buffer(fs_info, nodesize);
|
|
if (!root->node) {
|
|
if (!root->node) {
|
|
- test_msg("Couldn't allocate dummy buffer\n");
|
|
|
|
|
|
+ test_err("couldn't allocate dummy buffer");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -871,21 +875,21 @@ static int test_hole_first(u32 sectorsize, u32 nodesize)
|
|
sectorsize, BTRFS_FILE_EXTENT_REG, 0, 1);
|
|
sectorsize, BTRFS_FILE_EXTENT_REG, 0, 1);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 0, 2 * sectorsize, 0);
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 0, 2 * sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
if (em->block_start != EXTENT_MAP_HOLE) {
|
|
- test_msg("Expected a hole, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a hole, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != 0 || em->len != sectorsize) {
|
|
if (em->start != 0 || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start 0 len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start 0 len %u, got start %llu len %llu",
|
|
sectorsize, em->start, em->len);
|
|
sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != vacancy_only) {
|
|
if (em->flags != vacancy_only) {
|
|
- test_msg("Wrong flags, wanted %lu, have %lu\n", vacancy_only,
|
|
|
|
|
|
+ test_err("wrong flags, wanted %lu, have %lu", vacancy_only,
|
|
em->flags);
|
|
em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -894,21 +898,21 @@ static int test_hole_first(u32 sectorsize, u32 nodesize)
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, sectorsize,
|
|
em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, sectorsize,
|
|
2 * sectorsize, 0);
|
|
2 * sectorsize, 0);
|
|
if (IS_ERR(em)) {
|
|
if (IS_ERR(em)) {
|
|
- test_msg("Got an error when we shouldn't have\n");
|
|
|
|
|
|
+ test_err("got an error when we shouldn't have");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->block_start != sectorsize) {
|
|
if (em->block_start != sectorsize) {
|
|
- test_msg("Expected a real extent, got %llu\n", em->block_start);
|
|
|
|
|
|
+ test_err("expected a real extent, got %llu", em->block_start);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->start != sectorsize || em->len != sectorsize) {
|
|
if (em->start != sectorsize || em->len != sectorsize) {
|
|
- test_msg("Unexpected extent wanted start %u len %u, "
|
|
|
|
- "got start %llu len %llu\n",
|
|
|
|
|
|
+ test_err(
|
|
|
|
+ "unexpected extent wanted start %u len %u, got start %llu len %llu",
|
|
sectorsize, sectorsize, em->start, em->len);
|
|
sectorsize, sectorsize, em->start, em->len);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (em->flags != 0) {
|
|
if (em->flags != 0) {
|
|
- test_msg("Unexpected flags set, wanted 0 got %lu\n",
|
|
|
|
|
|
+ test_err("unexpected flags set, wanted 0 got %lu",
|
|
em->flags);
|
|
em->flags);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -931,19 +935,19 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
|
|
|
|
inode = btrfs_new_test_inode();
|
|
inode = btrfs_new_test_inode();
|
|
if (!inode) {
|
|
if (!inode) {
|
|
- test_msg("Couldn't allocate inode\n");
|
|
|
|
|
|
+ test_err("couldn't allocate inode");
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize);
|
|
fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize);
|
|
if (!fs_info) {
|
|
if (!fs_info) {
|
|
- test_msg("Couldn't allocate dummy fs info\n");
|
|
|
|
|
|
+ test_err("couldn't allocate dummy fs info");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
root = btrfs_alloc_dummy_root(fs_info);
|
|
root = btrfs_alloc_dummy_root(fs_info);
|
|
if (IS_ERR(root)) {
|
|
if (IS_ERR(root)) {
|
|
- test_msg("Couldn't allocate root\n");
|
|
|
|
|
|
+ test_err("couldn't allocate root");
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -954,12 +958,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
ret = btrfs_set_extent_delalloc(inode, 0, BTRFS_MAX_EXTENT_SIZE - 1, 0,
|
|
ret = btrfs_set_extent_delalloc(inode, 0, BTRFS_MAX_EXTENT_SIZE - 1, 0,
|
|
NULL, 0);
|
|
NULL, 0);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("btrfs_set_extent_delalloc returned %d\n", ret);
|
|
|
|
|
|
+ test_err("btrfs_set_extent_delalloc returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents != 1) {
|
|
if (BTRFS_I(inode)->outstanding_extents != 1) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 1, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 1, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -969,12 +973,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
BTRFS_MAX_EXTENT_SIZE + sectorsize - 1,
|
|
BTRFS_MAX_EXTENT_SIZE + sectorsize - 1,
|
|
0, NULL, 0);
|
|
0, NULL, 0);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("btrfs_set_extent_delalloc returned %d\n", ret);
|
|
|
|
|
|
+ test_err("btrfs_set_extent_delalloc returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents != 2) {
|
|
if (BTRFS_I(inode)->outstanding_extents != 2) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 2, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 2, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -986,12 +990,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
EXTENT_DELALLOC | EXTENT_DIRTY |
|
|
EXTENT_DELALLOC | EXTENT_DIRTY |
|
|
EXTENT_UPTODATE, 0, 0, NULL);
|
|
EXTENT_UPTODATE, 0, 0, NULL);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("clear_extent_bit returned %d\n", ret);
|
|
|
|
|
|
+ test_err("clear_extent_bit returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents != 2) {
|
|
if (BTRFS_I(inode)->outstanding_extents != 2) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 2, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 2, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -1002,12 +1006,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
+ sectorsize - 1,
|
|
+ sectorsize - 1,
|
|
0, NULL, 0);
|
|
0, NULL, 0);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("btrfs_set_extent_delalloc returned %d\n", ret);
|
|
|
|
|
|
+ test_err("btrfs_set_extent_delalloc returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents != 2) {
|
|
if (BTRFS_I(inode)->outstanding_extents != 2) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 2, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 2, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -1020,12 +1024,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
(BTRFS_MAX_EXTENT_SIZE << 1) + 3 * sectorsize - 1,
|
|
(BTRFS_MAX_EXTENT_SIZE << 1) + 3 * sectorsize - 1,
|
|
0, NULL, 0);
|
|
0, NULL, 0);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("btrfs_set_extent_delalloc returned %d\n", ret);
|
|
|
|
|
|
+ test_err("btrfs_set_extent_delalloc returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents != 4) {
|
|
if (BTRFS_I(inode)->outstanding_extents != 4) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 4, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 4, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -1037,12 +1041,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
BTRFS_MAX_EXTENT_SIZE + sectorsize,
|
|
BTRFS_MAX_EXTENT_SIZE + sectorsize,
|
|
BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL, 0);
|
|
BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL, 0);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("btrfs_set_extent_delalloc returned %d\n", ret);
|
|
|
|
|
|
+ test_err("btrfs_set_extent_delalloc returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents != 3) {
|
|
if (BTRFS_I(inode)->outstanding_extents != 3) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 3, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 3, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -1054,12 +1058,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
EXTENT_DIRTY | EXTENT_DELALLOC |
|
|
EXTENT_DIRTY | EXTENT_DELALLOC |
|
|
EXTENT_UPTODATE, 0, 0, NULL);
|
|
EXTENT_UPTODATE, 0, 0, NULL);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("clear_extent_bit returned %d\n", ret);
|
|
|
|
|
|
+ test_err("clear_extent_bit returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents != 4) {
|
|
if (BTRFS_I(inode)->outstanding_extents != 4) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 4, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 4, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -1072,12 +1076,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
BTRFS_MAX_EXTENT_SIZE + sectorsize,
|
|
BTRFS_MAX_EXTENT_SIZE + sectorsize,
|
|
BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL, 0);
|
|
BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL, 0);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("btrfs_set_extent_delalloc returned %d\n", ret);
|
|
|
|
|
|
+ test_err("btrfs_set_extent_delalloc returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents != 3) {
|
|
if (BTRFS_I(inode)->outstanding_extents != 3) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 3, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 3, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -1087,12 +1091,12 @@ static int test_extent_accounting(u32 sectorsize, u32 nodesize)
|
|
EXTENT_DIRTY | EXTENT_DELALLOC |
|
|
EXTENT_DIRTY | EXTENT_DELALLOC |
|
|
EXTENT_UPTODATE, 0, 0, NULL);
|
|
EXTENT_UPTODATE, 0, 0, NULL);
|
|
if (ret) {
|
|
if (ret) {
|
|
- test_msg("clear_extent_bit returned %d\n", ret);
|
|
|
|
|
|
+ test_err("clear_extent_bit returned %d", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
if (BTRFS_I(inode)->outstanding_extents) {
|
|
if (BTRFS_I(inode)->outstanding_extents) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- test_msg("Miscount, wanted 0, got %u\n",
|
|
|
|
|
|
+ test_err("miscount, wanted 0, got %u",
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
BTRFS_I(inode)->outstanding_extents);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -1115,14 +1119,14 @@ int btrfs_test_inodes(u32 sectorsize, u32 nodesize)
|
|
set_bit(EXTENT_FLAG_COMPRESSED, &compressed_only);
|
|
set_bit(EXTENT_FLAG_COMPRESSED, &compressed_only);
|
|
set_bit(EXTENT_FLAG_PREALLOC, &prealloc_only);
|
|
set_bit(EXTENT_FLAG_PREALLOC, &prealloc_only);
|
|
|
|
|
|
- test_msg("Running btrfs_get_extent tests\n");
|
|
|
|
|
|
+ test_msg("running btrfs_get_extent tests\n");
|
|
ret = test_btrfs_get_extent(sectorsize, nodesize);
|
|
ret = test_btrfs_get_extent(sectorsize, nodesize);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
- test_msg("Running hole first btrfs_get_extent test\n");
|
|
|
|
|
|
+ test_msg("running hole first btrfs_get_extent test\n");
|
|
ret = test_hole_first(sectorsize, nodesize);
|
|
ret = test_hole_first(sectorsize, nodesize);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
- test_msg("Running outstanding_extents tests\n");
|
|
|
|
|
|
+ test_msg("running outstanding_extents tests\n");
|
|
return test_extent_accounting(sectorsize, nodesize);
|
|
return test_extent_accounting(sectorsize, nodesize);
|
|
}
|
|
}
|