v.22.12Improvement

filesystemAvailable now supports optional disk name argument; filesystemFree renamed to filesystemUnreserved

filesystemAvailable and related functions support one optional argument with disk name, and change filesystemFree to filesystemUnreserved. Closes #35076. #42064 (flynn).
The filesystemAvailable and related functions now support an optional argument to specify the disk name, and the filesystemFree function has been renamed to filesystemUnreserved.

Why it matters

This feature improves clarity and flexibility in disk space querying functions by allowing users to target specific disks using an optional disk name parameter. Renaming filesystemFree to filesystemUnreserved better reflects the semantics of the function, helping users avoid confusion about what disk space metrics are being reported.

How to use it

Users can call filesystemAvailable(disk_name) and related functions by optionally passing the disk name as a string argument to query space metrics of a specific disk. Additionally, when checking free space, they should use the filesystemUnreserved function instead of the deprecated filesystemFree.