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

Method createSnapshot

plugins/snapshots/devmapper/pool_device.go:377–391  ·  view source on GitHub ↗
(ctx context.Context, baseInfo, snapInfo *DeviceInfo)

Source from the content-addressed store, hash-verified

375}
376
377func (p *PoolDevice) createSnapshot(ctx context.Context, baseInfo, snapInfo *DeviceInfo) error {
378 if err := p.transition(ctx, snapInfo.Name, Creating, Created, func() error {
379 return dmsetup.CreateSnapshot(p.poolName, snapInfo.DeviceID, baseInfo.DeviceID)
380 }); err != nil {
381 return fmt.Errorf(
382 "failed to create snapshot %q (dev: %d) from %q (dev: %d): %w",
383 snapInfo.Name,
384 snapInfo.DeviceID,
385 baseInfo.Name,
386 baseInfo.DeviceID, err,
387 )
388 }
389
390 return nil
391}
392
393// SuspendDevice flushes the outstanding IO and blocks the further IO
394func (p *PoolDevice) SuspendDevice(ctx context.Context, deviceName string) error {

Callers 1

CreateSnapshotDeviceMethod · 0.95

Calls 2

transitionMethod · 0.95
CreateSnapshotFunction · 0.92

Tested by

no test coverage detected