mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
The change of this PR's 22 commits, carried onto current main as one commit (its base was 1884 commits behind). Fitted to main: - pacing: main's rule that fallback-only leases are not paced stays; a healthy lease is paced at the budget over the held normal and urgent slots (this PR's rule) instead of over the configured slot count. TestFallbackDoesNotUnpaceAHealthyLease keeps its property (a healthy lease beside a fallback lease is paced) with a 500 ms deadline, since a lone holder now gets the whole budget. - the cut loop keeps main's attempted hook and afterStaging (a failed attempt that staged new chunks retries at the next poll), with the ticket handling; the random retry delay is gone, as this PR intends. - imports and constants: neither side's removed ones return. - invariants: main's new rows and this PR's new and restated rows; the slot-wait row is this PR's (ticket order, the next poll). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
893 B
Go
36 lines
893 B
Go
//go:build linux
|
|
|
|
package hostlimit
|
|
|
|
import "syscall"
|
|
|
|
// remoteFS names the remote file system dir is on, if it is on one. The
|
|
// host-limit directory needs local flock semantics, which every local file
|
|
// system gives (tmpfs and overlay included); a remote one (NFS, CIFS/SMB,
|
|
// FUSE such as glusterfs, 9p, CephFS) can share the directory between
|
|
// hosts, whose tickets would then compare two monotonic clocks. Unknown
|
|
// types are accepted.
|
|
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 0x517B:
|
|
return "SMB", true
|
|
case 0x65735546:
|
|
return "FUSE", true
|
|
case 0x01021997:
|
|
return "9p", true
|
|
case 0x00C36400:
|
|
return "CephFS", true
|
|
}
|
|
return "", false
|
|
}
|