Skip to content

Commit 651c8f5

Browse files
committed
storage: remove parent param from ApplyDiff()
It is unused in all drivers now, so it can be removed. Signed-off-by: Paul Holzinger <[email protected]>
1 parent 639f0f5 commit 651c8f5

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

storage/drivers/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ type DiffDriver interface {
183183
// layer with the specified id and parent, returning the size of the
184184
// new layer in bytes.
185185
// The io.Reader must be an uncompressed stream.
186-
ApplyDiff(id string, parent string, options ApplyDiffOpts) (size int64, err error)
186+
ApplyDiff(id string, options ApplyDiffOpts) (size int64, err error)
187187
// DiffSize calculates the changes between the specified id
188188
// and its parent and returns the size in bytes of the changes
189189
// relative to its base filesystem directory.

storage/drivers/fsdiff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (gdw *NaiveDiffDriver) Changes(id string, idMappings *idtools.IDMappings, p
151151
// ApplyDiff extracts the changeset from the given diff into the
152152
// layer with the specified id and parent, returning the size of the
153153
// new layer in bytes.
154-
func (gdw *NaiveDiffDriver) ApplyDiff(id, parent string, options ApplyDiffOpts) (int64, error) {
154+
func (gdw *NaiveDiffDriver) ApplyDiff(id string, options ApplyDiffOpts) (int64, error) {
155155
driver := gdw.ProtoDriver
156156

157157
if options.Mappings == nil {

storage/drivers/graphtest/graphbench_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func DriverBenchDiffApplyN(b *testing.B, fileCount int, drivername string, drive
155155
b.Fatal(err)
156156
}
157157

158-
applyDiffSize, err := driver.ApplyDiff(diff, "", graphdriver.ApplyDiffOpts{})
158+
applyDiffSize, err := driver.ApplyDiff(diff, graphdriver.ApplyDiffOpts{})
159159
if err != nil {
160160
b.Fatal(err)
161161
}

storage/drivers/graphtest/graphtest_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ func DriverTestDiffApply(t testing.TB, fileCount int, drivername string, driverO
362362
t.Fatal(err)
363363
}
364364

365-
applyDiffSize, err := driver.ApplyDiff(diff, base, graphdriver.ApplyDiffOpts{Diff: bytes.NewReader(buf.Bytes())})
365+
applyDiffSize, err := driver.ApplyDiff(diff, graphdriver.ApplyDiffOpts{Diff: bytes.NewReader(buf.Bytes())})
366366
if err != nil {
367367
t.Fatal(err)
368368
}

storage/drivers/overlay/overlay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,7 @@ func (d *Driver) CommitStagedLayer(id string, sa *tempdir.StagedAddition) error
24372437
}
24382438

24392439
// ApplyDiff applies the new layer into a root
2440-
func (d *Driver) ApplyDiff(id, parent string, options graphdriver.ApplyDiffOpts) (size int64, err error) {
2440+
func (d *Driver) ApplyDiff(id string, options graphdriver.ApplyDiffOpts) (size int64, err error) {
24412441
applyDir, err := d.getDiffPath(id)
24422442
if err != nil {
24432443
return 0, err

storage/drivers/vfs/driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ func (d *Driver) CreateFromTemplate(id, template string, templateIDMappings *idt
132132
}
133133

134134
// ApplyDiff applies the new layer into a root
135-
func (d *Driver) ApplyDiff(id, parent string, options graphdriver.ApplyDiffOpts) (size int64, err error) {
135+
func (d *Driver) ApplyDiff(id string, options graphdriver.ApplyDiffOpts) (size int64, err error) {
136136
if d.ignoreChownErrors {
137137
options.IgnoreChownErrors = d.ignoreChownErrors
138138
}
139-
return d.naiveDiff.ApplyDiff(id, parent, options)
139+
return d.naiveDiff.ApplyDiff(id, options)
140140
}
141141

142142
// CreateReadWrite creates a layer that is writable for use as a container

storage/layers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2694,7 +2694,7 @@ func (r *layerStore) applyDiffWithOptions(to string, layerOptions *LayerOptions,
26942694
Mappings: r.layerMappings(layer),
26952695
MountLabel: layer.MountLabel,
26962696
}
2697-
return r.driver.ApplyDiff(layer.ID, layer.Parent, options)
2697+
return r.driver.ApplyDiff(layer.ID, options)
26982698
})
26992699
if err != nil {
27002700
return -1, err

0 commit comments

Comments
 (0)