trim: Target SCSI UNMAP command instead of WRITE SAME.

* The UNMAP command is theoretically much faster, as it can get many block
  ranges instead of just a single range.
* Furthermore, the ATA TRIM command resembles it much better.
* Therefore, fs_trim_data now gets an array of ranges, and we use SCSI UNMAP
  to trim.
* Updated BFS code to collect array ranges to fully support the new
  fs_trim_data possibilities.
This commit is contained in:
Axel Dörfler
2013-11-07 19:03:47 +01:00
parent 960c56aea5
commit 99086aa323
13 changed files with 249 additions and 64 deletions
+6 -3
View File
@@ -215,9 +215,12 @@ typedef struct {
/* B_TRIM_DEVICE data structure */
typedef struct {
fssh_off_t offset; /* offset (in bytes) */
fssh_off_t size;
fssh_off_t trimmed_size; /* filled on return */
uint32_t range_count;
uint64_t trimmed_size; /* filled on return */
struct range {
uint64_t offset; /* offset (in bytes) */
uint64_t size;
} ranges[1];
} fssh_fs_trim_data;