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

Function markDeviceID

plugins/snapshots/devmapper/metadata.go:209–221  ·  view source on GitHub ↗

markDeviceID marks a device as deviceFree or deviceTaken

(tx *bolt.Tx, deviceID uint32, state deviceIDState)

Source from the content-addressed store, hash-verified

207
208// markDeviceID marks a device as deviceFree or deviceTaken
209func markDeviceID(tx *bolt.Tx, deviceID uint32, state deviceIDState) error {
210 var (
211 bucket = tx.Bucket(deviceIDBucketName)
212 key = strconv.FormatUint(uint64(deviceID), 10)
213 value = []byte{byte(state)}
214 )
215
216 if err := bucket.Put([]byte(key), value); err != nil {
217 return fmt.Errorf("failed to free device id %q: %w", key, err)
218 }
219
220 return nil
221}
222
223// UpdateDevice updates device info in metadata store.
224// The callback should be used to indicate whether device info update was successful or not.

Callers 3

MarkFaultyMethod · 0.85
getNextDeviceIDFunction · 0.85
RemoveDeviceMethod · 0.85

Calls 1

PutMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…