Home | History | Annotate | Line # | Download | only in raidframe
      1 /*	$NetBSD: rf_pq.h,v 1.6 2019/10/10 03:43:59 christos Exp $	*/
      2 /*
      3  * rf_pq.h
      4  */
      5 /*
      6  * Copyright (c) 1995 Carnegie-Mellon University.
      7  * All rights reserved.
      8  *
      9  * Author: Daniel Stodolsky
     10  *
     11  * Permission to use, copy, modify and distribute this software and
     12  * its documentation is hereby granted, provided that both the copyright
     13  * notice and this permission notice appear in all copies of the
     14  * software, derivative works or modified versions, and any portions
     15  * thereof, and that both notices appear in supporting documentation.
     16  *
     17  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     18  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     19  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     20  *
     21  * Carnegie Mellon requests users of this software to return to
     22  *
     23  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     24  *  School of Computer Science
     25  *  Carnegie Mellon University
     26  *  Pittsburgh PA 15213-3890
     27  *
     28  * any improvements or extensions that they make and grant Carnegie the
     29  * rights to redistribute these changes.
     30  */
     31 
     32 #ifndef _RF__RF_PQ_H_
     33 #define _RF__RF_PQ_H_
     34 
     35 #include "rf_archs.h"
     36 
     37 extern RF_RedFuncs_t rf_pFuncs;
     38 extern RF_RedFuncs_t rf_pRecoveryFuncs;
     39 
     40 void    rf_RegularONPFunc(RF_DagNode_t * node);
     41 void    rf_SimpleONPFunc(RF_DagNode_t * node);
     42 void    rf_RecoveryPFunc(RF_DagNode_t * node);
     43 void    rf_RegularPFunc(RF_DagNode_t * node);
     44 
     45 #if (RF_INCLUDE_DECL_PQ > 0) || (RF_INCLUDE_RAID6 > 0)
     46 
     47 extern RF_RedFuncs_t rf_qFuncs;
     48 extern RF_RedFuncs_t rf_qRecoveryFuncs;
     49 extern RF_RedFuncs_t rf_pqRecoveryFuncs;
     50 
     51 void
     52 rf_PQDagSelect(RF_Raid_t * raidPtr, RF_IoType_t type,
     53     RF_AccessStripeMap_t * asmap, RF_VoidFuncPtr * createFunc);
     54 RF_CREATE_DAG_FUNC_DECL(rf_PQCreateLargeWriteDAG);
     55 void    rf_RegularONQFunc(RF_DagNode_t * node);
     56 void    rf_SimpleONQFunc(RF_DagNode_t * node);
     57 RF_CREATE_DAG_FUNC_DECL(rf_PQCreateSmallWriteDAG);
     58 void    rf_RegularPQFunc(RF_DagNode_t * node);
     59 void    rf_RegularQFunc(RF_DagNode_t * node);
     60 void    rf_Degraded_100_PQFunc(RF_DagNode_t * node);
     61 void    rf_RecoveryQFunc(RF_DagNode_t * node);
     62 void    rf_RecoveryPQFunc(RF_DagNode_t * node);
     63 void    rf_PQ_DegradedWriteQFunc(RF_DagNode_t * node);
     64 void
     65 rf_IncQ(unsigned long *dest, unsigned long *buf, unsigned length,
     66     unsigned coeff);
     67 void
     68 rf_PQ_recover(unsigned long *pbuf, unsigned long *qbuf, unsigned long *abuf,
     69     unsigned long *bbuf, unsigned length, unsigned coeff_a, unsigned coeff_b);
     70 
     71 #endif				/* (RF_INCLUDE_DECL_PQ > 0) ||
     72 				 * (RF_INCLUDE_RAID6 > 0) */
     73 
     74 #endif				/* !_RF__RF_PQ_H_ */
     75