diff options
author | David Sterba <dsterba@suse.cz> | 2013-04-30 12:51:57 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-06-14 11:29:17 -0400 |
commit | 905d0f564e9c07690c2b4f2508c1d5ed3db6354b (patch) | |
tree | a6b294f2582422c1235edad482d5d6594a52ba81 | |
parent | 8d599ae1bfc035c38660cdc1a756ae4150d25e01 (diff) |
btrfs: add prefix to sanity tests messages
And change the message level to KERN_INFO.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
-rw-r--r-- | fs/btrfs/free-space-cache.c | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index e53009657f0e..02c4d38f9e50 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -3150,6 +3150,8 @@ again: | |||
3150 | return 0; | 3150 | return 0; |
3151 | } | 3151 | } |
3152 | 3152 | ||
3153 | #define test_msg(fmt, ...) printk(KERN_INFO "btrfs: selftest: " fmt, ##__VA_ARGS__) | ||
3154 | |||
3153 | /* | 3155 | /* |
3154 | * This test just does basic sanity checking, making sure we can add an exten | 3156 | * This test just does basic sanity checking, making sure we can add an exten |
3155 | * entry and remove space from either end and the middle, and make sure we can | 3157 | * entry and remove space from either end and the middle, and make sure we can |
@@ -3159,63 +3161,63 @@ static int test_extents(struct btrfs_block_group_cache *cache) | |||
3159 | { | 3161 | { |
3160 | int ret = 0; | 3162 | int ret = 0; |
3161 | 3163 | ||
3162 | printk(KERN_ERR "Running extent only tests\n"); | 3164 | test_msg("Running extent only tests\n"); |
3163 | 3165 | ||
3164 | /* First just make sure we can remove an entire entry */ | 3166 | /* First just make sure we can remove an entire entry */ |
3165 | ret = btrfs_add_free_space(cache, 0, 4 * 1024 * 1024); | 3167 | ret = btrfs_add_free_space(cache, 0, 4 * 1024 * 1024); |
3166 | if (ret) { | 3168 | if (ret) { |
3167 | printk(KERN_ERR "Error adding initial extents %d\n", ret); | 3169 | test_msg("Error adding initial extents %d\n", ret); |
3168 | return ret; | 3170 | return ret; |
3169 | } | 3171 | } |
3170 | 3172 | ||
3171 | ret = btrfs_remove_free_space(cache, 0, 4 * 1024 * 1024); | 3173 | ret = btrfs_remove_free_space(cache, 0, 4 * 1024 * 1024); |
3172 | if (ret) { | 3174 | if (ret) { |
3173 | printk(KERN_ERR "Error removing extent %d\n", ret); | 3175 | test_msg("Error removing extent %d\n", ret); |
3174 | return ret; | 3176 | return ret; |
3175 | } | 3177 | } |
3176 | 3178 | ||
3177 | if (check_exists(cache, 0, 4 * 1024 * 1024)) { | 3179 | if (check_exists(cache, 0, 4 * 1024 * 1024)) { |
3178 | printk(KERN_ERR "Full remove left some lingering space\n"); | 3180 | test_msg("Full remove left some lingering space\n"); |
3179 | return -1; | 3181 | return -1; |
3180 | } | 3182 | } |
3181 | 3183 | ||
3182 | /* Ok edge and middle cases now */ | 3184 | /* Ok edge and middle cases now */ |
3183 | ret = btrfs_add_free_space(cache, 0, 4 * 1024 * 1024); | 3185 | ret = btrfs_add_free_space(cache, 0, 4 * 1024 * 1024); |
3184 | if (ret) { | 3186 | if (ret) { |
3185 | printk(KERN_ERR "Error adding half extent %d\n", ret); | 3187 | test_msg("Error adding half extent %d\n", ret); |
3186 | return ret; | 3188 | return ret; |
3187 | } | 3189 | } |
3188 | 3190 | ||
3189 | ret = btrfs_remove_free_space(cache, 3 * 1024 * 1024, 1 * 1024 * 1024); | 3191 | ret = btrfs_remove_free_space(cache, 3 * 1024 * 1024, 1 * 1024 * 1024); |
3190 | if (ret) { | 3192 | if (ret) { |
3191 | printk(KERN_ERR "Error removing tail end %d\n", ret); | 3193 | test_msg("Error removing tail end %d\n", ret); |
3192 | return ret; | 3194 | return ret; |
3193 | } | 3195 | } |
3194 | 3196 | ||
3195 | ret = btrfs_remove_free_space(cache, 0, 1 * 1024 * 1024); | 3197 | ret = btrfs_remove_free_space(cache, 0, 1 * 1024 * 1024); |
3196 | if (ret) { | 3198 | if (ret) { |
3197 | printk(KERN_ERR "Error removing front end %d\n", ret); | 3199 | test_msg("Error removing front end %d\n", ret); |
3198 | return ret; | 3200 | return ret; |
3199 | } | 3201 | } |
3200 | 3202 | ||
3201 | ret = btrfs_remove_free_space(cache, 2 * 1024 * 1024, 4096); | 3203 | ret = btrfs_remove_free_space(cache, 2 * 1024 * 1024, 4096); |
3202 | if (ret) { | 3204 | if (ret) { |
3203 | printk(KERN_ERR "Error removing middle peice %d\n", ret); | 3205 | test_msg("Error removing middle peice %d\n", ret); |
3204 | return ret; | 3206 | return ret; |
3205 | } | 3207 | } |
3206 | 3208 | ||
3207 | if (check_exists(cache, 0, 1 * 1024 * 1024)) { | 3209 | if (check_exists(cache, 0, 1 * 1024 * 1024)) { |
3208 | printk(KERN_ERR "Still have space at the front\n"); | 3210 | test_msg("Still have space at the front\n"); |
3209 | return -1; | 3211 | return -1; |
3210 | } | 3212 | } |
3211 | 3213 | ||
3212 | if (check_exists(cache, 2 * 1024 * 1024, 4096)) { | 3214 | if (check_exists(cache, 2 * 1024 * 1024, 4096)) { |
3213 | printk(KERN_ERR "Still have space in the middle\n"); | 3215 | test_msg("Still have space in the middle\n"); |
3214 | return -1; | 3216 | return -1; |
3215 | } | 3217 | } |
3216 | 3218 | ||
3217 | if (check_exists(cache, 3 * 1024 * 1024, 1 * 1024 * 1024)) { | 3219 | if (check_exists(cache, 3 * 1024 * 1024, 1 * 1024 * 1024)) { |
3218 | printk(KERN_ERR "Still have space at the end\n"); | 3220 | test_msg("Still have space at the end\n"); |
3219 | return -1; | 3221 | return -1; |
3220 | } | 3222 | } |
3221 | 3223 | ||
@@ -3230,34 +3232,34 @@ static int test_bitmaps(struct btrfs_block_group_cache *cache) | |||
3230 | u64 next_bitmap_offset; | 3232 | u64 next_bitmap_offset; |
3231 | int ret; | 3233 | int ret; |
3232 | 3234 | ||
3233 | printk(KERN_ERR "Running bitmap only tests\n"); | 3235 | test_msg("Running bitmap only tests\n"); |
3234 | 3236 | ||
3235 | ret = add_free_space_entry(cache, 0, 4 * 1024 * 1024, 1); | 3237 | ret = add_free_space_entry(cache, 0, 4 * 1024 * 1024, 1); |
3236 | if (ret) { | 3238 | if (ret) { |
3237 | printk(KERN_ERR "Couldn't create a bitmap entry %d\n", ret); | 3239 | test_msg("Couldn't create a bitmap entry %d\n", ret); |
3238 | return ret; | 3240 | return ret; |
3239 | } | 3241 | } |
3240 | 3242 | ||
3241 | ret = btrfs_remove_free_space(cache, 0, 4 * 1024 * 1024); | 3243 | ret = btrfs_remove_free_space(cache, 0, 4 * 1024 * 1024); |
3242 | if (ret) { | 3244 | if (ret) { |
3243 | printk(KERN_ERR "Error removing bitmap full range %d\n", ret); | 3245 | test_msg("Error removing bitmap full range %d\n", ret); |
3244 | return ret; | 3246 | return ret; |
3245 | } | 3247 | } |
3246 | 3248 | ||
3247 | if (check_exists(cache, 0, 4 * 1024 * 1024)) { | 3249 | if (check_exists(cache, 0, 4 * 1024 * 1024)) { |
3248 | printk(KERN_ERR "Left some space in bitmap\n"); | 3250 | test_msg("Left some space in bitmap\n"); |
3249 | return -1; | 3251 | return -1; |
3250 | } | 3252 | } |
3251 | 3253 | ||
3252 | ret = add_free_space_entry(cache, 0, 4 * 1024 * 1024, 1); | 3254 | ret = add_free_space_entry(cache, 0, 4 * 1024 * 1024, 1); |
3253 | if (ret) { | 3255 | if (ret) { |
3254 | printk(KERN_ERR "Couldn't add to our bitmap entry %d\n", ret); | 3256 | test_msg("Couldn't add to our bitmap entry %d\n", ret); |
3255 | return ret; | 3257 | return ret; |
3256 | } | 3258 | } |
3257 | 3259 | ||
3258 | ret = btrfs_remove_free_space(cache, 1 * 1024 * 1024, 2 * 1024 * 1024); | 3260 | ret = btrfs_remove_free_space(cache, 1 * 1024 * 1024, 2 * 1024 * 1024); |
3259 | if (ret) { | 3261 | if (ret) { |
3260 | printk(KERN_ERR "Couldn't remove middle chunk %d\n", ret); | 3262 | test_msg("Couldn't remove middle chunk %d\n", ret); |
3261 | return ret; | 3263 | return ret; |
3262 | } | 3264 | } |
3263 | 3265 | ||
@@ -3271,21 +3273,21 @@ static int test_bitmaps(struct btrfs_block_group_cache *cache) | |||
3271 | ret = add_free_space_entry(cache, next_bitmap_offset - | 3273 | ret = add_free_space_entry(cache, next_bitmap_offset - |
3272 | (2 * 1024 * 1024), 4 * 1024 * 1024, 1); | 3274 | (2 * 1024 * 1024), 4 * 1024 * 1024, 1); |
3273 | if (ret) { | 3275 | if (ret) { |
3274 | printk(KERN_ERR "Couldn't add space that straddles two bitmaps" | 3276 | test_msg("Couldn't add space that straddles two bitmaps %d\n", |
3275 | " %d\n", ret); | 3277 | ret); |
3276 | return ret; | 3278 | return ret; |
3277 | } | 3279 | } |
3278 | 3280 | ||
3279 | ret = btrfs_remove_free_space(cache, next_bitmap_offset - | 3281 | ret = btrfs_remove_free_space(cache, next_bitmap_offset - |
3280 | (1 * 1024 * 1024), 2 * 1024 * 1024); | 3282 | (1 * 1024 * 1024), 2 * 1024 * 1024); |
3281 | if (ret) { | 3283 | if (ret) { |
3282 | printk(KERN_ERR "Couldn't remove overlapping space %d\n", ret); | 3284 | test_msg("Couldn't remove overlapping space %d\n", ret); |
3283 | return ret; | 3285 | return ret; |
3284 | } | 3286 | } |
3285 | 3287 | ||
3286 | if (check_exists(cache, next_bitmap_offset - (1 * 1024 * 1024), | 3288 | if (check_exists(cache, next_bitmap_offset - (1 * 1024 * 1024), |
3287 | 2 * 1024 * 1024)) { | 3289 | 2 * 1024 * 1024)) { |
3288 | printk(KERN_ERR "Left some space when removing overlapping\n"); | 3290 | test_msg("Left some space when removing overlapping\n"); |
3289 | return -1; | 3291 | return -1; |
3290 | } | 3292 | } |
3291 | 3293 | ||
@@ -3300,7 +3302,7 @@ static int test_bitmaps_and_extents(struct btrfs_block_group_cache *cache) | |||
3300 | u64 bitmap_offset = (u64)(BITS_PER_BITMAP * 4096); | 3302 | u64 bitmap_offset = (u64)(BITS_PER_BITMAP * 4096); |
3301 | int ret; | 3303 | int ret; |
3302 | 3304 | ||
3303 | printk(KERN_ERR "Running bitmap and extent tests\n"); | 3305 | test_msg("Running bitmap and extent tests\n"); |
3304 | 3306 | ||
3305 | /* | 3307 | /* |
3306 | * First let's do something simple, an extent at the same offset as the | 3308 | * First let's do something simple, an extent at the same offset as the |
@@ -3309,42 +3311,42 @@ static int test_bitmaps_and_extents(struct btrfs_block_group_cache *cache) | |||
3309 | */ | 3311 | */ |
3310 | ret = add_free_space_entry(cache, 4 * 1024 * 1024, 1 * 1024 * 1024, 1); | 3312 | ret = add_free_space_entry(cache, 4 * 1024 * 1024, 1 * 1024 * 1024, 1); |
3311 | if (ret) { | 3313 | if (ret) { |
3312 | printk(KERN_ERR "Couldn't create bitmap entry %d\n", ret); | 3314 | test_msg("Couldn't create bitmap entry %d\n", ret); |
3313 | return ret; | 3315 | return ret; |
3314 | } | 3316 | } |
3315 | 3317 | ||
3316 | ret = add_free_space_entry(cache, 0, 1 * 1024 * 1024, 0); | 3318 | ret = add_free_space_entry(cache, 0, 1 * 1024 * 1024, 0); |
3317 | if (ret) { | 3319 | if (ret) { |
3318 | printk(KERN_ERR "Couldn't add extent entry %d\n", ret); | 3320 | test_msg("Couldn't add extent entry %d\n", ret); |
3319 | return ret; | 3321 | return ret; |
3320 | } | 3322 | } |
3321 | 3323 | ||
3322 | ret = btrfs_remove_free_space(cache, 0, 1 * 1024 * 1024); | 3324 | ret = btrfs_remove_free_space(cache, 0, 1 * 1024 * 1024); |
3323 | if (ret) { | 3325 | if (ret) { |
3324 | printk(KERN_ERR "Couldn't remove extent entry %d\n", ret); | 3326 | test_msg("Couldn't remove extent entry %d\n", ret); |
3325 | return ret; | 3327 | return ret; |
3326 | } | 3328 | } |
3327 | 3329 | ||
3328 | if (check_exists(cache, 0, 1 * 1024 * 1024)) { | 3330 | if (check_exists(cache, 0, 1 * 1024 * 1024)) { |
3329 | printk(KERN_ERR "Left remnants after our remove\n"); | 3331 | test_msg("Left remnants after our remove\n"); |
3330 | return -1; | 3332 | return -1; |
3331 | } | 3333 | } |
3332 | 3334 | ||
3333 | /* Now to add back the extent entry and remove from the bitmap */ | 3335 | /* Now to add back the extent entry and remove from the bitmap */ |
3334 | ret = add_free_space_entry(cache, 0, 1 * 1024 * 1024, 0); | 3336 | ret = add_free_space_entry(cache, 0, 1 * 1024 * 1024, 0); |
3335 | if (ret) { | 3337 | if (ret) { |
3336 | printk(KERN_ERR "Couldn't re-add extent entry %d\n", ret); | 3338 | test_msg("Couldn't re-add extent entry %d\n", ret); |
3337 | return ret; | 3339 | return ret; |
3338 | } | 3340 | } |
3339 | 3341 | ||
3340 | ret = btrfs_remove_free_space(cache, 4 * 1024 * 1024, 1 * 1024 * 1024); | 3342 | ret = btrfs_remove_free_space(cache, 4 * 1024 * 1024, 1 * 1024 * 1024); |
3341 | if (ret) { | 3343 | if (ret) { |
3342 | printk(KERN_ERR "Couldn't remove from bitmap %d\n", ret); | 3344 | test_msg("Couldn't remove from bitmap %d\n", ret); |
3343 | return ret; | 3345 | return ret; |
3344 | } | 3346 | } |
3345 | 3347 | ||
3346 | if (check_exists(cache, 4 * 1024 * 1024, 1 * 1024 * 1024)) { | 3348 | if (check_exists(cache, 4 * 1024 * 1024, 1 * 1024 * 1024)) { |
3347 | printk(KERN_ERR "Left remnants in the bitmap\n"); | 3349 | test_msg("Left remnants in the bitmap\n"); |
3348 | return -1; | 3350 | return -1; |
3349 | } | 3351 | } |
3350 | 3352 | ||
@@ -3354,19 +3356,18 @@ static int test_bitmaps_and_extents(struct btrfs_block_group_cache *cache) | |||
3354 | */ | 3356 | */ |
3355 | ret = add_free_space_entry(cache, 1 * 1024 * 1024, 4 * 1024 * 1024, 1); | 3357 | ret = add_free_space_entry(cache, 1 * 1024 * 1024, 4 * 1024 * 1024, 1); |
3356 | if (ret) { | 3358 | if (ret) { |
3357 | printk(KERN_ERR "Couldn't add to a bitmap %d\n", ret); | 3359 | test_msg("Couldn't add to a bitmap %d\n", ret); |
3358 | return ret; | 3360 | return ret; |
3359 | } | 3361 | } |
3360 | 3362 | ||
3361 | ret = btrfs_remove_free_space(cache, 512 * 1024, 3 * 1024 * 1024); | 3363 | ret = btrfs_remove_free_space(cache, 512 * 1024, 3 * 1024 * 1024); |
3362 | if (ret) { | 3364 | if (ret) { |
3363 | printk(KERN_ERR "Couldn't remove overlapping space %d\n", ret); | 3365 | test_msg("Couldn't remove overlapping space %d\n", ret); |
3364 | return ret; | 3366 | return ret; |
3365 | } | 3367 | } |
3366 | 3368 | ||
3367 | if (check_exists(cache, 512 * 1024, 3 * 1024 * 1024)) { | 3369 | if (check_exists(cache, 512 * 1024, 3 * 1024 * 1024)) { |
3368 | printk(KERN_ERR "Left over peices after removing " | 3370 | test_msg("Left over peices after removing overlapping\n"); |
3369 | "overlapping\n"); | ||
3370 | return -1; | 3371 | return -1; |
3371 | } | 3372 | } |
3372 | 3373 | ||
@@ -3375,24 +3376,24 @@ static int test_bitmaps_and_extents(struct btrfs_block_group_cache *cache) | |||
3375 | /* Now with the extent entry offset into the bitmap */ | 3376 | /* Now with the extent entry offset into the bitmap */ |
3376 | ret = add_free_space_entry(cache, 4 * 1024 * 1024, 4 * 1024 * 1024, 1); | 3377 | ret = add_free_space_entry(cache, 4 * 1024 * 1024, 4 * 1024 * 1024, 1); |
3377 | if (ret) { | 3378 | if (ret) { |
3378 | printk(KERN_ERR "Couldn't add space to the bitmap %d\n", ret); | 3379 | test_msg("Couldn't add space to the bitmap %d\n", ret); |
3379 | return ret; | 3380 | return ret; |
3380 | } | 3381 | } |
3381 | 3382 | ||
3382 | ret = add_free_space_entry(cache, 2 * 1024 * 1024, 2 * 1024 * 1024, 0); | 3383 | ret = add_free_space_entry(cache, 2 * 1024 * 1024, 2 * 1024 * 1024, 0); |
3383 | if (ret) { | 3384 | if (ret) { |
3384 | printk(KERN_ERR "Couldn't add extent to the cache %d\n", ret); | 3385 | test_msg("Couldn't add extent to the cache %d\n", ret); |
3385 | return ret; | 3386 | return ret; |
3386 | } | 3387 | } |
3387 | 3388 | ||
3388 | ret = btrfs_remove_free_space(cache, 3 * 1024 * 1024, 4 * 1024 * 1024); | 3389 | ret = btrfs_remove_free_space(cache, 3 * 1024 * 1024, 4 * 1024 * 1024); |
3389 | if (ret) { | 3390 | if (ret) { |
3390 | printk(KERN_ERR "Problem removing overlapping space %d\n", ret); | 3391 | test_msg("Problem removing overlapping space %d\n", ret); |
3391 | return ret; | 3392 | return ret; |
3392 | } | 3393 | } |
3393 | 3394 | ||
3394 | if (check_exists(cache, 3 * 1024 * 1024, 4 * 1024 * 1024)) { | 3395 | if (check_exists(cache, 3 * 1024 * 1024, 4 * 1024 * 1024)) { |
3395 | printk(KERN_ERR "Left something behind when removing space"); | 3396 | test_msg("Left something behind when removing space"); |
3396 | return -1; | 3397 | return -1; |
3397 | } | 3398 | } |
3398 | 3399 | ||
@@ -3410,27 +3411,27 @@ static int test_bitmaps_and_extents(struct btrfs_block_group_cache *cache) | |||
3410 | ret = add_free_space_entry(cache, bitmap_offset + 4 * 1024 * 1024, | 3411 | ret = add_free_space_entry(cache, bitmap_offset + 4 * 1024 * 1024, |
3411 | 4 * 1024 * 1024, 1); | 3412 | 4 * 1024 * 1024, 1); |
3412 | if (ret) { | 3413 | if (ret) { |
3413 | printk(KERN_ERR "Couldn't add bitmap %d\n", ret); | 3414 | test_msg("Couldn't add bitmap %d\n", ret); |
3414 | return ret; | 3415 | return ret; |
3415 | } | 3416 | } |
3416 | 3417 | ||
3417 | ret = add_free_space_entry(cache, bitmap_offset - 1 * 1024 * 1024, | 3418 | ret = add_free_space_entry(cache, bitmap_offset - 1 * 1024 * 1024, |
3418 | 5 * 1024 * 1024, 0); | 3419 | 5 * 1024 * 1024, 0); |
3419 | if (ret) { | 3420 | if (ret) { |
3420 | printk(KERN_ERR "Couldn't add extent entry %d\n", ret); | 3421 | test_msg("Couldn't add extent entry %d\n", ret); |
3421 | return ret; | 3422 | return ret; |
3422 | } | 3423 | } |
3423 | 3424 | ||
3424 | ret = btrfs_remove_free_space(cache, bitmap_offset + 1 * 1024 * 1024, | 3425 | ret = btrfs_remove_free_space(cache, bitmap_offset + 1 * 1024 * 1024, |
3425 | 5 * 1024 * 1024); | 3426 | 5 * 1024 * 1024); |
3426 | if (ret) { | 3427 | if (ret) { |
3427 | printk(KERN_ERR "Failed to free our space %d\n", ret); | 3428 | test_msg("Failed to free our space %d\n", ret); |
3428 | return ret; | 3429 | return ret; |
3429 | } | 3430 | } |
3430 | 3431 | ||
3431 | if (check_exists(cache, bitmap_offset + 1 * 1024 * 1024, | 3432 | if (check_exists(cache, bitmap_offset + 1 * 1024 * 1024, |
3432 | 5 * 1024 * 1024)) { | 3433 | 5 * 1024 * 1024)) { |
3433 | printk(KERN_ERR "Left stuff over\n"); | 3434 | test_msg("Left stuff over\n"); |
3434 | return -1; | 3435 | return -1; |
3435 | } | 3436 | } |
3436 | 3437 | ||
@@ -3444,20 +3445,19 @@ static int test_bitmaps_and_extents(struct btrfs_block_group_cache *cache) | |||
3444 | */ | 3445 | */ |
3445 | ret = add_free_space_entry(cache, 1 * 1024 * 1024, 2 * 1024 * 1024, 1); | 3446 | ret = add_free_space_entry(cache, 1 * 1024 * 1024, 2 * 1024 * 1024, 1); |
3446 | if (ret) { | 3447 | if (ret) { |
3447 | printk(KERN_ERR "Couldn't add bitmap entry %d\n", ret); | 3448 | test_msg("Couldn't add bitmap entry %d\n", ret); |
3448 | return ret; | 3449 | return ret; |
3449 | } | 3450 | } |
3450 | 3451 | ||
3451 | ret = add_free_space_entry(cache, 3 * 1024 * 1024, 1 * 1024 * 1024, 0); | 3452 | ret = add_free_space_entry(cache, 3 * 1024 * 1024, 1 * 1024 * 1024, 0); |
3452 | if (ret) { | 3453 | if (ret) { |
3453 | printk(KERN_ERR "Couldn't add extent entry %d\n", ret); | 3454 | test_msg("Couldn't add extent entry %d\n", ret); |
3454 | return ret; | 3455 | return ret; |
3455 | } | 3456 | } |
3456 | 3457 | ||
3457 | ret = btrfs_remove_free_space(cache, 1 * 1024 * 1024, 3 * 1024 * 1024); | 3458 | ret = btrfs_remove_free_space(cache, 1 * 1024 * 1024, 3 * 1024 * 1024); |
3458 | if (ret) { | 3459 | if (ret) { |
3459 | printk(KERN_ERR "Error removing bitmap and extent " | 3460 | test_msg("Error removing bitmap and extent overlapping %d\n", ret); |
3460 | "overlapping %d\n", ret); | ||
3461 | return ret; | 3461 | return ret; |
3462 | } | 3462 | } |
3463 | 3463 | ||
@@ -3469,11 +3469,11 @@ void btrfs_test_free_space_cache(void) | |||
3469 | { | 3469 | { |
3470 | struct btrfs_block_group_cache *cache; | 3470 | struct btrfs_block_group_cache *cache; |
3471 | 3471 | ||
3472 | printk(KERN_ERR "Running btrfs free space cache tests\n"); | 3472 | test_msg("Running btrfs free space cache tests\n"); |
3473 | 3473 | ||
3474 | cache = init_test_block_group(); | 3474 | cache = init_test_block_group(); |
3475 | if (!cache) { | 3475 | if (!cache) { |
3476 | printk(KERN_ERR "Couldn't run the tests\n"); | 3476 | test_msg("Couldn't run the tests\n"); |
3477 | return; | 3477 | return; |
3478 | } | 3478 | } |
3479 | 3479 | ||
@@ -3487,6 +3487,7 @@ out: | |||
3487 | __btrfs_remove_free_space_cache(cache->free_space_ctl); | 3487 | __btrfs_remove_free_space_cache(cache->free_space_ctl); |
3488 | kfree(cache->free_space_ctl); | 3488 | kfree(cache->free_space_ctl); |
3489 | kfree(cache); | 3489 | kfree(cache); |
3490 | printk(KERN_ERR "Free space cache tests finished\n"); | 3490 | test_msg("Free space cache tests finished\n"); |
3491 | } | 3491 | } |
3492 | #undef test_msg | ||
3492 | #endif /* CONFIG_BTRFS_FS_RUN_SANITY_TESTS */ | 3493 | #endif /* CONFIG_BTRFS_FS_RUN_SANITY_TESTS */ |