MCPcopy
hub / github.com/containerd/containerd / findOverlayLowerdirs

Function findOverlayLowerdirs

core/mount/mount_linux.go:446–463  ·  view source on GitHub ↗

findOverlayLowerdirs returns the index of lowerdir in mount's options and all the lowerdir target.

(opts []string)

Source from the content-addressed store, hash-verified

444// findOverlayLowerdirs returns the index of lowerdir in mount's options and
445// all the lowerdir target.
446func findOverlayLowerdirs(opts []string) (int, []string) {
447 var (
448 idx = -1
449 prefix = "lowerdir="
450 )
451
452 for i, opt := range opts {
453 if strings.HasPrefix(opt, prefix) {
454 idx = i
455 break
456 }
457 }
458
459 if idx == -1 {
460 return -1, nil
461 }
462 return idx, strings.Split(opts[idx][len(prefix):], ":")
463}
464
465// longestCommonPrefix finds the longest common prefix in the string slice.
466func longestCommonPrefix(strs []string) string {

Callers 2

prepareIDMappedOverlayFunction · 0.85
compactLowerdirOptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…