Skip to content

Commit

Permalink
Change HugepageLimit.Limit type to uint64
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <[email protected]>
  • Loading branch information
runcom committed Sep 17, 2015
1 parent cae6b31 commit cedd9d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libcontainer/cgroups/fs/hugetlb.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (s *HugetlbGroup) Apply(d *data) error {

func (s *HugetlbGroup) Set(path string, cgroup *configs.Cgroup) error {
for _, hugetlb := range cgroup.HugetlbLimit {
if err := writeFile(path, strings.Join([]string{"hugetlb", hugetlb.Pagesize, "limit_in_bytes"}, "."), strconv.Itoa(hugetlb.Limit)); err != nil {
if err := writeFile(path, strings.Join([]string{"hugetlb", hugetlb.Pagesize, "limit_in_bytes"}, "."), strconv.FormatUint(hugetlb.Limit, 10)); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/cgroups/fs/hugetlb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestHugetlbSetHugetlb(t *testing.T) {
)

helper.writeFileContents(map[string]string{
limit: strconv.Itoa(hugetlbBefore),
limit: strconv.FormatUint(hugetlbBefore, 10),
})

helper.CgroupData.c.HugetlbLimit = []*configs.HugepageLimit{
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/configs/hugepage_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ type HugepageLimit struct {
Pagesize string `json:"page_size"`

// usage limit for hugepage.
Limit int `json:"limit"`
Limit uint64 `json:"limit"`
}

0 comments on commit cedd9d0

Please sign in to comment.