mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
- A pool file, urgent-pending, signals urgent work on the host. An urgent cut holds it shared for its lease, and HoldUrgentPending lets a caller hold it across a stop or a drain. A Normal admission probes it exclusively without waiting and, while it is held, is refused with ErrUrgentPending (an ErrSlotsHeld, so the timer waits instead of failing). Urgent admissions are unaffected. - blockvolume checks --host-limit-dir before using it and refuses to start when it is missing or not a directory, under a temporary directory (/tmp, /var/tmp, /dev/shm, the process temp dir), on a network file system (NFS, CIFS, SMB2, FUSE on Linux), or already in use with different host-limit flags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
457 B
Go
25 lines
457 B
Go
//go:build linux
|
|
|
|
package hostlimit
|
|
|
|
import "syscall"
|
|
|
|
// remoteFS names the network file system dir is on, if it is on one.
|
|
func remoteFS(dir string) (string, bool) {
|
|
var st syscall.Statfs_t
|
|
if syscall.Statfs(dir, &st) != nil {
|
|
return "", false
|
|
}
|
|
switch uint32(st.Type) {
|
|
case 0x6969:
|
|
return "NFS", true
|
|
case 0xFF534D42:
|
|
return "CIFS", true
|
|
case 0xFE534D42:
|
|
return "SMB2", true
|
|
case 0x65735546:
|
|
return "FUSE", true
|
|
}
|
|
return "", false
|
|
}
|