zfs_linux.go 504 B

1234567891011121314151617181920212223
  1. package zfs
  2. import (
  3. "fmt"
  4. "syscall"
  5. log "github.com/Sirupsen/logrus"
  6. "github.com/docker/docker/daemon/graphdriver"
  7. )
  8. func checkRootdirFs(rootdir string) error {
  9. var buf syscall.Statfs_t
  10. if err := syscall.Statfs(rootdir, &buf); err != nil {
  11. return fmt.Errorf("Failed to access '%s': %s", rootdir, err)
  12. }
  13. if graphdriver.FsMagic(buf.Type) != graphdriver.FsMagicZfs {
  14. log.Debugf("[zfs] no zfs dataset found for rootdir '%s'", rootdir)
  15. return graphdriver.ErrPrerequisites
  16. }
  17. return nil
  18. }