mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #13586 from kvasdopil/zfs-88chars
Avoid 88-chars mountpoint length limit on freebsd
This commit is contained in:
commit
9069cded57
4 changed files with 23 additions and 1 deletions
|
@ -212,7 +212,7 @@ func (d *Driver) ZfsPath(id string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) MountPath(id string) string {
|
func (d *Driver) MountPath(id string) string {
|
||||||
return path.Join(d.options.mountPath, "graph", id)
|
return path.Join(d.options.mountPath, "graph", getMountpoint(id))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) Create(id string, parent string) error {
|
func (d *Driver) Create(id string, parent string) error {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package zfs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
|
@ -22,3 +23,16 @@ func checkRootdirFs(rootdir string) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getMountpoint(id string) string {
|
||||||
|
maxlen := 12
|
||||||
|
|
||||||
|
// we need to preserve filesystem suffix
|
||||||
|
suffix := strings.SplitN(id, "-", 2)
|
||||||
|
|
||||||
|
if len(suffix) > 1 {
|
||||||
|
return id[:maxlen] + "-" + suffix[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
return id[:maxlen]
|
||||||
|
}
|
||||||
|
|
|
@ -21,3 +21,7 @@ func checkRootdirFs(rootdir string) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getMountpoint(id string) string {
|
||||||
|
return id
|
||||||
|
}
|
||||||
|
|
|
@ -5,3 +5,7 @@ package zfs
|
||||||
func checkRootdirFs(rootdir string) error {
|
func checkRootdirFs(rootdir string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getMountpoint(id string) string {
|
||||||
|
return id
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue