Solaris disk support (#5638)

This commit is contained in:
Dominic Pearson
2024-06-03 07:10:28 +02:00
committed by GitHub
parent 579ebbdf60
commit d8bde9b96e
5 changed files with 47 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
//go:build solaris
// +build solaris
package stats
import (
"golang.org/x/sys/unix"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
)
func fillInDiskStatus(disk *volume_server_pb.DiskStatus) {
var stat unix.Statvfs_t
err := unix.Statvfs(disk.Dir, &stat)
if err != nil {
return
}
disk.All = stat.Blocks * uint64(stat.Bsize)
disk.Free = stat.Bfree * uint64(stat.Bsize)
calculateDiskRemaining(disk)
return
}