MCPcopy Index your code
hub / github.com/containerd/containerd / createDevice

Method createDevice

plugins/snapshots/devmapper/pool_device.go:284–292  ·  view source on GitHub ↗

createDevice creates thin device

(ctx context.Context, info *DeviceInfo)

Source from the content-addressed store, hash-verified

282
283// createDevice creates thin device
284func (p *PoolDevice) createDevice(ctx context.Context, info *DeviceInfo) error {
285 if err := p.transition(ctx, info.Name, Creating, Created, func() error {
286 return dmsetup.CreateDevice(p.poolName, info.DeviceID)
287 }); err != nil {
288 return fmt.Errorf("failed to create new thin device %q (dev: %d): %w", info.Name, info.DeviceID, err)
289 }
290
291 return nil
292}
293
294// activateDevice activates thin device
295func (p *PoolDevice) activateDevice(ctx context.Context, info *DeviceInfo) error {

Callers 1

CreateThinDeviceMethod · 0.95

Calls 2

transitionMethod · 0.95
CreateDeviceFunction · 0.92

Tested by

no test coverage detected