aboutsummaryrefslogtreecommitdiff
path: root/weed/stats/disk_openbsd.go
blob: 1be41e5c725a2149527a6308bf66aeb84e5878f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//go:build openbsd
// +build openbsd

package stats

import (
	"syscall"

	"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
)

func fillInDiskStatus(disk *volume_server_pb.DiskStatus) {
	fs := syscall.Statfs_t{}
	err := syscall.Statfs(disk.Dir, &fs)
	if err != nil {
		return
	}

	disk.All = fs.F_blocks * uint64(fs.F_bsize)
	disk.Free = fs.F_bfree * uint64(fs.F_bsize)
	calculateDiskRemaining(disk)

	return
}