2002-09-21 05:14:22 +04:00
|
|
|
/* $NetBSD: rf_map.h,v 1.7 2002/09/21 01:14:22 oster Exp $ */
|
1998-11-13 07:20:26 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1995 Carnegie-Mellon University.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Author: Mark Holland
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify and distribute this software and
|
|
|
|
* its documentation is hereby granted, provided that both the copyright
|
|
|
|
* notice and this permission notice appear in all copies of the
|
|
|
|
* software, derivative works or modified versions, and any portions
|
|
|
|
* thereof, and that both notices appear in supporting documentation.
|
|
|
|
*
|
|
|
|
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
|
|
|
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
|
|
|
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* Carnegie Mellon requests users of this software to return to
|
|
|
|
*
|
|
|
|
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
|
|
|
* School of Computer Science
|
|
|
|
* Carnegie Mellon University
|
|
|
|
* Pittsburgh PA 15213-3890
|
|
|
|
*
|
|
|
|
* any improvements or extensions that they make and grant Carnegie the
|
|
|
|
* rights to redistribute these changes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* rf_map.h */
|
|
|
|
|
|
|
|
#ifndef _RF__RF_MAP_H_
|
|
|
|
#define _RF__RF_MAP_H_
|
|
|
|
|
2001-10-04 19:58:51 +04:00
|
|
|
#include <dev/raidframe/raidframevar.h>
|
|
|
|
|
1998-11-13 07:20:26 +03:00
|
|
|
#include "rf_alloclist.h"
|
|
|
|
#include "rf_raid.h"
|
|
|
|
|
|
|
|
/* mapping structure allocation and free routines */
|
1999-02-05 03:06:06 +03:00
|
|
|
RF_AccessStripeMapHeader_t *
|
|
|
|
rf_MapAccess(RF_Raid_t * raidPtr,
|
|
|
|
RF_RaidAddr_t raidAddress, RF_SectorCount_t numBlocks,
|
|
|
|
caddr_t buffer, int remap);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void
|
|
|
|
rf_MarkFailuresInASMList(RF_Raid_t * raidPtr,
|
|
|
|
RF_AccessStripeMapHeader_t * asm_h);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
int rf_ConfigureMapModule(RF_ShutdownList_t ** listp);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
|
|
|
RF_AccessStripeMapHeader_t *rf_AllocAccessStripeMapHeader(void);
|
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void rf_FreeAccessStripeMapHeader(RF_AccessStripeMapHeader_t * p);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
|
|
|
RF_PhysDiskAddr_t *rf_AllocPhysDiskAddr(void);
|
|
|
|
|
|
|
|
RF_PhysDiskAddr_t *rf_AllocPDAList(int count);
|
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void rf_FreePhysDiskAddr(RF_PhysDiskAddr_t * p);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
|
|
|
RF_AccessStripeMap_t *rf_AllocASMList(int count);
|
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void rf_FreeAccessStripeMap(RF_AccessStripeMapHeader_t * hdr);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
int rf_CheckStripeForFailures(RF_Raid_t * raidPtr, RF_AccessStripeMap_t * asmap);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
int rf_NumFailedDataUnitsInStripe(RF_Raid_t * raidPtr, RF_AccessStripeMap_t * asmap);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void rf_PrintAccessStripeMap(RF_AccessStripeMapHeader_t * asm_h);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void rf_PrintFullAccessStripeMap(RF_AccessStripeMapHeader_t * asm_h, int prbuf);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void
|
|
|
|
rf_PrintRaidAddressInfo(RF_Raid_t * raidPtr, RF_RaidAddr_t raidAddr,
|
|
|
|
RF_SectorCount_t numBlocks);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void
|
|
|
|
rf_ASMParityAdjust(RF_PhysDiskAddr_t * toAdjust,
|
|
|
|
RF_StripeNum_t startAddrWithinStripe, RF_SectorNum_t endAddress,
|
|
|
|
RF_RaidLayout_t * layoutPtr, RF_AccessStripeMap_t * asm_p);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
void
|
|
|
|
rf_ASMCheckStatus(RF_Raid_t * raidPtr, RF_PhysDiskAddr_t * pda_p,
|
|
|
|
RF_AccessStripeMap_t * asm_p, RF_RaidDisk_t ** disks, int parity);
|
1998-11-13 07:20:26 +03:00
|
|
|
|
1999-02-05 03:06:06 +03:00
|
|
|
#endif /* !_RF__RF_MAP_H_ */
|