diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 5ffe18c46e..38295271e8 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -50,6 +50,7 @@ import ( cutil "go.podman.io/common/pkg/util" "go.podman.io/storage" "go.podman.io/storage/pkg/chrootarchive" + "go.podman.io/storage/pkg/directory" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idmap" "go.podman.io/storage/pkg/idtools" @@ -100,8 +101,8 @@ func (c *Container) rootFsSize() (int64, error) { // for a given container. func (c *Container) rwSize() (int64, error) { if c.config.Rootfs != "" { - size, err := util.SizeOfPath(c.config.Rootfs) - return int64(size), err + size, err := directory.Size(c.config.Rootfs) + return size, err } layerSize, err := c.runtime.store.ContainerSize(c.ID()) diff --git a/pkg/util/utils.go b/pkg/util/utils.go index 9d027d38d4..4e034d95ce 100644 --- a/pkg/util/utils.go +++ b/pkg/util/utils.go @@ -25,7 +25,6 @@ import ( "github.com/opencontainers/runtime-spec/specs-go" "github.com/sirupsen/logrus" "go.podman.io/image/v5/types" - "go.podman.io/storage/pkg/directory" "go.podman.io/storage/pkg/fileutils" "go.podman.io/storage/pkg/idtools" "go.podman.io/storage/pkg/unshare" @@ -1200,15 +1199,6 @@ func LookupUser(name string) (*user.User, error) { return user.Lookup(name) } -// SizeOfPath determines the file usage of a given path. it was called volumeSize in v1 -// and now is made to be generic and take a path instead of a libpod volume -// -// Deprecated: use github.com/containers/storage/pkg/directory.Size() instead. -func SizeOfPath(path string) (uint64, error) { - size, err := directory.Size(path) - return uint64(size), err -} - // ParseRestartPolicy parses the value given to the --restart flag and returns the policy // and restart retries value func ParseRestartPolicy(policy string) (string, uint, error) {