Browse code

Windows: Remove windowsdiff driver

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2016/05/17 08:13:39
Showing 2 changed files
... ...
@@ -4,8 +4,6 @@ var (
4 4
 	// Slice of drivers that should be used in order
5 5
 	priority = []string{
6 6
 		"windowsfilter",
7
-		"windowsdiff",
8
-		"vfs",
9 7
 	}
10 8
 )
11 9
 
... ...
@@ -26,7 +26,6 @@ import (
26 26
 	"github.com/Sirupsen/logrus"
27 27
 	"github.com/docker/docker/daemon/graphdriver"
28 28
 	"github.com/docker/docker/pkg/archive"
29
-	"github.com/docker/docker/pkg/chrootarchive"
30 29
 	"github.com/docker/docker/pkg/idtools"
31 30
 	"github.com/docker/docker/pkg/ioutils"
32 31
 	"github.com/docker/docker/pkg/longpath"
... ...
@@ -35,28 +34,21 @@ import (
35 35
 	"github.com/vbatts/tar-split/tar/storage"
36 36
 )
37 37
 
38
+// filterDriver is an HCSShim driver type for the Windows Filter driver.
39
+const filterDriver = 1
40
+
38 41
 // init registers the windows graph drivers to the register.
39 42
 func init() {
40 43
 	graphdriver.Register("windowsfilter", InitFilter)
41
-	graphdriver.Register("windowsdiff", InitDiff)
42 44
 	reexec.Register("docker-windows-write-layer", writeLayer)
43 45
 }
44 46
 
45
-const (
46
-	// diffDriver is an hcsshim driver type
47
-	diffDriver = iota
48
-	// filterDriver is an hcsshim driver type
49
-	filterDriver
50
-)
51
-
52 47
 // Driver represents a windows graph driver.
53 48
 type Driver struct {
54 49
 	// info stores the shim driver information
55 50
 	info hcsshim.DriverInfo
56 51
 }
57 52
 
58
-var _ graphdriver.DiffGetterDriver = &Driver{}
59
-
60 53
 func isTP5OrOlder() bool {
61 54
 	return system.GetOSVersion().Build <= 14300
62 55
 }
... ...
@@ -73,28 +65,9 @@ func InitFilter(home string, options []string, uidMaps, gidMaps []idtools.IDMap)
73 73
 	return d, nil
74 74
 }
75 75
 
76
-// InitDiff returns a new Windows differencing disk driver.
77
-func InitDiff(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
78
-	logrus.Debugf("WindowsGraphDriver InitDiff at %s", home)
79
-	d := &Driver{
80
-		info: hcsshim.DriverInfo{
81
-			HomeDir: home,
82
-			Flavour: diffDriver,
83
-		},
84
-	}
85
-	return d, nil
86
-}
87
-
88 76
 // String returns the string representation of a driver.
89 77
 func (d *Driver) String() string {
90
-	switch d.info.Flavour {
91
-	case diffDriver:
92
-		return "windowsdiff"
93
-	case filterDriver:
94
-		return "windowsfilter"
95
-	default:
96
-		return "Unknown driver flavour"
97
-	}
78
+	return "Windows filter storage driver"
98 79
 }
99 80
 
100 81
 // Status returns the status of the driver.
... ...
@@ -390,20 +363,6 @@ func (d *Driver) Changes(id, parent string) ([]archive.Change, error) {
390 390
 // new layer in bytes.
391 391
 // The layer should not be mounted when calling this function
392 392
 func (d *Driver) ApplyDiff(id, parent string, diff archive.Reader) (int64, error) {
393
-	if d.info.Flavour == diffDriver {
394
-		start := time.Now().UTC()
395
-		logrus.Debugf("WindowsGraphDriver ApplyDiff: Start untar layer")
396
-		destination := d.dir(id)
397
-		destination = filepath.Dir(destination)
398
-		size, err := chrootarchive.ApplyUncompressedLayer(destination, diff, nil)
399
-		if err != nil {
400
-			return 0, err
401
-		}
402
-		logrus.Debugf("WindowsGraphDriver ApplyDiff: Untar time: %vs", time.Now().UTC().Sub(start).Seconds())
403
-
404
-		return size, nil
405
-	}
406
-
407 393
 	var layerChain []string
408 394
 	if parent != "" {
409 395
 		rPId, err := d.resolveID(parent)