stat-util: add vfs_free_bytes()

The casts and the right fields to multiply aren't entirely trivial,
let's add a helper for it.
This commit is contained in:
Lennart Poettering
2026-04-17 18:32:21 +02:00
parent d7b6d89d90
commit 7e8882a96f
3 changed files with 22 additions and 3 deletions
+2
View File
@@ -161,3 +161,5 @@ static inline bool inode_type_can_hardlink(mode_t m) {
* type). */
return IN_SET(m & S_IFMT, S_IFSOCK, S_IFLNK, S_IFREG, S_IFBLK, S_IFCHR, S_IFIFO);
}
int vfs_free_bytes(int fd, uint64_t *ret);