aboutsummaryrefslogtreecommitdiff
path: root/weed/stats/disk_solaris.go
diff options
context:
space:
mode:
authorDominic Pearson <dsp@technoanimal.net>2024-06-03 07:10:28 +0200
committerGitHub <noreply@github.com>2024-06-02 22:10:28 -0700
commitd8bde9b96e1e314534cd76345c61c623c5824132 (patch)
tree6c32bce60220d2d313719d64b608bd414271a6d6 /weed/stats/disk_solaris.go
parent579ebbdf602c13c839f6e933163cf16f81d25bfb (diff)
downloadseaweedfs-d8bde9b96e1e314534cd76345c61c623c5824132.tar.xz
seaweedfs-d8bde9b96e1e314534cd76345c61c623c5824132.zip
Solaris disk support (#5638)
Diffstat (limited to 'weed/stats/disk_solaris.go')
-rw-r--r--weed/stats/disk_solaris.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/weed/stats/disk_solaris.go b/weed/stats/disk_solaris.go
new file mode 100644
index 000000000..cce20e4cc
--- /dev/null
+++ b/weed/stats/disk_solaris.go
@@ -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
+}