Use TRIM on Mac as well as Windows

Previously we only ran `fstrim` on Windows. Docker for Mac now supports
TRIM so we should run `fstrim` there too.

Note it's possible to turn off TRIM on the Mac at the virtual hardware
level via the database, but this should be harmless -- the `fstrim`
fails immediately with an obvious error if the device doesn't support it:
`fstrim: ioctl 0xc0185879 failed: Not supported`.

Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
David Scott 2016-12-06 11:58:32 +00:00
parent df3370f2fd
commit f570ef6dac

View File

@ -1,4 +1,8 @@
#!/bin/sh
# Windows always has TRIM support, clean out unused frequently
[ "$(mobyplatform)" = "windows" ] && /sbin/fstrim /var
# Windows and Mac have TRIM support, clean out unused frequently
case "$(mobyplatform)" in
"windows"|"mac")
/sbin/fstrim /var
;;
esac