1. A method of operating a data storage device comprising: placing commands received from a host in a queue; for a write command designated as write-barrier-insensitive by a host, optimizing an order of execution of the write command designated as write-barrier-insensitive without regard for write barrier commands issued by the host; and for a write command designated as write-barrier-sensitive by the host, writing data to the media only after writing data for previously received write barrier commands.