Expand description
Filesystem free-space probing: statvfs on Unix, GetDiskFreeSpaceExW on
Windows, both through fs4.
Two consumers share this: decdn node doctor compares the configured cache
budget against the real volume advisorily, and the node’s eviction driver
clamps its effective ceiling to real free disk each tick (#1930). Sharing one
implementation keeps the advisory check and the runtime clamp measuring the
same numbers.
Structs§
- Disk
Space - Total and unprivileged-available bytes at a path.
Functions§
- read_
disk_ space - Read filesystem capacity at
path. On Unix, bytes = fragment size × block counts (f_frsize × f_blocks,f_frsize × f_bavail); on Windows, the caller-visible totalsGetDiskFreeSpaceExWreports. - statvfs_
target - Probe the path, or the nearest existing ancestor if it does not exist yet. The cache directory can be probed before it is created (pre-boot doctor) or after (the running eviction driver); walking to the nearest existing ancestor gives the right volume in both cases.