mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Do not calculate size for local volumes with mount
Local volumes support mount options which, when in use, can mount external file systems. We don't really need to enumerate these external filesystems which may be a very slow process. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
d7c125791a
commit
0822d90364
1 changed files with 7 additions and 0 deletions
|
@ -65,6 +65,13 @@ func (daemon *Daemon) SystemDiskUsage(ctx context.Context) (*types.DiskUsage, er
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return ctx.Err()
|
return ctx.Err()
|
||||||
default:
|
default:
|
||||||
|
if d, ok := v.(volume.DetailedVolume); ok {
|
||||||
|
// skip local volumes with mount options since these could have external
|
||||||
|
// mounted filesystems that will be slow to enumerate.
|
||||||
|
if len(d.Options()) > 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
name := v.Name()
|
name := v.Name()
|
||||||
refs := daemon.volumes.Refs(v)
|
refs := daemon.volumes.Refs(v)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue