Home | History | Annotate | Line # | Download | only in raidframe
rf_evenodd_dagfuncs.h revision 1.5.164.1
      1  1.5.164.1  martin /*	$NetBSD: rf_evenodd_dagfuncs.h,v 1.5.164.1 2020/04/13 08:04:47 martin Exp $	*/
      2        1.1   oster /*
      3        1.1   oster  * rf_evenodd_dagfuncs.h
      4        1.1   oster  */
      5        1.1   oster /*
      6        1.1   oster  * Copyright (c) 1996 Carnegie-Mellon University.
      7        1.1   oster  * All rights reserved.
      8        1.1   oster  *
      9        1.1   oster  * Author: Chang-Ming Wu
     10        1.1   oster  *
     11        1.1   oster  * Permission to use, copy, modify and distribute this software and
     12        1.1   oster  * its documentation is hereby granted, provided that both the copyright
     13        1.1   oster  * notice and this permission notice appear in all copies of the
     14        1.1   oster  * software, derivative works or modified versions, and any portions
     15        1.1   oster  * thereof, and that both notices appear in supporting documentation.
     16        1.1   oster  *
     17        1.1   oster  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     18        1.1   oster  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     19        1.1   oster  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     20        1.1   oster  *
     21        1.1   oster  * Carnegie Mellon requests users of this software to return to
     22        1.1   oster  *
     23        1.1   oster  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     24        1.1   oster  *  School of Computer Science
     25        1.1   oster  *  Carnegie Mellon University
     26        1.1   oster  *  Pittsburgh PA 15213-3890
     27        1.1   oster  *
     28        1.1   oster  * any improvements or extensions that they make and grant Carnegie the
     29        1.1   oster  * rights to redistribute these changes.
     30        1.1   oster  */
     31        1.1   oster 
     32        1.1   oster #ifndef _RF__RF_EVENODD_DAGFUNCS_H_
     33        1.1   oster #define _RF__RF_EVENODD_DAGFUNCS_H_
     34        1.1   oster 
     35        1.1   oster extern RF_RedFuncs_t rf_EOSmallWriteEFuncs;
     36        1.1   oster extern RF_RedFuncs_t rf_EOSmallWritePFuncs;
     37        1.1   oster extern RF_RedFuncs_t rf_eoERecoveryFuncs;
     38        1.1   oster extern RF_RedFuncs_t rf_eoPRecoveryFuncs;
     39        1.1   oster extern RF_RedFuncs_t rf_eoERecoveryFuncs;
     40        1.1   oster 
     41  1.5.164.1  martin void    rf_RegularPEFunc(RF_DagNode_t * node);
     42  1.5.164.1  martin void    rf_RegularONEFunc(RF_DagNode_t * node);
     43  1.5.164.1  martin void    rf_SimpleONEFunc(RF_DagNode_t * node);
     44        1.2   oster void    rf_RegularESubroutine(RF_DagNode_t * node, char *ebuf);
     45  1.5.164.1  martin void    rf_RegularEFunc(RF_DagNode_t * node);
     46        1.2   oster void    rf_DegrESubroutine(RF_DagNode_t * node, char *ebuf);
     47  1.5.164.1  martin void    rf_Degraded_100_EOFunc(RF_DagNode_t * node);
     48        1.4   perry void
     49        1.2   oster rf_e_EncOneSect(RF_RowCol_t srcLogicCol, char *srcSecbuf,
     50        1.2   oster     RF_RowCol_t destLogicCol, char *destSecbuf, int bytesPerSector);
     51        1.4   perry void
     52        1.2   oster rf_e_encToBuf(RF_Raid_t * raidPtr, RF_RowCol_t srcLogicCol,
     53        1.2   oster     char *srcbuf, RF_RowCol_t destLogicCol, char *destbuf, int numSector);
     54  1.5.164.1  martin void    rf_RecoveryEFunc(RF_DagNode_t * node);
     55  1.5.164.1  martin void    rf_EO_DegradedWriteEFunc(RF_DagNode_t * node);
     56        1.4   perry void
     57        1.2   oster rf_doubleEOdecode(RF_Raid_t * raidPtr, char **rrdbuf, char **dest,
     58        1.2   oster     RF_RowCol_t * fcol, char *pbuf, char *ebuf);
     59  1.5.164.1  martin void    rf_EvenOddDoubleRecoveryFunc(RF_DagNode_t * node);
     60  1.5.164.1  martin void    rf_EOWriteDoubleRecoveryFunc(RF_DagNode_t * node);
     61        1.1   oster 
     62        1.1   oster #define rf_EUCol(_layoutPtr_, _addr_ ) \
     63        1.1   oster ( (_addr_)%( (_layoutPtr_)->dataSectorsPerStripe ) )/((_layoutPtr_)->sectorsPerStripeUnit)
     64        1.1   oster 
     65        1.1   oster #define rf_EO_Mod( _int1_, _int2_ ) \
     66        1.1   oster ( ((_int1_) < 0)? (((_int1_)+(_int2_))%(_int2_)) : (_int1_)%(_int2_) )
     67        1.1   oster 
     68        1.1   oster #define rf_OffsetOfNextEUBoundary(_offset_, sec_per_eu) ((_offset_)/(sec_per_eu) + 1)*(sec_per_eu)
     69        1.1   oster 
     70        1.1   oster #define RF_EO_MATRIX_DIM 17
     71        1.1   oster 
     72        1.1   oster /*
     73        1.1   oster  * RF_EO_MATRIX_DIM should be a prime number: and "bytesPerSector" should be
     74        1.3   perry  * dividable by ( RF_EO_MATRIX_DIM - 1) to fully encode and use the space
     75        1.1   oster  * in a sector, this number could also be 17. Tha later case doesn't apply
     76        1.1   oster  * for disk array larger than 17 columns totally.
     77        1.1   oster  */
     78        1.1   oster 
     79        1.2   oster #endif				/* !_RF__RF_EVENODD_DAGFUNCS_H_ */
     80