Merge pull request #22775 from Microsoft/jjh/removewindowsdiff

Windows: Remove windowsdiff graph driver
This commit is contained in:
Vincent Demeester 2016-05-21 08:02:20 +02:00
Родитель 4afc4edd74 dd0fc2be8b
Коммит 7311d687e0
2 изменённых файлов: 4 добавлений и 47 удалений

Просмотреть файл

@ -4,8 +4,6 @@ var (
// Slice of drivers that should be used in order
priority = []string{
"windowsfilter",
"windowsdiff",
"vfs",
}
)

Просмотреть файл

@ -26,7 +26,6 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/docker/daemon/graphdriver"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/chrootarchive"
"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/longpath"
@ -35,28 +34,21 @@ import (
"github.com/vbatts/tar-split/tar/storage"
)
// filterDriver is an HCSShim driver type for the Windows Filter driver.
const filterDriver = 1
// init registers the windows graph drivers to the register.
func init() {
graphdriver.Register("windowsfilter", InitFilter)
graphdriver.Register("windowsdiff", InitDiff)
reexec.Register("docker-windows-write-layer", writeLayer)
}
const (
// diffDriver is an hcsshim driver type
diffDriver = iota
// filterDriver is an hcsshim driver type
filterDriver
)
// Driver represents a windows graph driver.
type Driver struct {
// info stores the shim driver information
info hcsshim.DriverInfo
}
var _ graphdriver.DiffGetterDriver = &Driver{}
func isTP5OrOlder() bool {
return system.GetOSVersion().Build <= 14300
}
@ -73,28 +65,9 @@ func InitFilter(home string, options []string, uidMaps, gidMaps []idtools.IDMap)
return d, nil
}
// InitDiff returns a new Windows differencing disk driver.
func InitDiff(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
logrus.Debugf("WindowsGraphDriver InitDiff at %s", home)
d := &Driver{
info: hcsshim.DriverInfo{
HomeDir: home,
Flavour: diffDriver,
},
}
return d, nil
}
// String returns the string representation of a driver.
func (d *Driver) String() string {
switch d.info.Flavour {
case diffDriver:
return "windowsdiff"
case filterDriver:
return "windowsfilter"
default:
return "Unknown driver flavour"
}
return "Windows filter storage driver"
}
// Status returns the status of the driver.
@ -390,20 +363,6 @@ func (d *Driver) Changes(id, parent string) ([]archive.Change, error) {
// new layer in bytes.
// The layer should not be mounted when calling this function
func (d *Driver) ApplyDiff(id, parent string, diff archive.Reader) (int64, error) {
if d.info.Flavour == diffDriver {
start := time.Now().UTC()
logrus.Debugf("WindowsGraphDriver ApplyDiff: Start untar layer")
destination := d.dir(id)
destination = filepath.Dir(destination)
size, err := chrootarchive.ApplyUncompressedLayer(destination, diff, nil)
if err != nil {
return 0, err
}
logrus.Debugf("WindowsGraphDriver ApplyDiff: Untar time: %vs", time.Now().UTC().Sub(start).Seconds())
return size, nil
}
var layerChain []string
if parent != "" {
rPId, err := d.resolveID(parent)