diff --git a/bd2fs.py b/bd2fs.py index 3ac1e45..89c3f67 100644 --- a/bd2fs.py +++ b/bd2fs.py @@ -124,15 +124,15 @@ class Bd2FsNodeServicer(csi_pb2_grpc.NodeServicer): return csi_pb2.NodeGetVolumeStatsResponse( usage=[ csi_pb2.VolumeUsage( - available=stats["fs_free"], + available=stats["fs_avail"], total=stats["fs_size"], - used=stats["fs_size"] - stats["fs_free"], + used=stats["fs_size"] - stats["fs_avail"], unit=csi_pb2.VolumeUsage.Unit.BYTES, ), csi_pb2.VolumeUsage( - available=stats["fs_files_free"], + available=stats["fs_files_avail"], total=stats["fs_files"], - used=stats["fs_files"] - stats["fs_files_free"], + used=stats["fs_files"] - stats["fs_files_avail"], unit=csi_pb2.VolumeUsage.Unit.INODES, ), ] diff --git a/metrics.py b/metrics.py index 93a64a7..4876e3f 100644 --- a/metrics.py +++ b/metrics.py @@ -10,9 +10,9 @@ def path_stats(path): fs_stat = os.statvfs(path) return { "fs_size": fs_stat.f_frsize * fs_stat.f_blocks, - "fs_free": fs_stat.f_frsize * fs_stat.f_bfree, + "fs_avail": fs_stat.f_frsize * fs_stat.f_bavail, "fs_files": fs_stat.f_files, - "fs_files_free": fs_stat.f_ffree, + "fs_files_avail": fs_stat.f_favail, }