From a9785ff951c623a499d821c264ded1d18021a557 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Mon, 7 Nov 2016 21:04:41 +0900 Subject: [PATCH] sbin/hammer: Cleanup alloc_blockmap() Layer1 could be assertion. It's essentially the same as what 0d1f6085 in 2015 checks. --- sbin/hammer/blockmap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sbin/hammer/blockmap.c b/sbin/hammer/blockmap.c index b31f31d783..6096394c64 100644 --- a/sbin/hammer/blockmap.c +++ b/sbin/hammer/blockmap.c @@ -156,13 +156,9 @@ again: layer1_offset = freemap->phys_offset + HAMMER_BLOCKMAP_LAYER1_OFFSET(blockmap->next_offset); layer1 = get_buffer_data(layer1_offset, &buffer1, 0); + assert(layer1->phys_offset != HAMMER_BLOCKMAP_UNAVAIL); assert(!(chunk_offset == 0 && layer1->blocks_free == 0)); - if (layer1->phys_offset == HAMMER_BLOCKMAP_UNAVAIL) { - fprintf(stderr, "alloc_blockmap: ran out of space!\n"); - exit(1); - } - /* * Dive layer 2, each entry represents a big-block. */ @@ -171,7 +167,7 @@ again: layer2 = get_buffer_data(layer2_offset, &buffer2, 0); if (layer2->zone == HAMMER_ZONE_UNAVAIL_INDEX) { - fprintf(stderr, "alloc_blockmap: ran out of space!\n"); + fprintf(stderr, "alloc_blockmap: layer2 ran out of space!\n"); exit(1); } -- 2.11.4.GIT