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:
@@ -172,9 +172,12 @@ typedef struct {
|
||||
|
||||
/* B_TRIM_DEVICE data structure */
|
||||
typedef struct {
|
||||
off_t offset; /* offset (in bytes) */
|
||||
off_t size;
|
||||
off_t trimmed_size; /* filled on return */
|
||||
uint32 range_count;
|
||||
uint64 trimmed_size; /* filled on return */
|
||||
struct range {
|
||||
uint64 offset; /* offset (in bytes) */
|
||||
uint64 size;
|
||||
} ranges[1];
|
||||
} fs_trim_data;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user