partsRequired calculates the number of parts needed for a given size using the specified part size. If partSize is 0, defaults to maxPartSize (5 GiB).
(size int64, partSize int64)
| 574 | // partsRequired calculates the number of parts needed for a given size |
| 575 | // using the specified part size. If partSize is 0, defaults to maxPartSize (5 GiB). |
| 576 | func partsRequired(size int64, partSize int64) int64 { |
| 577 | if partSize == 0 { |
| 578 | partSize = maxPartSize |
| 579 | } |
| 580 | r := size / partSize |
| 581 | if size%partSize > 0 { |
| 582 | r++ |
| 583 | } |
| 584 | return r |
| 585 | } |
| 586 | |
| 587 | // calculateEvenSplits - computes splits for a source and returns |
| 588 | // start and end index slices. Splits happen evenly to be sure that no |
no outgoing calls