Lines Matching refs:item

345 	    ("unrhdr has postponed item for free"));
623 alloc_unr_specificl(struct unrhdr *uh, u_int item, void **p1, void **p2)
631 if (item < uh->low + uh->first || item > uh->high)
636 if (up == NULL && item - uh->low == uh->first) {
641 return (item);
644 i = item - uh->low - uh->first;
658 return (item);
660 /* Find the item which contains the unit we want to allocate. */
716 last = uh->high - uh->low - (item - uh->low);
722 return (item);
726 alloc_unr_specific(struct unrhdr *uh, u_int item)
737 i = alloc_unr_specificl(uh, item, &p1, &p2);
754 free_unrl(struct unrhdr *uh, u_int item, void **p1, void **p2)
760 KASSERT(item >= uh->low && item <= uh->high,
762 item, uh->low, uh->high));
764 item -= uh->low;
769 if (item + 1 == uh->first && upp == NULL) {
778 * freed item. The code below will subdivide it.
780 if (item < uh->first) {
783 up->len = uh->first - item;
788 item -= uh->first;
790 /* Find the item which contains the unit we want to free */
792 if (up->len > item)
794 item -= up->len;
801 KASSERT(bit_test(ub->map, item) != 0,
802 ("UNR: Freeing free item %d (bitmap)\n", item));
803 bit_clear(ub->map, item);
810 KASSERT(up->ptr == uh, ("UNR Freeing free item %d (run))\n", item));
820 /* Check if we can shift the item into the previous 'free' run */
822 if (item == 0 && upp != NULL && upp->ptr == NULL) {
830 /* Check if we can shift the item to the next 'free' run */
832 if (item == up->len - 1 && upn != NULL && upn->ptr == NULL) {
841 pl = up->len - (1 + item);
850 if (item > 0) {
852 upp->len = item;
863 free_unr(struct unrhdr *uh, u_int item)
871 free_unrl(uh, item, &p1, &p2);