mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
Add comment to source code
Signed-off-by: 陈德 <chende@caicloud.io>
This commit is contained in:
parent
ecadd564b1
commit
0a62485365
@ -57,6 +57,11 @@ func (d *driver) Cap() (*storage.Capacity, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// When container is run in MacOS, `bsize` obtained by `statfs` syscall is not the fundamental block size,
|
||||
// but the `iosize` (optimal transfer block size) instead, it's usually 1024 times larger than the `bsize`.
|
||||
// for example `4096 * 1024`. To get the correct block size, we should use `frsize`. But `frsize` isn't
|
||||
// guaranteed to be supported everywhere, so we need to check whether it's supported before use it.
|
||||
// For more details, please refer to: https://github.com/docker/for-mac/issues/2136
|
||||
bSize := uint64(stat.Bsize)
|
||||
field := reflect.ValueOf(&stat).Elem().FieldByName("Frsize")
|
||||
if field.IsValid() {
|
||||
|
Loading…
Reference in New Issue
Block a user