MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / register

Method register

crates/openshell-vfio/src/bind.rs:282–290  ·  view source on GitHub ↗

Record one active user of `id`. Returns the resulting process-local registration state.

(&mut self, id: &str)

Source from the content-addressed store, hash-verified

280 ///
281 /// Returns the resulting process-local registration state.
282 fn register(&mut self, id: &str) -> VfioIdRegistration {
283 let count = self.refcounts.entry(id.to_string()).or_insert(0);
284 *count += 1;
285 if *count == 1 {
286 VfioIdRegistration::FirstUser
287 } else {
288 VfioIdRegistration::AlreadyTracked
289 }
290 }
291
292 /// Record one fewer active user of `id`.
293 ///

Callers 1

register_vfio_new_idFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected