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)
| 592 | // partsRequired calculates the number of parts needed for a given size |
| 593 | // using the specified part size. If partSize is 0, defaults to maxPartSize (5 GiB). |
| 594 | func partsRequired(size int64, partSize int64) int64 { |
| 595 | if partSize == 0 { |
| 596 | partSize = maxPartSize |
| 597 | } |
| 598 | r := size / partSize |
| 599 | if size%partSize > 0 { |
| 600 | r++ |
| 601 | } |
| 602 | return r |
| 603 | } |
| 604 | |
| 605 | // calculateEvenSplits - computes splits for a source and returns |
| 606 | // start and end index slices. Splits happen evenly to be sure that no |
no outgoing calls