Home | History | Annotate | Line # | Download | only in raidframe
rf_diskqueue.c revision 1.52.6.1
      1  1.52.6.1    jruoho /*	$NetBSD: rf_diskqueue.c,v 1.52.6.1 2011/06/06 09:08:32 jruoho Exp $	*/
      2       1.1     oster /*
      3       1.1     oster  * Copyright (c) 1995 Carnegie-Mellon University.
      4       1.1     oster  * All rights reserved.
      5       1.1     oster  *
      6       1.1     oster  * Author: Mark Holland
      7       1.1     oster  *
      8       1.1     oster  * Permission to use, copy, modify and distribute this software and
      9       1.1     oster  * its documentation is hereby granted, provided that both the copyright
     10       1.1     oster  * notice and this permission notice appear in all copies of the
     11       1.1     oster  * software, derivative works or modified versions, and any portions
     12       1.1     oster  * thereof, and that both notices appear in supporting documentation.
     13       1.1     oster  *
     14       1.1     oster  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     15       1.1     oster  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     16       1.1     oster  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     17       1.1     oster  *
     18       1.1     oster  * Carnegie Mellon requests users of this software to return to
     19       1.1     oster  *
     20       1.1     oster  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     21       1.1     oster  *  School of Computer Science
     22       1.1     oster  *  Carnegie Mellon University
     23       1.1     oster  *  Pittsburgh PA 15213-3890
     24       1.1     oster  *
     25       1.1     oster  * any improvements or extensions that they make and grant Carnegie the
     26       1.1     oster  * rights to redistribute these changes.
     27       1.1     oster  */
     28       1.1     oster 
     29      1.13     oster /****************************************************************************
     30       1.1     oster  *
     31       1.1     oster  * rf_diskqueue.c -- higher-level disk queue code
     32       1.1     oster  *
     33       1.1     oster  * the routines here are a generic wrapper around the actual queueing
     34       1.6     oster  * routines.  The code here implements thread scheduling, synchronization,
     35       1.1     oster  * and locking ops (see below) on top of the lower-level queueing code.
     36       1.1     oster  *
     37      1.13     oster  * to support atomic RMW, we implement "locking operations".  When a
     38      1.13     oster  * locking op is dispatched to the lower levels of the driver, the
     39      1.13     oster  * queue is locked, and no further I/Os are dispatched until the queue
     40      1.13     oster  * receives & completes a corresponding "unlocking operation".  This
     41      1.13     oster  * code relies on the higher layers to guarantee that a locking op
     42      1.13     oster  * will always be eventually followed by an unlocking op.  The model
     43      1.13     oster  * is that the higher layers are structured so locking and unlocking
     44      1.13     oster  * ops occur in pairs, i.e.  an unlocking op cannot be generated until
     45      1.13     oster  * after a locking op reports completion.  There is no good way to
     46      1.13     oster  * check to see that an unlocking op "corresponds" to the op that
     47      1.13     oster  * currently has the queue locked, so we make no such attempt.  Since
     48      1.13     oster  * by definition there can be only one locking op outstanding on a
     49      1.13     oster  * disk, this should not be a problem.
     50      1.13     oster  *
     51      1.13     oster  * In the kernel, we allow multiple I/Os to be concurrently dispatched
     52      1.13     oster  * to the disk driver.  In order to support locking ops in this
     53      1.13     oster  * environment, when we decide to do a locking op, we stop dispatching
     54      1.13     oster  * new I/Os and wait until all dispatched I/Os have completed before
     55      1.13     oster  * dispatching the locking op.
     56      1.13     oster  *
     57      1.13     oster  * Unfortunately, the code is different in the 3 different operating
     58      1.13     oster  * states (user level, kernel, simulator).  In the kernel, I/O is
     59      1.13     oster  * non-blocking, and we have no disk threads to dispatch for us.
     60      1.13     oster  * Therefore, we have to dispatch new I/Os to the scsi driver at the
     61      1.13     oster  * time of enqueue, and also at the time of completion.  At user
     62      1.13     oster  * level, I/O is blocking, and so only the disk threads may dispatch
     63      1.13     oster  * I/Os.  Thus at user level, all we can do at enqueue time is enqueue
     64      1.13     oster  * and wake up the disk thread to do the dispatch.
     65       1.1     oster  *
     66      1.13     oster  ****************************************************************************/
     67      1.15     lukem 
     68      1.15     lukem #include <sys/cdefs.h>
     69  1.52.6.1    jruoho __KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.52.6.1 2011/06/06 09:08:32 jruoho Exp $");
     70       1.1     oster 
     71      1.14     oster #include <dev/raidframe/raidframevar.h>
     72      1.14     oster 
     73       1.1     oster #include "rf_threadstuff.h"
     74       1.1     oster #include "rf_raid.h"
     75       1.1     oster #include "rf_diskqueue.h"
     76       1.1     oster #include "rf_alloclist.h"
     77       1.1     oster #include "rf_acctrace.h"
     78       1.1     oster #include "rf_etimer.h"
     79       1.1     oster #include "rf_general.h"
     80       1.1     oster #include "rf_debugprint.h"
     81       1.1     oster #include "rf_shutdown.h"
     82       1.1     oster #include "rf_cvscan.h"
     83       1.1     oster #include "rf_sstf.h"
     84       1.1     oster #include "rf_fifo.h"
     85      1.11     oster #include "rf_kintf.h"
     86       1.1     oster 
     87       1.1     oster static void rf_ShutdownDiskQueueSystem(void *);
     88       1.1     oster 
     89      1.21     oster #ifndef RF_DEBUG_DISKQUEUE
     90      1.21     oster #define RF_DEBUG_DISKQUEUE 0
     91      1.21     oster #endif
     92      1.21     oster 
     93      1.21     oster #if RF_DEBUG_DISKQUEUE
     94       1.1     oster #define Dprintf1(s,a)         if (rf_queueDebug) rf_debug_printf(s,(void *)((unsigned long)a),NULL,NULL,NULL,NULL,NULL,NULL,NULL)
     95       1.1     oster #define Dprintf2(s,a,b)       if (rf_queueDebug) rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),NULL,NULL,NULL,NULL,NULL,NULL)
     96       1.1     oster #define Dprintf3(s,a,b,c)     if (rf_queueDebug) rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),(void *)((unsigned long)c),NULL,NULL,NULL,NULL,NULL)
     97      1.21     oster #else
     98      1.21     oster #define Dprintf1(s,a)
     99      1.21     oster #define Dprintf2(s,a,b)
    100      1.21     oster #define Dprintf3(s,a,b,c)
    101      1.21     oster #endif
    102       1.1     oster 
    103      1.13     oster /*****************************************************************************
    104       1.1     oster  *
    105      1.13     oster  * the disk queue switch defines all the functions used in the
    106      1.13     oster  * different queueing disciplines queue ID, init routine, enqueue
    107      1.13     oster  * routine, dequeue routine
    108       1.1     oster  *
    109      1.13     oster  ****************************************************************************/
    110       1.1     oster 
    111      1.22  jdolecek static const RF_DiskQueueSW_t diskqueuesw[] = {
    112       1.6     oster 	{"fifo",		/* FIFO */
    113       1.6     oster 		rf_FifoCreate,
    114       1.6     oster 		rf_FifoEnqueue,
    115       1.6     oster 		rf_FifoDequeue,
    116       1.6     oster 		rf_FifoPeek,
    117       1.1     oster 	rf_FifoPromote},
    118       1.1     oster 
    119       1.6     oster 	{"cvscan",		/* cvscan */
    120       1.6     oster 		rf_CvscanCreate,
    121       1.6     oster 		rf_CvscanEnqueue,
    122       1.6     oster 		rf_CvscanDequeue,
    123       1.6     oster 		rf_CvscanPeek,
    124       1.6     oster 	rf_CvscanPromote},
    125       1.6     oster 
    126       1.6     oster 	{"sstf",		/* shortest seek time first */
    127       1.6     oster 		rf_SstfCreate,
    128       1.6     oster 		rf_SstfEnqueue,
    129       1.6     oster 		rf_SstfDequeue,
    130       1.6     oster 		rf_SstfPeek,
    131       1.1     oster 	rf_SstfPromote},
    132       1.1     oster 
    133       1.6     oster 	{"scan",		/* SCAN (two-way elevator) */
    134       1.6     oster 		rf_ScanCreate,
    135       1.6     oster 		rf_SstfEnqueue,
    136       1.6     oster 		rf_ScanDequeue,
    137       1.6     oster 		rf_ScanPeek,
    138       1.1     oster 	rf_SstfPromote},
    139       1.1     oster 
    140       1.6     oster 	{"cscan",		/* CSCAN (one-way elevator) */
    141       1.6     oster 		rf_CscanCreate,
    142       1.6     oster 		rf_SstfEnqueue,
    143       1.6     oster 		rf_CscanDequeue,
    144       1.6     oster 		rf_CscanPeek,
    145       1.1     oster 	rf_SstfPromote},
    146       1.1     oster 
    147       1.1     oster };
    148       1.1     oster #define NUM_DISK_QUEUE_TYPES (sizeof(diskqueuesw)/sizeof(RF_DiskQueueSW_t))
    149       1.1     oster 
    150       1.1     oster #define RF_MAX_FREE_DQD 256
    151      1.31     oster #define RF_MIN_FREE_DQD  64
    152       1.1     oster 
    153       1.1     oster #include <sys/buf.h>
    154       1.1     oster 
    155       1.6     oster /* configures a single disk queue */
    156       1.9     oster 
    157  1.52.6.1    jruoho static void
    158  1.52.6.1    jruoho rf_ShutdownDiskQueue(void *arg)
    159  1.52.6.1    jruoho {
    160  1.52.6.1    jruoho 	RF_DiskQueue_t *diskqueue = arg;
    161  1.52.6.1    jruoho 
    162  1.52.6.1    jruoho 	rf_destroy_mutex2(diskqueue->mutex);
    163  1.52.6.1    jruoho }
    164  1.52.6.1    jruoho 
    165      1.40     perry int
    166      1.27     oster rf_ConfigureDiskQueue(RF_Raid_t *raidPtr, RF_DiskQueue_t *diskqueue,
    167      1.27     oster 		      RF_RowCol_t c, const RF_DiskQueueSW_t *p,
    168      1.27     oster 		      RF_SectorCount_t sectPerDisk, dev_t dev,
    169      1.27     oster 		      int maxOutstanding, RF_ShutdownList_t **listp,
    170      1.27     oster 		      RF_AllocListElem_t *clList)
    171       1.6     oster {
    172       1.6     oster 	diskqueue->col = c;
    173       1.6     oster 	diskqueue->qPtr = p;
    174       1.6     oster 	diskqueue->qHdr = (p->Create) (sectPerDisk, clList, listp);
    175       1.6     oster 	diskqueue->dev = dev;
    176       1.6     oster 	diskqueue->numOutstanding = 0;
    177       1.6     oster 	diskqueue->queueLength = 0;
    178       1.6     oster 	diskqueue->maxOutstanding = maxOutstanding;
    179       1.6     oster 	diskqueue->curPriority = RF_IO_NORMAL_PRIORITY;
    180       1.6     oster 	diskqueue->flags = 0;
    181       1.6     oster 	diskqueue->raidPtr = raidPtr;
    182      1.23     oster 	diskqueue->rf_cinfo = &raidPtr->raid_cinfo[c];
    183  1.52.6.1    jruoho 	rf_init_mutex2(diskqueue->mutex, IPL_VM);
    184  1.52.6.1    jruoho 	rf_ShutdownCreate(listp, rf_ShutdownDiskQueue, diskqueue);
    185       1.6     oster 	return (0);
    186       1.1     oster }
    187       1.1     oster 
    188      1.40     perry static void
    189      1.48  christos rf_ShutdownDiskQueueSystem(void *ignored)
    190       1.6     oster {
    191      1.32     oster 	pool_destroy(&rf_pools.dqd);
    192       1.1     oster }
    193       1.1     oster 
    194      1.30     oster int
    195      1.27     oster rf_ConfigureDiskQueueSystem(RF_ShutdownList_t **listp)
    196       1.6     oster {
    197       1.6     oster 
    198      1.32     oster 	rf_pool_init(&rf_pools.dqd, sizeof(RF_DiskQueueData_t),
    199      1.32     oster 		     "rf_dqd_pl", RF_MIN_FREE_DQD, RF_MAX_FREE_DQD);
    200      1.30     oster 	rf_ShutdownCreate(listp, rf_ShutdownDiskQueueSystem, NULL);
    201      1.24     oster 
    202       1.6     oster 	return (0);
    203       1.6     oster }
    204       1.6     oster 
    205      1.40     perry int
    206      1.27     oster rf_ConfigureDiskQueues(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
    207      1.27     oster 		       RF_Config_t *cfgPtr)
    208       1.6     oster {
    209      1.23     oster 	RF_DiskQueue_t *diskQueues, *spareQueues;
    210      1.22  jdolecek 	const RF_DiskQueueSW_t *p;
    211      1.23     oster 	RF_RowCol_t r,c;
    212       1.6     oster 	int     rc, i;
    213       1.6     oster 
    214       1.6     oster 	raidPtr->maxQueueDepth = cfgPtr->maxOutstandingDiskReqs;
    215       1.6     oster 
    216       1.6     oster 	for (p = NULL, i = 0; i < NUM_DISK_QUEUE_TYPES; i++) {
    217       1.6     oster 		if (!strcmp(diskqueuesw[i].queueType, cfgPtr->diskQueueType)) {
    218       1.6     oster 			p = &diskqueuesw[i];
    219       1.6     oster 			break;
    220       1.6     oster 		}
    221       1.6     oster 	}
    222       1.6     oster 	if (p == NULL) {
    223       1.6     oster 		RF_ERRORMSG2("Unknown queue type \"%s\".  Using %s\n", cfgPtr->diskQueueType, diskqueuesw[0].queueType);
    224       1.6     oster 		p = &diskqueuesw[0];
    225       1.6     oster 	}
    226      1.10     oster 	raidPtr->qType = p;
    227      1.23     oster 
    228      1.40     perry 	RF_MallocAndAdd(diskQueues,
    229      1.24     oster 			(raidPtr->numCol + RF_MAXSPARE) *
    230      1.40     perry 			sizeof(RF_DiskQueue_t), (RF_DiskQueue_t *),
    231      1.23     oster 			raidPtr->cleanupList);
    232      1.23     oster 	if (diskQueues == NULL)
    233       1.6     oster 		return (ENOMEM);
    234       1.6     oster 	raidPtr->Queues = diskQueues;
    235      1.23     oster 
    236      1.23     oster 	for (c = 0; c < raidPtr->numCol; c++) {
    237      1.23     oster 		rc = rf_ConfigureDiskQueue(raidPtr, &diskQueues[c],
    238      1.23     oster 					   c, p,
    239      1.40     perry 					   raidPtr->sectorsPerDisk,
    240      1.23     oster 					   raidPtr->Disks[c].dev,
    241      1.40     perry 					   cfgPtr->maxOutstandingDiskReqs,
    242      1.23     oster 					   listp, raidPtr->cleanupList);
    243      1.23     oster 		if (rc)
    244      1.23     oster 			return (rc);
    245       1.6     oster 	}
    246       1.6     oster 
    247      1.23     oster 	spareQueues = &raidPtr->Queues[raidPtr->numCol];
    248       1.6     oster 	for (r = 0; r < raidPtr->numSpare; r++) {
    249       1.9     oster 		rc = rf_ConfigureDiskQueue(raidPtr, &spareQueues[r],
    250      1.23     oster 					   raidPtr->numCol + r, p,
    251      1.23     oster 					   raidPtr->sectorsPerDisk,
    252      1.23     oster 					   raidPtr->Disks[raidPtr->numCol + r].dev,
    253      1.23     oster 					   cfgPtr->maxOutstandingDiskReqs, listp,
    254      1.23     oster 					   raidPtr->cleanupList);
    255       1.6     oster 		if (rc)
    256       1.6     oster 			return (rc);
    257       1.6     oster 	}
    258       1.6     oster 	return (0);
    259       1.6     oster }
    260       1.1     oster /* Enqueue a disk I/O
    261       1.1     oster  *
    262       1.1     oster  * In the kernel, I/O is non-blocking and so we'd like to have multiple
    263       1.1     oster  * I/Os outstanding on the physical disks when possible.
    264       1.1     oster  *
    265       1.1     oster  * when any request arrives at a queue, we have two choices:
    266       1.1     oster  *    dispatch it to the lower levels
    267       1.1     oster  *    queue it up
    268       1.1     oster  *
    269       1.1     oster  * kernel rules for when to do what:
    270       1.1     oster  *    unlocking req  :  always dispatch it
    271       1.1     oster  *    normal req     :  queue empty => dispatch it & set priority
    272       1.1     oster  *                      queue not full & priority is ok => dispatch it
    273       1.1     oster  *                      else queue it
    274       1.1     oster  */
    275      1.40     perry void
    276      1.27     oster rf_DiskIOEnqueue(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req, int pri)
    277       1.6     oster {
    278       1.6     oster 	RF_ETIMER_START(req->qtime);
    279       1.6     oster 	RF_ASSERT(req->type == RF_IO_TYPE_NOP || req->numSector);
    280       1.6     oster 	req->priority = pri;
    281       1.6     oster 
    282      1.21     oster #if RF_DEBUG_DISKQUEUE
    283       1.6     oster 	if (rf_queueDebug && (req->numSector == 0)) {
    284       1.6     oster 		printf("Warning: Enqueueing zero-sector access\n");
    285       1.6     oster 	}
    286      1.21     oster #endif
    287       1.6     oster 	RF_LOCK_QUEUE_MUTEX(queue, "DiskIOEnqueue");
    288      1.52     oster 	if (RF_OK_TO_DISPATCH(queue, req)) {
    289      1.52     oster 		Dprintf2("Dispatching pri %d regular op to c %d (ok to dispatch)\n", pri, queue->col);
    290      1.52     oster 		rf_DispatchKernelIO(queue, req);
    291      1.52     oster 	} else {
    292      1.52     oster 		queue->queueLength++;	/* increment count of number of requests waiting in this queue */
    293      1.52     oster 		Dprintf2("Enqueueing pri %d regular op to c %d (not ok to dispatch)\n", pri, queue->col);
    294      1.52     oster 		req->queue = (void *) queue;
    295      1.52     oster 		(queue->qPtr->Enqueue) (queue->qHdr, req, pri);
    296       1.6     oster 	}
    297       1.6     oster 	RF_UNLOCK_QUEUE_MUTEX(queue, "DiskIOEnqueue");
    298       1.1     oster }
    299       1.6     oster 
    300       1.1     oster 
    301      1.52     oster /* get the next set of I/Os started */
    302      1.40     perry void
    303      1.27     oster rf_DiskIOComplete(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req, int status)
    304       1.6     oster {
    305       1.6     oster 	int     done = 0;
    306       1.6     oster 
    307       1.6     oster 	RF_LOCK_QUEUE_MUTEX(queue, "DiskIOComplete");
    308       1.6     oster 	queue->numOutstanding--;
    309       1.6     oster 	RF_ASSERT(queue->numOutstanding >= 0);
    310       1.6     oster 
    311       1.6     oster 	/* dispatch requests to the disk until we find one that we can't. */
    312       1.6     oster 	/* no reason to continue once we've filled up the queue */
    313       1.6     oster 	/* no reason to even start if the queue is locked */
    314       1.6     oster 
    315      1.52     oster 	while (!done && !RF_QUEUE_FULL(queue)) {
    316      1.52     oster 		req = (queue->qPtr->Dequeue) (queue->qHdr);
    317       1.6     oster 		if (req) {
    318      1.52     oster 			Dprintf2("DiskIOComplete: extracting pri %d req from queue at c %d\n", req->priority, queue->col);
    319      1.52     oster 			queue->queueLength--;	/* decrement count of number of requests waiting in this queue */
    320       1.6     oster 			RF_ASSERT(queue->queueLength >= 0);
    321      1.52     oster 			if (RF_OK_TO_DISPATCH(queue, req)) {
    322      1.52     oster 				Dprintf2("DiskIOComplete: dispatching pri %d regular req to c %d (ok to dispatch)\n", req->priority, queue->col);
    323      1.52     oster 				rf_DispatchKernelIO(queue, req);
    324      1.52     oster 			} else {
    325      1.52     oster 				/* we can't dispatch it, so just re-enqueue it.
    326      1.52     oster 				   potential trouble here if disk queues batch reqs */
    327      1.52     oster 				Dprintf2("DiskIOComplete: re-enqueueing pri %d regular req to c %d\n", req->priority, queue->col);
    328      1.52     oster 				queue->queueLength++;
    329      1.52     oster 				(queue->qPtr->Enqueue) (queue->qHdr, req, req->priority);
    330      1.52     oster 				done = 1;
    331      1.52     oster 			}
    332      1.52     oster 		} else {
    333      1.52     oster 			Dprintf1("DiskIOComplete: no more requests to extract.\n", "");
    334      1.52     oster 			done = 1;
    335       1.6     oster 		}
    336       1.6     oster 	}
    337       1.6     oster 
    338       1.6     oster 	RF_UNLOCK_QUEUE_MUTEX(queue, "DiskIOComplete");
    339       1.1     oster }
    340       1.1     oster /* promotes accesses tagged with the given parityStripeID from low priority
    341       1.1     oster  * to normal priority.  This promotion is optional, meaning that a queue
    342       1.1     oster  * need not implement it.  If there is no promotion routine associated with
    343       1.1     oster  * a queue, this routine does nothing and returns -1.
    344       1.1     oster  */
    345      1.40     perry int
    346      1.27     oster rf_DiskIOPromote(RF_DiskQueue_t *queue, RF_StripeNum_t parityStripeID,
    347      1.27     oster 		 RF_ReconUnitNum_t which_ru)
    348       1.6     oster {
    349       1.6     oster 	int     retval;
    350       1.6     oster 
    351       1.6     oster 	if (!queue->qPtr->Promote)
    352       1.6     oster 		return (-1);
    353       1.6     oster 	RF_LOCK_QUEUE_MUTEX(queue, "DiskIOPromote");
    354       1.6     oster 	retval = (queue->qPtr->Promote) (queue->qHdr, parityStripeID, which_ru);
    355       1.6     oster 	RF_UNLOCK_QUEUE_MUTEX(queue, "DiskIOPromote");
    356       1.6     oster 	return (retval);
    357       1.6     oster }
    358       1.6     oster 
    359       1.6     oster RF_DiskQueueData_t *
    360      1.27     oster rf_CreateDiskQueueData(RF_IoType_t typ, RF_SectorNum_t ssect,
    361      1.49  christos 		       RF_SectorCount_t nsect, void *bf,
    362      1.27     oster 		       RF_StripeNum_t parityStripeID,
    363      1.27     oster 		       RF_ReconUnitNum_t which_ru,
    364      1.27     oster 		       int (*wakeF) (void *, int), void *arg,
    365      1.37     oster 		       RF_AccTraceEntry_t *tracerec, RF_Raid_t *raidPtr,
    366      1.38     oster 		       RF_DiskQueueDataFlags_t flags, void *kb_proc,
    367      1.38     oster 		       int waitflag)
    368       1.6     oster {
    369       1.6     oster 	RF_DiskQueueData_t *p;
    370       1.6     oster 
    371      1.38     oster 	p = pool_get(&rf_pools.dqd, waitflag);
    372      1.38     oster 	if (p == NULL)
    373      1.38     oster 		return (NULL);
    374      1.38     oster 
    375      1.34     oster 	memset(p, 0, sizeof(RF_DiskQueueData_t));
    376      1.43      yamt 	if (waitflag == PR_WAITOK) {
    377      1.50        ad 		p->bp = getiobuf(NULL, true);
    378      1.43      yamt 	} else {
    379      1.50        ad 		p->bp = getiobuf(NULL, false);
    380      1.43      yamt 	}
    381      1.28     oster 	if (p->bp == NULL) {
    382      1.32     oster 		pool_put(&rf_pools.dqd, p);
    383      1.38     oster 		return (NULL);
    384      1.24     oster 	}
    385      1.51   reinoud 	SET(p->bp->b_cflags, BC_BUSY);	/* mark buffer busy */
    386       1.6     oster 
    387       1.6     oster 	p->sectorOffset = ssect + rf_protectedSectors;
    388       1.6     oster 	p->numSector = nsect;
    389       1.6     oster 	p->type = typ;
    390      1.41  christos 	p->buf = bf;
    391       1.6     oster 	p->parityStripeID = parityStripeID;
    392       1.6     oster 	p->which_ru = which_ru;
    393       1.6     oster 	p->CompleteFunc = wakeF;
    394       1.6     oster 	p->argument = arg;
    395      1.39     oster 	p->next = NULL;
    396       1.6     oster 	p->tracerec = tracerec;
    397       1.6     oster 	p->priority = RF_IO_NORMAL_PRIORITY;
    398       1.6     oster 	p->raidPtr = raidPtr;
    399       1.6     oster 	p->flags = flags;
    400       1.6     oster 	p->b_proc = kb_proc;
    401       1.6     oster 	return (p);
    402       1.6     oster }
    403       1.6     oster 
    404      1.40     perry void
    405      1.27     oster rf_FreeDiskQueueData(RF_DiskQueueData_t *p)
    406       1.1     oster {
    407      1.46       tls 	int s;
    408      1.46       tls 	s = splbio();		/* XXX protect only pool_put, or neither? */
    409      1.43      yamt 	putiobuf(p->bp);
    410      1.32     oster 	pool_put(&rf_pools.dqd, p);
    411      1.46       tls 	splx(s);
    412       1.1     oster }
    413