1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

devmapper: Rename DeviceSet.RemoveDevice to DeleteDevice

"Remove" is a bit overloaded, as it is also what deactivating a
device mapper device is called. Using "delete" is more clear here.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
This commit is contained in:
Alexander Larsson 2014-02-04 17:13:00 +01:00
parent 7fb8738839
commit 63d4b293e7
2 changed files with 5 additions and 5 deletions

View file

@ -290,7 +290,7 @@ func (devices *DeviceSet) setupBaseImage() error {
if oldInfo != nil && !oldInfo.Initialized {
utils.Debugf("Removing uninitialized base image")
if err := devices.removeDevice(""); err != nil {
if err := devices.deleteDevice(""); err != nil {
utils.Debugf("\n--->Err: %s\n", err)
return err
}
@ -562,7 +562,7 @@ func (devices *DeviceSet) AddDevice(hash, baseHash string) error {
return nil
}
func (devices *DeviceSet) removeDevice(hash string) error {
func (devices *DeviceSet) deleteDevice(hash string) error {
info := devices.Devices[hash]
if info == nil {
return fmt.Errorf("hash %s doesn't exists", hash)
@ -610,11 +610,11 @@ func (devices *DeviceSet) removeDevice(hash string) error {
return nil
}
func (devices *DeviceSet) RemoveDevice(hash string) error {
func (devices *DeviceSet) DeleteDevice(hash string) error {
devices.Lock()
defer devices.Unlock()
return devices.removeDevice(hash)
return devices.deleteDevice(hash)
}
func (devices *DeviceSet) deactivateDevice(hash string) error {

View file

@ -99,7 +99,7 @@ func (d *Driver) Remove(id string) error {
if err := d.unmount(id, mp); err != nil {
return err
}
return d.DeviceSet.RemoveDevice(id)
return d.DeviceSet.DeleteDevice(id)
}
func (d *Driver) Get(id string) (string, error) {