Remove "Only allow to overwrite part of the bitmap" blockstore API feature

This commit is contained in:
Vitaliy Filippov
2025-08-10 17:57:04 +03:00
parent 2db8184cd8
commit 918ea34af2
+1 -20
View File
@@ -169,26 +169,7 @@ bool blockstore_impl_t::enqueue_write(blockstore_op_t *op)
if (op->opcode == BS_OP_WRITE_STABLE)
state |= BS_ST_INSTANT;
if (op->bitmap)
{
// Only allow to overwrite part of the object bitmap respective to the write's offset/len
uint32_t bit = op->offset/dsk.bitmap_granularity;
uint32_t bits_left = op->len/dsk.bitmap_granularity;
while (!(bit % 8) && bits_left >= 8)
{
// Copy bytes
dyn_ptr[bit/8] = ((uint8_t*)op->bitmap)[bit/8];
bit += 8;
bits_left -= 8;
}
while (bits_left > 0)
{
// Copy bits
dyn_ptr[bit/8] = (dyn_ptr[bit/8] & ~(1 << (bit%8)))
| (((uint8_t*)op->bitmap)[bit/8] & (1 << bit%8));
bit++;
bits_left--;
}
}
memcpy(dyn_ptr, op->bitmap, dsk.clean_entry_bitmap_size);
}
// Calculate checksums
// FIXME: Allow to receive checksums from outside?