| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_DISK_SPACE_H |
| 4 | #define NETDATA_DISK_SPACE_H |
| 5 | |
| 6 | #include "libnetdata/libnetdata.h" |
| 7 | |
| 8 | typedef struct { |
| 9 | uint64_t total_bytes; // Total disk size in bytes |
| 10 | uint64_t free_bytes; // Available disk space in bytes |
| 11 | uint64_t total_inodes; // Total number of inodes |
| 12 | uint64_t free_inodes; // Available inodes |
| 13 | bool is_read_only; // True if filesystem is read-only |
| 14 | } OS_SYSTEM_DISK_SPACE; |
| 15 | |
| 16 | #define OS_SYSTEM_DISK_SPACE_OK(space) ((space).total_bytes > 0) |
| 17 | #define OS_SYSTEM_DISK_SPACE_EMPTY (OS_SYSTEM_DISK_SPACE){ 0 } |
| 18 | |
| 19 | OS_SYSTEM_DISK_SPACE os_disk_space(const char *path); |
| 20 | |
| 21 | #endif //NETDATA_DISK_SPACE_H |