Submit #2775 » 0001-sbin-newfs_hammer-optimize-blockmap-initialization-l.patch
sbin/hammer/ondisk.c | ||
---|---|---|
struct volume_info *root_vol;
|
||
struct buffer_info *buffer1 = NULL;
|
||
struct buffer_info *buffer2 = NULL;
|
||
struct hammer_blockmap_layer1 *layer1;
|
||
struct hammer_blockmap_layer2 *layer2;
|
||
struct hammer_blockmap_layer1 *layer1 = NULL;
|
||
struct hammer_blockmap_layer2 *layer2 = NULL;
|
||
hammer_off_t layer1_base;
|
||
hammer_off_t layer1_offset;
|
||
hammer_off_t layer2_offset;
|
||
... | ... | |
phys_offset < aligned_vol_free_end;
|
||
phys_offset += HAMMER_LARGEBLOCK_SIZE) {
|
||
modified1 = 0;
|
||
layer1_offset = layer1_base +
|
||
HAMMER_BLOCKMAP_LAYER1_OFFSET(phys_offset);
|
||
layer1 = get_buffer_data(layer1_offset, &buffer1, 0);
|
||
/*
|
||
* Get layer 1 when moving on to the next layer 1
|
||
*/
|
||
if ((phys_offset % HAMMER_BLOCKMAP_LAYER2) == 0) {
|
||
layer1_offset = layer1_base +
|
||
HAMMER_BLOCKMAP_LAYER1_OFFSET(phys_offset);
|
||
layer1 = get_buffer_data(layer1_offset, &buffer1, 0);
|
||
}
|
||
assert(layer1->phys_offset != HAMMER_BLOCKMAP_UNAVAIL);
|
||
assert(layer1 && layer1->phys_offset != HAMMER_BLOCKMAP_UNAVAIL);
|
||
layer2_offset = layer1->phys_offset +
|
||
HAMMER_BLOCKMAP_LAYER2_OFFSET(phys_offset);
|
||