+ this_blocks = nr_blocks;
+ if (this_blocks + bit > BLOCKS_PER_MAP)
+ this_blocks = BLOCKS_PER_MAP - bit;
+
+ if (this_blocks == BLOCKS_PER_MAP)
+ mask = -1U;
+ else
+ mask = ((1U << this_blocks) - 1) << bit;
+
+ fio_assert(td, !(f->file_map[idx] & mask));
+ f->file_map[idx] |= mask;
+ nr_blocks -= this_blocks;
+ blocks += this_blocks;
+ block += this_blocks;