Lines Matching refs:osd

43 #include <sys/osd.h>
57 LIST_HEAD(, osd) osd_list; /* (l) */
64 static MALLOC_DEFINE(M_OSD, "osd", "Object Specific Data");
67 TUNABLE_INT("debug.osd", &osd_debug);
68 SYSCTL_INT(_debug, OID_AUTO, osd, CTLFLAG_RW, &osd_debug, 0, "OSD debug level");
78 static void do_osd_del(u_int type, struct osd *osd, u_int slot,
154 struct osd *osd, *tosd;
166 LIST_FOREACH_SAFE(osd, &osdm[type].osd_list, osd_next, tosd)
167 do_osd_del(type, osd, slot, 1);
200 osd_set(u_int type, struct osd *osd, u_int slot, void *value)
203 return (osd_set_reserved(type, osd, slot, NULL, value));
217 osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv,
227 if (slot > osd->osd_nslots) {
250 if (osd->osd_nslots != 0) {
251 memcpy(newptr, osd->osd_slots,
252 sizeof(void *) * osd->osd_nslots);
253 free(osd->osd_slots, M_OSD);
256 newptr = realloc(osd->osd_slots, sizeof(void *) * slot,
264 if (osd->osd_nslots == 0) {
270 LIST_INSERT_HEAD(&osdm[type].osd_list, osd, osd_next);
275 osd->osd_slots = newptr;
276 osd->osd_nslots = slot;
281 osd->osd_slots[slot - 1] = value;
295 osd_get(u_int type, struct osd *osd, u_int slot)
305 if (slot > osd->osd_nslots) {
309 value = osd->osd_slots[slot - 1];
318 osd_del(u_int type, struct osd *osd, u_int slot)
323 do_osd_del(type, osd, slot, 0);
328 do_osd_del(u_int type, struct osd *osd, u_int slot, int list_locked)
338 if (slot > osd->osd_nslots) {
342 if (osd->osd_slots[slot - 1] != NULL) {
343 osdm[type].osd_destructors[slot - 1](osd->osd_slots[slot - 1]);
344 osd->osd_slots[slot - 1] = NULL;
346 for (i = osd->osd_nslots - 1; i >= 0; i--) {
347 if (osd->osd_slots[i] != NULL) {
358 LIST_REMOVE(osd, osd_next);
361 free(osd->osd_slots, M_OSD);
362 osd->osd_slots = NULL;
363 osd->osd_nslots = 0;
364 } else if (slot == osd->osd_nslots) {
366 osd->osd_slots = realloc(osd->osd_slots,
372 KASSERT(osd->osd_slots != NULL, ("realloc() failed"));
373 osd->osd_nslots = i + 1;
375 osd->osd_nslots, type);
405 osd_exit(u_int type, struct osd *osd)
412 if (osd->osd_nslots == 0) {
413 KASSERT(osd->osd_slots == NULL, ("Non-null osd_slots."));
419 for (i = 1; i <= osd->osd_nslots; i++) {
421 do_osd_del(type, osd, i, 0);
444 SYSINIT(osd, SI_SUB_LOCK, SI_ORDER_ANY, osd_init, NULL);