/* FIXME: we do not handle errors here now */
- check_me("vs-420", reiser4_alloc_blocks (preceder, first_allocated, allocated, BA_PERMANENT) == 0);
+ check_me("vs-420", reiser4_alloc_blocks(preceder, first_allocated, allocated, BA_PERMANENT) == 0);
/* update flush_pos's preceder to last allocated block number */
preceder->blk = *first_allocated + *allocated - 1;
}
@@ -795,6 +797,10 @@ alloc_extent(flush_pos_t *flush_pos)
else
block_stage = BLOCK_UNALLOCATED;
+ /* look at previous unit if possible. If it is allocated, make preceder more precise */
+ if (coord->unit_pos && (state_of_extent(ext - 1) == ALLOCATED_EXTENT))
+ pos_hint(flush_pos)->blk = extent_get_start(ext - 1) + extent_get_width(ext - 1);
+
/* allocate new block numbers for protected nodes */
extent_allocate_blocks(pos_hint(flush_pos), protected, &first_allocated, &allocated, block_stage);
+ /* look at previous unit if possible. If it is allocated, make preceder more precise */
+ if (coord->unit_pos && (state_of_extent(ext - 1) == ALLOCATED_EXTENT))
+ pos_hint(flush_pos)->blk = extent_get_start(ext - 1) + extent_get_width(ext - 1);
+
/* allocate new block numbers for protected nodes */
extent_allocate_blocks(pos_hint(flush_pos), protected, &first_allocated, &allocated, block_stage);
if (allocated != protected)