Files
seaweedfs/seaweed-block/core/hostlimit/remotefs_linux.go
T
pingqiuandClaude Opus 5.5 14f0d7401f hostlimit: background cuts wait while urgent work is pending; launch checks
- 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>
2026-11-21 17:26:46 -08:00

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
}