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

Method deregister

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

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

(&mut self, id: &str)

Source from the content-addressed store, hash-verified

293 ///
294 /// Returns the resulting process-local deregistration state.
295 fn deregister(&mut self, id: &str) -> VfioIdDeregistration {
296 match self.refcounts.get_mut(id) {
297 Some(count) if *count > 1 => {
298 *count -= 1;
299 VfioIdDeregistration::StillInUse
300 }
301 Some(_) => {
302 self.refcounts.remove(id);
303 VfioIdDeregistration::LastUser
304 }
305 None => VfioIdDeregistration::NotTracked,
306 }
307 }
308
309 fn clear(&mut self) {
310 self.refcounts.clear();

Callers 1

deregister_vfio_idFunction · 0.80

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected