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

Method GetDeviceNames

plugins/snapshots/devmapper/metadata.go:310–329  ·  view source on GitHub ↗

GetDeviceNames retrieves the list of device names currently stored in database

(ctx context.Context)

Source from the content-addressed store, hash-verified

308
309// GetDeviceNames retrieves the list of device names currently stored in database
310func (m *PoolMetadata) GetDeviceNames(ctx context.Context) ([]string, error) {
311 var (
312 names []string
313 err error
314 )
315
316 err = m.db.View(func(tx *bolt.Tx) error {
317 bucket := tx.Bucket(devicesBucketName)
318 return bucket.ForEach(func(k, _ []byte) error {
319 names = append(names, string(k))
320 return nil
321 })
322 })
323
324 if err != nil {
325 return nil, err
326 }
327
328 return names, nil
329}
330
331// Close closes metadata store
332func (m *PoolMetadata) Close() error {

Callers 3

ResetPoolMethod · 0.80
RemovePoolMethod · 0.80

Calls 1

ViewMethod · 0.65

Tested by 1