func detectMountpoint(m mount.Interface, path string) string { … } const xfsMagic … // XFS over-allocates and then eventually removes that excess allocation. // That can lead to a file growing beyond its eventual size, causing // an unnecessary eviction: // // % ls -ls // total 32704 // 32704 -rw-r--r-- 1 rkrawitz rkrawitz 20971520 Jan 15 13:16 foo.bin // // This issue can be hit regardless of the means used to count storage. // It is not present in ext4fs. func isXfs(dir string) bool { … }