MCPcopy Create free account
hub / github.com/F-Stack/f-stack / osd_get

Function osd_get

freebsd/kern/kern_osd.c:295–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295void *
296osd_get(u_int type, struct osd *osd, u_int slot)
297{
298 struct rm_priotracker tracker;
299 void *value;
300
301 KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type."));
302 KASSERT(slot > 0, ("Invalid slot."));
303 KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot."));
304
305 rm_rlock(&osdm[type].osd_object_lock, &tracker);
306 if (slot > osd->osd_nslots) {
307 value = NULL;
308 OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot);
309 } else {
310 value = osd->osd_slots[slot - 1];
311 OSD_DEBUG("Returning slot value (type=%u, slot=%u, value=%p).",
312 type, slot, value);
313 }
314 rm_runlock(&osdm[type].osd_object_lock, &tracker);
315 return (value);
316}
317
318void
319osd_del(u_int type, struct osd *osd, u_int slot)

Callers 3

khelp_remove_osdFunction · 0.85
khelp_get_osdFunction · 0.85
hhook_run_hooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected