Skip to content

Commit

Permalink
fixup! Export GenerateID and IDLength from overlay2 graphdriver
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgzr committed Jun 11, 2020
1 parent 8eb1639 commit 0eb1d72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions daemon/graphdriver/overlay2/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ const (
lowerFile = "lower"
maxDepth = 128

// idLength represents the number of random characters
// IDLength represents the number of random characters
// which can be used to create the unique link identifier
// for every layer. If this value is too long then the
// page size limit for the mount command may be exceeded.
// The idLength should be selected such that following equation
// The IDLength should be selected such that following equation
// is true (512 is a buffer for label metadata).
// ((idLength + len(linkDir) + 1) * maxDepth) <= (pageSize - 512)
// ((IDLength + len(linkDir) + 1) * maxDepth) <= (pageSize - 512)
IDLength = 26
)

Expand Down Expand Up @@ -371,7 +371,7 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts) (retErr
return err
}

lid := GenerateID(idLength)
lid := GenerateID(IDLength)
if err := os.Symlink(path.Join("..", id, diffDirName), path.Join(d.home, linkDir, lid)); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/overlay2/randomid.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"golang.org/x/sys/unix"
)

// generateID creates a new random string identifier with the given length
// GenerateID creates a new random string identifier with the given length
func GenerateID(l int) string {
const (
// ensures we backoff for less than 450ms total. Use the following to
Expand Down

0 comments on commit 0eb1d72

Please sign in to comment.