2.3.13 FSCTL_FILE_LEVEL_TRIM Request

The FSCTL_FILE_LEVEL_TRIM operation informs the underlying storage medium that the contents of the given range of the file no longer needs to be maintained. This message allows the storage medium to manage its space more efficiently. This operation is required most commonly for Solid State Devices (SSD), as well as for thinly provisioned storage environments.

The FILE_LEVEL_TRIM data element follows.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Key

NumRanges

Ranges (variable)

...

Key (4 bytes): This field is used for byte range locks to uniquely identify different consumers of byte range locks on the same thread. Typically, this field is used only by remote protocols such as SMB or SMB2.

NumRanges (4 bytes): A count of how many Offset, Length pairs follow in the data item.

Ranges (variable): An array of zero or more FILE_LEVEL_TRIM_RANGE (section 2.3.13.1) data elements. The NumRanges field contains the number of FILE_LEVEL_TRIM_RANGE data elements in the array.