| 293 | } |
| 294 | |
| 295 | void * |
| 296 | osd_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 | |
| 318 | void |
| 319 | osd_del(u_int type, struct osd *osd, u_int slot) |
no outgoing calls
no test coverage detected