mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-23 06:20:48 +02:00
Setup creates the mount point before weed mount starts, so statting and listing it succeeded on the plain directory and tests ran against local disk whenever the mount was slow or died. waitForMount now waits until the mount point's device id differs from its parent's. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
15 lines
284 B
Go
15 lines
284 B
Go
//go:build unix
|
|
|
|
package fuse
|
|
|
|
import "syscall"
|
|
|
|
// deviceID returns the device ID of the filesystem containing path.
|
|
func deviceID(path string) (uint64, error) {
|
|
var st syscall.Stat_t
|
|
if err := syscall.Stat(path, &st); err != nil {
|
|
return 0, err
|
|
}
|
|
return uint64(st.Dev), nil
|
|
}
|