Skip to content

Commit

Permalink
Merge pull request #23490 from shishir-a412ed/dm_options_modularized
Browse files Browse the repository at this point in the history
Modularize dm.use_deferred_removal and dm.use_deferred_deletion logic.
  • Loading branch information
vdemeester authored Jun 14, 2016
2 parents 7d988a7 + cac6658 commit c69614d
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions daemon/graphdriver/devmapper/deviceset.go
Original file line number Diff line number Diff line change
Expand Up @@ -1621,19 +1621,7 @@ func (devices *DeviceSet) loadThinPoolLoopBackInfo() error {
return nil
}

func (devices *DeviceSet) initDevmapper(doInit bool) error {
// give ourselves to libdm as a log handler
devicemapper.LogInit(devices)

version, err := devicemapper.GetDriverVersion()
if err != nil {
// Can't even get driver version, assume not supported
return graphdriver.ErrNotSupported
}

if err := determineDriverCapabilities(version); err != nil {
return graphdriver.ErrNotSupported
}
func (devices *DeviceSet) enableDeferredRemovalDeletion() error {

// If user asked for deferred removal then check both libdm library
// and kernel driver support deferred removal otherwise error out.
Expand All @@ -1655,6 +1643,26 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
logrus.Debug("devmapper: Deferred deletion support enabled.")
devices.deferredDelete = true
}
return nil
}

func (devices *DeviceSet) initDevmapper(doInit bool) error {
// give ourselves to libdm as a log handler
devicemapper.LogInit(devices)

version, err := devicemapper.GetDriverVersion()
if err != nil {
// Can't even get driver version, assume not supported
return graphdriver.ErrNotSupported
}

if err := determineDriverCapabilities(version); err != nil {
return graphdriver.ErrNotSupported
}

if err := devices.enableDeferredRemovalDeletion(); err != nil {
return err
}

// https://github.com/docker/docker/issues/4036
if supported := devicemapper.UdevSetSyncSupport(true); !supported {
Expand Down

0 comments on commit c69614d

Please sign in to comment.