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:
@@ -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;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user