libpod: fix unconvert linter warning
When linting for freebsd, Stat_t Bsize is always uint64, thus the following warning: > libpod/info.go:234:21: unnecessary conversion (unconvert) > allocated := uint64(grStats.Bsize) * grStats.Blocks > ^ Use an intermediate variable to save on linter annotations. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
6bf1923f3e
commit
c1c963affe
|
@ -231,14 +231,15 @@ func (r *Runtime) storeInfo() (*define.StoreInfo, error) {
|
|||
if err := syscall.Statfs(r.store.GraphRoot(), &grStats); err != nil {
|
||||
return nil, fmt.Errorf("unable to collect graph root usage for %q: %w", r.store.GraphRoot(), err)
|
||||
}
|
||||
allocated := uint64(grStats.Bsize) * grStats.Blocks
|
||||
bsize := uint64(grStats.Bsize) //nolint:unconvert,nolintlint // Bsize is not always uint64 on Linux.
|
||||
allocated := bsize * grStats.Blocks
|
||||
info := define.StoreInfo{
|
||||
ImageStore: imageInfo,
|
||||
ImageCopyTmpDir: os.Getenv("TMPDIR"),
|
||||
ContainerStore: conInfo,
|
||||
GraphRoot: r.store.GraphRoot(),
|
||||
GraphRootAllocated: allocated,
|
||||
GraphRootUsed: allocated - (uint64(grStats.Bsize) * grStats.Bfree),
|
||||
GraphRootUsed: allocated - (bsize * grStats.Bfree),
|
||||
RunRoot: r.store.RunRoot(),
|
||||
GraphDriverName: r.store.GraphDriverName(),
|
||||
GraphOptions: nil,
|
||||
|
|
Loading…
Reference in New Issue