mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2026-02-02 15:45:13 +01:00
feat(volstats): return volstats for path if it is a mountpath
Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
1e5c81d2ac
commit
820d0800cd
2 changed files with 26 additions and 1 deletions
|
|
@ -273,9 +273,13 @@ func (ns *node) NodeGetVolumeStats(
|
|||
return nil, status.Error(codes.InvalidArgument, "path is not provided")
|
||||
}
|
||||
|
||||
if zfs.IsMountPath(path) == false {
|
||||
return nil, status.Error(codes.InvalidArgument, "path is not a mount path")
|
||||
}
|
||||
|
||||
var sfs unix.Statfs_t
|
||||
if err := unix.Statfs(path, &sfs); err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "statfs on %s was failed: %v", path, err)
|
||||
return nil, status.Errorf(codes.Internal, "statfs on %s failed: %v", path, err)
|
||||
}
|
||||
|
||||
var usage []*csi.VolumeUsage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue