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

Method GetDevice

plugins/snapshots/devmapper/metadata.go:259–271  ·  view source on GitHub ↗

GetDevice retrieves device info by name from database

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

257
258// GetDevice retrieves device info by name from database
259func (m *PoolMetadata) GetDevice(ctx context.Context, name string) (*DeviceInfo, error) {
260 var (
261 dev DeviceInfo
262 err error
263 )
264
265 err = m.db.View(func(tx *bolt.Tx) error {
266 bucket := tx.Bucket(devicesBucketName)
267 return getObject(bucket, name, &dev)
268 })
269
270 return &dev, err
271}
272
273// RemoveDevice removes device info from store.
274func (m *PoolMetadata) RemoveDevice(ctx context.Context, name string) error {

Callers 9

CreateSnapshotDeviceMethod · 0.80
RemoveDeviceMethod · 0.80
TestPoolDeviceFunction · 0.80
testCreateThinDeviceFunction · 0.80

Calls 2

getObjectFunction · 0.85
ViewMethod · 0.65

Tested by 7

TestPoolDeviceFunction · 0.64
testCreateThinDeviceFunction · 0.64