Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

[local-volume] Refactored GetFsAvailableByte to avoid using Frsize in local-volume provisioner #226

Merged
merged 2 commits into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
89 changes: 83 additions & 6 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions local-volume/provisioner/pkg/util/volume_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"os"
"path/filepath"

"golang.org/x/sys/unix"

"github.com/golang/glog"

"k8s.io/kubernetes/pkg/volume/util"
)

// VolumeUtil is an interface for local filesystem operations
Expand Down Expand Up @@ -106,14 +106,10 @@ func (u *volumeUtil) DeleteContents(fullPath string) error {

// GetFsAvailableByte returns available capacity in byte about a mounted filesystem.
// fullPath is the pathname of any file within the mounted filesystem. Capacity
// returned here is total capacity available to non-root users, and does not include
// fs reserved space.
// returned here is total capacity available.
func (u *volumeUtil) GetFsAvailableByte(fullPath string) (uint64, error) {
var s unix.Statfs_t
if err := unix.Statfs(fullPath, &s); err != nil {
return 0, err
}
return uint64(s.Frsize) * (s.Blocks - s.Bfree + s.Bavail), nil
available, _, _, _, _, _, err := util.FsInfo(fullPath)
return uint64(available), err
}

var _ VolumeUtil = &FakeVolumeUtil{}
Expand Down
9 changes: 9 additions & 0 deletions vendor/github.com/aws/aws-sdk-go/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/aws/aws-sdk-go/aws/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions vendor/github.com/docker/distribution/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions vendor/github.com/docker/distribution/.mailmap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

128 changes: 128 additions & 0 deletions vendor/github.com/docker/distribution/AUTHORS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading