cam_queue.c (50477) | cam_queue.c (108470) |
---|---|
1/* 2 * CAM request queue management functions. 3 * 4 * Copyright (c) 1997 Justin T. Gibbs. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/* 2 * CAM request queue management functions. 3 * 4 * Copyright (c) 1997 Justin T. Gibbs. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/cam/cam_queue.c 50477 1999-08-28 01:08:13Z peter $ | 28 * $FreeBSD: head/sys/cam/cam_queue.c 108470 2002-12-30 21:18:15Z schweikh $ |
29 */ 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/types.h> 33#include <sys/malloc.h> 34 35#include <cam/cam.h> 36#include <cam/cam_ccb.h> --- 145 unchanged lines hidden (view full) --- 182 removed_entry->index = CAM_UNQUEUED_INDEX; 183 queue->entries--; 184 return (removed_entry); 185} 186 187/* 188 * camq_change_priority: Given an array of cam_pinfo* elements with the 189 * Heap(1, num_entries) property, an index such that 1 <= index <= num_elements, | 29 */ 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/types.h> 33#include <sys/malloc.h> 34 35#include <cam/cam.h> 36#include <cam/cam_ccb.h> --- 145 unchanged lines hidden (view full) --- 182 removed_entry->index = CAM_UNQUEUED_INDEX; 183 queue->entries--; 184 return (removed_entry); 185} 186 187/* 188 * camq_change_priority: Given an array of cam_pinfo* elements with the 189 * Heap(1, num_entries) property, an index such that 1 <= index <= num_elements, |
190 * and an new priority for the element at index, change the priority of | 190 * and a new priority for the element at index, change the priority of |
191 * element index and restore the Heap(0, num_elements) property. 192 */ 193void 194camq_change_priority(struct camq *queue, int index, u_int32_t new_priority) 195{ 196 if (new_priority > queue->queue_array[index]->priority) { 197 queue->queue_array[index]->priority = new_priority; 198 heap_down(queue->queue_array, index, queue->entries); --- 220 unchanged lines hidden --- | 191 * element index and restore the Heap(0, num_elements) property. 192 */ 193void 194camq_change_priority(struct camq *queue, int index, u_int32_t new_priority) 195{ 196 if (new_priority > queue->queue_array[index]->priority) { 197 queue->queue_array[index]->priority = new_priority; 198 heap_down(queue->queue_array, index, queue->entries); --- 220 unchanged lines hidden --- |