Home | History | Annotate | Line # | Download | only in raidframe
rf_psstatus.c revision 1.1
      1  1.1  oster /*	$NetBSD: rf_psstatus.c,v 1.1 1998/11/13 04:20:32 oster 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.1  oster /*****************************************************************************
     30  1.1  oster  *
     31  1.1  oster  * psstatus.c
     32  1.1  oster  *
     33  1.1  oster  * The reconstruction code maintains a bunch of status related to the parity
     34  1.1  oster  * stripes that are currently under reconstruction.  This header file defines
     35  1.1  oster  * the status structures.
     36  1.1  oster  *
     37  1.1  oster  *****************************************************************************/
     38  1.1  oster 
     39  1.1  oster /* :
     40  1.1  oster  * Log: rf_psstatus.c,v
     41  1.1  oster  * Revision 1.29  1996/07/27 23:36:08  jimz
     42  1.1  oster  * Solaris port of simulator
     43  1.1  oster  *
     44  1.1  oster  * Revision 1.28  1996/07/15  17:22:18  jimz
     45  1.1  oster  * nit-pick code cleanup
     46  1.1  oster  * resolve stdlib problems on DEC OSF
     47  1.1  oster  *
     48  1.1  oster  * Revision 1.27  1996/07/13  00:00:59  jimz
     49  1.1  oster  * sanitized generalized reconstruction architecture
     50  1.1  oster  * cleaned up head sep, rbuf problems
     51  1.1  oster  *
     52  1.1  oster  * Revision 1.26  1996/06/10  11:55:47  jimz
     53  1.1  oster  * Straightened out some per-array/not-per-array distinctions, fixed
     54  1.1  oster  * a couple bugs related to confusion. Added shutdown lists. Removed
     55  1.1  oster  * layout shutdown function (now subsumed by shutdown lists).
     56  1.1  oster  *
     57  1.1  oster  * Revision 1.25  1996/06/07  22:26:27  jimz
     58  1.1  oster  * type-ify which_ru (RF_ReconUnitNum_t)
     59  1.1  oster  *
     60  1.1  oster  * Revision 1.24  1996/06/07  21:33:04  jimz
     61  1.1  oster  * begin using consistent types for sector numbers,
     62  1.1  oster  * stripe numbers, row+col numbers, recon unit numbers
     63  1.1  oster  *
     64  1.1  oster  * Revision 1.23  1996/06/05  18:06:02  jimz
     65  1.1  oster  * Major code cleanup. The Great Renaming is now done.
     66  1.1  oster  * Better modularity. Better typing. Fixed a bunch of
     67  1.1  oster  * synchronization bugs. Made a lot of global stuff
     68  1.1  oster  * per-desc or per-array. Removed dead code.
     69  1.1  oster  *
     70  1.1  oster  * Revision 1.22  1996/06/02  17:31:48  jimz
     71  1.1  oster  * Moved a lot of global stuff into array structure, where it belongs.
     72  1.1  oster  * Fixed up paritylogging, pss modules in this manner. Some general
     73  1.1  oster  * code cleanup. Removed lots of dead code, some dead files.
     74  1.1  oster  *
     75  1.1  oster  * Revision 1.21  1996/05/30  23:22:16  jimz
     76  1.1  oster  * bugfixes of serialization, timing problems
     77  1.1  oster  * more cleanup
     78  1.1  oster  *
     79  1.1  oster  * Revision 1.20  1996/05/27  18:56:37  jimz
     80  1.1  oster  * more code cleanup
     81  1.1  oster  * better typing
     82  1.1  oster  * compiles in all 3 environments
     83  1.1  oster  *
     84  1.1  oster  * Revision 1.19  1996/05/24  22:17:04  jimz
     85  1.1  oster  * continue code + namespace cleanup
     86  1.1  oster  * typed a bunch of flags
     87  1.1  oster  *
     88  1.1  oster  * Revision 1.18  1996/05/23  21:46:35  jimz
     89  1.1  oster  * checkpoint in code cleanup (release prep)
     90  1.1  oster  * lots of types, function names have been fixed
     91  1.1  oster  *
     92  1.1  oster  * Revision 1.17  1996/05/23  00:33:23  jimz
     93  1.1  oster  * code cleanup: move all debug decls to rf_options.c, all extern
     94  1.1  oster  * debug decls to rf_options.h, all debug vars preceded by rf_
     95  1.1  oster  *
     96  1.1  oster  * Revision 1.16  1996/05/20  16:15:27  jimz
     97  1.1  oster  * switch to rf_{mutex,cond}_{init,destroy}
     98  1.1  oster  *
     99  1.1  oster  * Revision 1.15  1996/05/18  19:51:34  jimz
    100  1.1  oster  * major code cleanup- fix syntax, make some types consistent,
    101  1.1  oster  * add prototypes, clean out dead code, et cetera
    102  1.1  oster  *
    103  1.1  oster  * Revision 1.14  1995/12/12  18:10:06  jimz
    104  1.1  oster  * MIN -> RF_MIN, MAX -> RF_MAX, ASSERT -> RF_ASSERT
    105  1.1  oster  * fix 80-column brain damage in comments
    106  1.1  oster  *
    107  1.1  oster  * Revision 1.13  1995/11/30  16:17:18  wvcii
    108  1.1  oster  * added copyright info
    109  1.1  oster  *
    110  1.1  oster  */
    111  1.1  oster 
    112  1.1  oster #include "rf_types.h"
    113  1.1  oster #include "rf_raid.h"
    114  1.1  oster #include "rf_threadid.h"
    115  1.1  oster #include "rf_general.h"
    116  1.1  oster #include "rf_debugprint.h"
    117  1.1  oster #include "rf_freelist.h"
    118  1.1  oster #include "rf_psstatus.h"
    119  1.1  oster #include "rf_shutdown.h"
    120  1.1  oster #include "rf_sys.h"
    121  1.1  oster 
    122  1.1  oster #define Dprintf1(s,a)         if (rf_pssDebug) rf_debug_printf(s,(void *)((unsigned long)a),NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    123  1.1  oster #define Dprintf2(s,a,b)       if (rf_pssDebug) rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),NULL,NULL,NULL,NULL,NULL,NULL)
    124  1.1  oster #define Dprintf3(s,a,b,c)     if (rf_pssDebug) rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),(void *)((unsigned long)c),NULL,NULL,NULL,NULL,NULL)
    125  1.1  oster 
    126  1.1  oster static void RealPrintPSStatusTable(RF_Raid_t *raidPtr,
    127  1.1  oster 	RF_PSStatusHeader_t *pssTable);
    128  1.1  oster 
    129  1.1  oster #define RF_MAX_FREE_PSS  32
    130  1.1  oster #define RF_PSS_INC        8
    131  1.1  oster #define RF_PSS_INITIAL    4
    132  1.1  oster 
    133  1.1  oster static int init_pss( RF_ReconParityStripeStatus_t  *, RF_Raid_t *);
    134  1.1  oster static void clean_pss(RF_ReconParityStripeStatus_t *, RF_Raid_t *);
    135  1.1  oster static void rf_ShutdownPSStatus(void *);
    136  1.1  oster 
    137  1.1  oster static int init_pss(p, raidPtr)
    138  1.1  oster   RF_ReconParityStripeStatus_t  *p;
    139  1.1  oster   RF_Raid_t                     *raidPtr;
    140  1.1  oster {
    141  1.1  oster   RF_Calloc(p->issued, raidPtr->numCol, sizeof(char), (char *));
    142  1.1  oster   if (p->issued == NULL)
    143  1.1  oster     return(ENOMEM);
    144  1.1  oster   return(0);
    145  1.1  oster }
    146  1.1  oster 
    147  1.1  oster static void clean_pss(p, raidPtr)
    148  1.1  oster   RF_ReconParityStripeStatus_t  *p;
    149  1.1  oster   RF_Raid_t                     *raidPtr;
    150  1.1  oster {
    151  1.1  oster   RF_Free(p->issued, raidPtr->numCol*sizeof(char));
    152  1.1  oster }
    153  1.1  oster 
    154  1.1  oster static void rf_ShutdownPSStatus(arg)
    155  1.1  oster   void  *arg;
    156  1.1  oster {
    157  1.1  oster 	RF_Raid_t *raidPtr = (RF_Raid_t *)arg;
    158  1.1  oster 
    159  1.1  oster 	RF_FREELIST_DESTROY_CLEAN_ARG(raidPtr->pss_freelist,next,(RF_ReconParityStripeStatus_t *),clean_pss,raidPtr);
    160  1.1  oster }
    161  1.1  oster 
    162  1.1  oster int rf_ConfigurePSStatus(
    163  1.1  oster   RF_ShutdownList_t  **listp,
    164  1.1  oster   RF_Raid_t           *raidPtr,
    165  1.1  oster   RF_Config_t         *cfgPtr)
    166  1.1  oster {
    167  1.1  oster   int rc;
    168  1.1  oster 
    169  1.1  oster   raidPtr->pssTableSize = RF_PSS_DEFAULT_TABLESIZE;
    170  1.1  oster   RF_FREELIST_CREATE(raidPtr->pss_freelist, RF_MAX_FREE_PSS,
    171  1.1  oster     RF_PSS_INC, sizeof(RF_ReconParityStripeStatus_t));
    172  1.1  oster   if (raidPtr->pss_freelist == NULL)
    173  1.1  oster     return(ENOMEM);
    174  1.1  oster   rc = rf_ShutdownCreate(listp, rf_ShutdownPSStatus, raidPtr);
    175  1.1  oster   if (rc) {
    176  1.1  oster     RF_ERRORMSG3("Unable to add to shutdown list file %s line %d rc=%d\n",
    177  1.1  oster       __FILE__, __LINE__, rc);
    178  1.1  oster     rf_ShutdownPSStatus(raidPtr);
    179  1.1  oster     return(rc);
    180  1.1  oster   }
    181  1.1  oster   RF_FREELIST_PRIME_INIT_ARG(raidPtr->pss_freelist, RF_PSS_INITIAL,next,
    182  1.1  oster     (RF_ReconParityStripeStatus_t *),init_pss,raidPtr);
    183  1.1  oster   return(0);
    184  1.1  oster }
    185  1.1  oster 
    186  1.1  oster /*****************************************************************************************
    187  1.1  oster  * sets up the pss table
    188  1.1  oster  * We pre-allocate a bunch of entries to avoid as much as possible having to
    189  1.1  oster  * malloc up hash chain entries.
    190  1.1  oster  ****************************************************************************************/
    191  1.1  oster RF_PSStatusHeader_t *rf_MakeParityStripeStatusTable(raidPtr)
    192  1.1  oster   RF_Raid_t  *raidPtr;
    193  1.1  oster {
    194  1.1  oster   RF_PSStatusHeader_t *pssTable;
    195  1.1  oster   int i, j, rc;
    196  1.1  oster 
    197  1.1  oster   RF_Calloc(pssTable, raidPtr->pssTableSize, sizeof(RF_PSStatusHeader_t), (RF_PSStatusHeader_t *));
    198  1.1  oster   for (i=0; i<raidPtr->pssTableSize; i++) {
    199  1.1  oster     rc = rf_mutex_init(&pssTable[i].mutex);
    200  1.1  oster     if (rc) {
    201  1.1  oster       RF_ERRORMSG3("Unable to init mutex file %s line %d rc=%d\n", __FILE__,
    202  1.1  oster         __LINE__, rc);
    203  1.1  oster       /* fail and deallocate */
    204  1.1  oster       for(j=0;j<i;j++) {
    205  1.1  oster         rf_mutex_destroy(&pssTable[i].mutex);
    206  1.1  oster       }
    207  1.1  oster       RF_Free(pssTable, raidPtr->pssTableSize*sizeof(RF_PSStatusHeader_t));
    208  1.1  oster       return(NULL);
    209  1.1  oster     }
    210  1.1  oster   }
    211  1.1  oster   return(pssTable);
    212  1.1  oster }
    213  1.1  oster 
    214  1.1  oster void rf_FreeParityStripeStatusTable(raidPtr, pssTable)
    215  1.1  oster   RF_Raid_t            *raidPtr;
    216  1.1  oster   RF_PSStatusHeader_t  *pssTable;
    217  1.1  oster {
    218  1.1  oster   int i;
    219  1.1  oster 
    220  1.1  oster   if (rf_pssDebug)
    221  1.1  oster     RealPrintPSStatusTable(raidPtr, pssTable);
    222  1.1  oster   for (i=0; i<raidPtr->pssTableSize; i++) {
    223  1.1  oster     if (pssTable[i].chain) {
    224  1.1  oster       printf("ERROR: pss hash chain not null at recon shutdown\n");
    225  1.1  oster     }
    226  1.1  oster     rf_mutex_destroy(&pssTable[i].mutex);
    227  1.1  oster   }
    228  1.1  oster   RF_Free(pssTable, raidPtr->pssTableSize * sizeof(RF_PSStatusHeader_t));
    229  1.1  oster }
    230  1.1  oster 
    231  1.1  oster 
    232  1.1  oster /* looks up the status structure for a parity stripe.
    233  1.1  oster  * if the create_flag is on, creates and returns the status structure it it doesn't exist
    234  1.1  oster  * otherwise returns NULL if the status structure does not exist
    235  1.1  oster  *
    236  1.1  oster  * ASSUMES THE PSS DESCRIPTOR IS LOCKED UPON ENTRY
    237  1.1  oster  */
    238  1.1  oster RF_ReconParityStripeStatus_t *rf_LookupRUStatus(
    239  1.1  oster   RF_Raid_t            *raidPtr,
    240  1.1  oster   RF_PSStatusHeader_t  *pssTable,
    241  1.1  oster   RF_StripeNum_t        psID,
    242  1.1  oster   RF_ReconUnitNum_t     which_ru,
    243  1.1  oster   RF_PSSFlags_t         flags, /* whether or not to create it if it doesn't exist + what flags to set initially */
    244  1.1  oster   int                  *created)
    245  1.1  oster {
    246  1.1  oster   RF_PSStatusHeader_t *hdr = &pssTable[ RF_HASH_PSID(raidPtr,psID) ];
    247  1.1  oster   RF_ReconParityStripeStatus_t *p, *pssPtr = hdr->chain;
    248  1.1  oster 
    249  1.1  oster   *created = 0;
    250  1.1  oster   for (p = pssPtr; p; p=p->next) {
    251  1.1  oster     if (p->parityStripeID == psID && p->which_ru == which_ru)
    252  1.1  oster       break;
    253  1.1  oster   }
    254  1.1  oster 
    255  1.1  oster   if (!p && (flags&RF_PSS_CREATE)) {
    256  1.1  oster     Dprintf2("PSS: creating pss for psid %ld ru %d\n",psID,which_ru);
    257  1.1  oster     p = rf_AllocPSStatus(raidPtr);
    258  1.1  oster     p->next = hdr->chain;  hdr->chain = p;
    259  1.1  oster 
    260  1.1  oster     p->parityStripeID = psID;
    261  1.1  oster     p->which_ru = which_ru;
    262  1.1  oster     p->flags = flags;
    263  1.1  oster     p->rbuf = NULL;
    264  1.1  oster     p->writeRbuf = NULL;
    265  1.1  oster     p->blockCount = 0;
    266  1.1  oster     p->procWaitList = NULL;
    267  1.1  oster     p->blockWaitList = NULL;
    268  1.1  oster     p->bufWaitList = NULL;
    269  1.1  oster     *created = 1;
    270  1.1  oster   } else if (p) {                                       /* we didn't create, but we want to specify some new status */
    271  1.1  oster     p->flags |= flags;                                  /* add in whatever flags we're specifying */
    272  1.1  oster   }
    273  1.1  oster   if (p && (flags & RF_PSS_RECON_BLOCKED)) {
    274  1.1  oster     int tid;
    275  1.1  oster     rf_get_threadid(tid);
    276  1.1  oster     p->blockCount++;     /* if we're asking to block recon, bump the count */
    277  1.1  oster     Dprintf3("[%d] Blocked recon on psid %ld.  count now %d\n",tid,psID,p->blockCount);
    278  1.1  oster   }
    279  1.1  oster   return(p);
    280  1.1  oster }
    281  1.1  oster 
    282  1.1  oster /* deletes an entry from the parity stripe status table.  typically used
    283  1.1  oster  * when an entry has been allocated solely to block reconstruction, and
    284  1.1  oster  * no recon was requested while recon was blocked.  Assumes the hash
    285  1.1  oster  * chain is ALREADY LOCKED.
    286  1.1  oster  */
    287  1.1  oster void rf_PSStatusDelete(raidPtr, pssTable, pssPtr)
    288  1.1  oster   RF_Raid_t                     *raidPtr;
    289  1.1  oster   RF_PSStatusHeader_t           *pssTable;
    290  1.1  oster   RF_ReconParityStripeStatus_t  *pssPtr;
    291  1.1  oster {
    292  1.1  oster   RF_PSStatusHeader_t *hdr = &(pssTable[ RF_HASH_PSID(raidPtr,pssPtr->parityStripeID) ] );
    293  1.1  oster   RF_ReconParityStripeStatus_t *p = hdr->chain, *pt = NULL;
    294  1.1  oster 
    295  1.1  oster   while (p) {
    296  1.1  oster     if (p == pssPtr) {
    297  1.1  oster       if (pt) pt->next = p->next; else hdr->chain = p->next;
    298  1.1  oster       p->next = NULL;
    299  1.1  oster       rf_FreePSStatus(raidPtr, p);
    300  1.1  oster       return;
    301  1.1  oster     }
    302  1.1  oster     pt = p; p=p->next;
    303  1.1  oster   }
    304  1.1  oster   RF_ASSERT(0);              /* we must find it here */
    305  1.1  oster }
    306  1.1  oster 
    307  1.1  oster /* deletes an entry from the ps status table after reconstruction has completed */
    308  1.1  oster void rf_RemoveFromActiveReconTable(raidPtr, row, psid, which_ru)
    309  1.1  oster   RF_Raid_t          *raidPtr;
    310  1.1  oster   RF_RowCol_t         row;
    311  1.1  oster   RF_ReconUnitNum_t   which_ru;
    312  1.1  oster   RF_StripeNum_t      psid;
    313  1.1  oster {
    314  1.1  oster   RF_PSStatusHeader_t *hdr = &(raidPtr->reconControl[row]->pssTable[ RF_HASH_PSID(raidPtr,psid) ]);
    315  1.1  oster   RF_ReconParityStripeStatus_t *p, *pt;
    316  1.1  oster   RF_CallbackDesc_t *cb, *cb1;
    317  1.1  oster 
    318  1.1  oster   RF_LOCK_MUTEX( hdr->mutex );
    319  1.1  oster   for (pt=NULL, p = hdr->chain; p; pt=p,p=p->next) {
    320  1.1  oster     if ((p->parityStripeID == psid) && (p->which_ru == which_ru))
    321  1.1  oster       break;
    322  1.1  oster   }
    323  1.1  oster   if (p == NULL) {
    324  1.1  oster     rf_PrintPSStatusTable(raidPtr, row);
    325  1.1  oster   }
    326  1.1  oster   RF_ASSERT(p); /* it must be there */
    327  1.1  oster 
    328  1.1  oster   Dprintf2("PSS: deleting pss for psid %ld ru %d\n",psid,which_ru);
    329  1.1  oster 
    330  1.1  oster   /* delete this entry from the hash chain */
    331  1.1  oster   if (pt) pt->next = p->next;
    332  1.1  oster   else hdr->chain = p->next;
    333  1.1  oster   p->next = NULL;
    334  1.1  oster 
    335  1.1  oster   RF_UNLOCK_MUTEX( hdr->mutex );
    336  1.1  oster 
    337  1.1  oster   /* wakup anyone waiting on the parity stripe ID */
    338  1.1  oster   cb = p->procWaitList;
    339  1.1  oster   p->procWaitList = NULL;
    340  1.1  oster   while (cb) {
    341  1.1  oster     Dprintf1("Waking up access waiting on parity stripe ID %ld\n",p->parityStripeID);
    342  1.1  oster     cb1 = cb->next;
    343  1.1  oster     (cb->callbackFunc)(cb->callbackArg);
    344  1.1  oster 
    345  1.1  oster     /* THIS IS WHAT THE ORIGINAL CODE HAD... the extra 0 is bogus, IMHO */
    346  1.1  oster     /*     (cb->callbackFunc)(cb->callbackArg, 0); */
    347  1.1  oster     rf_FreeCallbackDesc(cb);
    348  1.1  oster     cb = cb1;
    349  1.1  oster   }
    350  1.1  oster 
    351  1.1  oster   rf_FreePSStatus(raidPtr, p);
    352  1.1  oster }
    353  1.1  oster 
    354  1.1  oster RF_ReconParityStripeStatus_t *rf_AllocPSStatus(raidPtr)
    355  1.1  oster   RF_Raid_t  *raidPtr;
    356  1.1  oster {
    357  1.1  oster   RF_ReconParityStripeStatus_t *p;
    358  1.1  oster 
    359  1.1  oster   RF_FREELIST_GET_INIT_ARG(raidPtr->pss_freelist,p,next,(RF_ReconParityStripeStatus_t *),init_pss,raidPtr);
    360  1.1  oster   if (p) {
    361  1.1  oster     bzero(p->issued, raidPtr->numCol);
    362  1.1  oster   }
    363  1.1  oster   p->next = NULL;
    364  1.1  oster   /* no need to initialize here b/c the only place we're called from is the above Lookup */
    365  1.1  oster   return(p);
    366  1.1  oster }
    367  1.1  oster 
    368  1.1  oster void rf_FreePSStatus(raidPtr, p)
    369  1.1  oster   RF_Raid_t                     *raidPtr;
    370  1.1  oster   RF_ReconParityStripeStatus_t  *p;
    371  1.1  oster {
    372  1.1  oster   RF_ASSERT(p->procWaitList == NULL);
    373  1.1  oster   RF_ASSERT(p->blockWaitList == NULL);
    374  1.1  oster   RF_ASSERT(p->bufWaitList == NULL);
    375  1.1  oster 
    376  1.1  oster   RF_FREELIST_FREE_CLEAN_ARG(raidPtr->pss_freelist,p,next,clean_pss,raidPtr);
    377  1.1  oster }
    378  1.1  oster 
    379  1.1  oster static void RealPrintPSStatusTable(raidPtr, pssTable)
    380  1.1  oster   RF_Raid_t            *raidPtr;
    381  1.1  oster   RF_PSStatusHeader_t  *pssTable;
    382  1.1  oster {
    383  1.1  oster   int i, j, procsWaiting, blocksWaiting, bufsWaiting;
    384  1.1  oster   RF_ReconParityStripeStatus_t *p;
    385  1.1  oster   RF_CallbackDesc_t *cb;
    386  1.1  oster 
    387  1.1  oster   printf("\nParity Stripe Status Table\n");
    388  1.1  oster   for (i=0; i< raidPtr->pssTableSize; i++) {
    389  1.1  oster     for (p = pssTable[i].chain; p; p=p->next) {
    390  1.1  oster       procsWaiting = blocksWaiting = bufsWaiting = 0;
    391  1.1  oster       for (cb = p->procWaitList; cb; cb=cb->next) procsWaiting++;
    392  1.1  oster       for (cb = p->blockWaitList; cb; cb=cb->next) blocksWaiting++;
    393  1.1  oster       for (cb = p->bufWaitList; cb; cb=cb->next) bufsWaiting++;
    394  1.1  oster       printf("PSID %ld RU %d : blockCount %d %d/%d/%d proc/block/buf waiting, issued ",
    395  1.1  oster 	     (long)p->parityStripeID, p->which_ru, p->blockCount, procsWaiting, blocksWaiting, bufsWaiting);
    396  1.1  oster       for (j=0;j<raidPtr->numCol; j++) printf("%c", (p->issued[j]) ? '1' : '0');
    397  1.1  oster       if (!p->flags) printf(" flags: (none)");
    398  1.1  oster       else {
    399  1.1  oster 	if (p->flags & RF_PSS_UNDER_RECON) printf(" under-recon");
    400  1.1  oster 	if (p->flags & RF_PSS_FORCED_ON_WRITE) printf(" forced-w");
    401  1.1  oster 	if (p->flags & RF_PSS_FORCED_ON_READ) printf(" forced-r");
    402  1.1  oster 	if (p->flags & RF_PSS_RECON_BLOCKED) printf(" blocked");
    403  1.1  oster 	if (p->flags & RF_PSS_BUFFERWAIT) printf(" bufwait");
    404  1.1  oster       }
    405  1.1  oster       printf("\n");
    406  1.1  oster     }
    407  1.1  oster   }
    408  1.1  oster }
    409  1.1  oster 
    410  1.1  oster void rf_PrintPSStatusTable(raidPtr, row)
    411  1.1  oster   RF_Raid_t    *raidPtr;
    412  1.1  oster   RF_RowCol_t   row;
    413  1.1  oster {
    414  1.1  oster   RF_PSStatusHeader_t *pssTable = raidPtr->reconControl[row]->pssTable;
    415  1.1  oster   RealPrintPSStatusTable(raidPtr, pssTable);
    416  1.1  oster }
    417