Just playing around with this today, and it’s very cool. FreeBSD 9.2 now supports TRIM/UNMAP for ZFS.
To see if your disk is reporting the capability, look for kern.cam.da.<device>.delete_method where <device> is the number of the da device, i.e. /dev/da5 is “5” in that place.
# sysctl -a | grep delete_method
I’ve tested this with a Pure Storage FlashArray, using FreeBSD 9.2 running under VMware, and an RDM LUN passed through to FreeBSD to give it native SCSI access. That’s da5 above showing the UNMAP method.
According to Alexander Motin, the following are supported and settable via sysctl:
NONE - no provisioning support reported by the device; DISABLE - provisioning support was disabled because of errors; ZERO - use WRITE SAME (10) command to write zeroes; WS10 - use WRITE SAME (10) command with UNMAP bit set; WS16 - use WRITE SAME (16) command with UNMAP bit set; UNMAP - use UNMAP command.