doc: Add comments in src files of Lite

One comment is a TODO about the possibility of doing slice garbage collection dynamically instead of requiring a reload. The other is a warning about the importance of terminating a TRIM bio before it reaches the block device, otherwise plausible deniability might break.
This commit is contained in:
Tommaso Gagliardoni 2025-08-25 16:47:18 +02:00
parent 550a4a5804
commit f0288879c4
2 changed files with 5 additions and 0 deletions

View file

@ -60,6 +60,9 @@ unlock:
up_read(&svol->posmap.flush_lock);
/* Done */
/* WARNING: it is crucial that the original bio is terminated here and never
reaches the block device, otherwise the effect of a TRIM on the block device
would be obvious, and likely to break plausible deniability */
bio_endio(orig_bio);
return;
}

View file

@ -127,6 +127,8 @@ int sflite_destroy_local_slice_mapping(struct sflite_volume *svol, u32 lsi)
so the counters must remain untouched to avoid confusion. */
// sdev->nr_free_slices++;
// svol->posmap.nr_mapped_slices--;
/* TODO: possible to improve by freeing up slices dynamically instead of
requiring reload/close-open? */
/* Set the dirty bit in position map */
__set_bit(lsi/SFLITE_PSIS_PER_BLOCK, svol->posmap.dirty_bitmap);