Lines Matching refs:pos
57 static void down_heap(struct timer **heap, int pos) in down_heap() argument
60 struct timer *t = heap[pos]; in down_heap()
62 while ( (nxt = (pos << 1)) <= sz ) in down_heap()
68 heap[pos] = heap[nxt]; in down_heap()
69 heap[pos]->heap_offset = pos; in down_heap()
70 pos = nxt; in down_heap()
73 heap[pos] = t; in down_heap()
74 t->heap_offset = pos; in down_heap()
78 static void up_heap(struct timer **heap, int pos) in up_heap() argument
80 struct timer *t = heap[pos]; in up_heap()
82 while ( (pos > 1) && (t->expires < heap[pos>>1]->expires) ) in up_heap()
84 heap[pos] = heap[pos>>1]; in up_heap()
85 heap[pos]->heap_offset = pos; in up_heap()
86 pos >>= 1; in up_heap()
89 heap[pos] = t; in up_heap()
90 t->heap_offset = pos; in up_heap()
98 int pos = t->heap_offset; in remove_from_heap() local
100 if ( unlikely(pos == sz) ) in remove_from_heap()
106 heap[pos] = heap[sz]; in remove_from_heap()
107 heap[pos]->heap_offset = pos; in remove_from_heap()
111 if ( (pos > 1) && (heap[pos]->expires < heap[pos>>1]->expires) ) in remove_from_heap()
112 up_heap(heap, pos); in remove_from_heap()
114 down_heap(heap, pos); in remove_from_heap()
117 return (pos == 1); in remove_from_heap()