diff options
| author | mrg <mrg@NetBSD.org> | 2018-01-18 00:32:48 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2018-01-18 00:32:48 +0000 |
| commit | 0f609155b5041134ab7ed46dd9429ad04fac7270 (patch) | |
| tree | c90944b6efd130dd5f8e966eb4f6ac1ea7ea2661 /sys/dev/raidframe/raidframevar.h | |
| parent | 6c5d1a8bfac893a96bb3a6124a146080fcc3afbf (diff) | |
implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly. remove useless 'row' in a few
places. add COMPAT_80 and put the old ioctls there.
raidframeio.h:
RAIDFRAME_TEST_ACC
- remove, unused
RAIDFRAME_GET_COMPONENT_LABEL
- convert to label not pointer to label
RAIDFRAME_CHECK_RECON_STATUS_EXT
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
- convert to progress info not pointer to info
RAIDFRAME_GET_INFO
- version entirely.
raidframevar.h:
- rf_recon_req{} has row, flags and raidPtr removed (they're
not a useful part of this interface.)
- RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
- RF_RaidDisk_s{} is re-ordered slightly to fix alignment
padding - the actual data was already OK.
- InstallSpareTable() loses row argument
rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.
rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.
move several of the per-ioctl code blocks into separate functions.
add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.
add missing case for RAIDFRAME_GET_INFO50.
adjust raid tests to use the new .conf format, and add a case to
test the old method as well.
raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified. for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)
note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
Diffstat (limited to 'sys/dev/raidframe/raidframevar.h')
| -rw-r--r-- | sys/dev/raidframe/raidframevar.h | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/sys/dev/raidframe/raidframevar.h b/sys/dev/raidframe/raidframevar.h index 53d449883a6..22ae5a669bb 100644 --- a/sys/dev/raidframe/raidframevar.h +++ b/sys/dev/raidframe/raidframevar.h @@ -1,4 +1,4 @@ -/* $NetBSD: raidframevar.h,v 1.17 2014/11/14 14:29:16 oster Exp $ */ +/* $NetBSD: raidframevar.h,v 1.18 2018/01/18 00:32:49 mrg Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -318,7 +318,7 @@ typedef union RF_GenericParam_u RF_CBParam_t; * but it must be shut down first. */ struct RF_Config_s { - RF_RowCol_t numRow, numCol, numSpare; /* number of rows, columns, + RF_RowCol_t numCol, numSpare; /* number of columns, * and spare disks */ dev_t devs[RF_MAXROW][RF_MAXCOL]; /* device numbers for disks * comprising array */ @@ -356,12 +356,8 @@ typedef RF_uint32 RF_ReconReqFlags_t; #define RF_FDFLAGS_RECON 0x1 /* fail and initiate recon */ struct rf_recon_req { /* used to tell the kernel to fail a disk */ - RF_RowCol_t row, col; + RF_RowCol_t col; RF_ReconReqFlags_t flags; - void *raidPtr; /* used internally; need not be set at ioctl - * time */ - struct rf_recon_req *next; /* used internally; need not be set at - * ioctl time */ }; struct RF_SparetWait_s { @@ -400,19 +396,18 @@ typedef enum RF_DiskStatus_e RF_DiskStatus_t; struct RF_RaidDisk_s { char devname[56]; /* name of device file */ RF_DiskStatus_t status; /* whether it is up or down */ - RF_RowCol_t spareRow; /* if in status "spared", this identifies the - * spare disk */ RF_RowCol_t spareCol; /* if in status "spared", this identifies the * spare disk */ + int blockSize; + int auto_configured;/* 1 if this component was autoconfigured. + 0 otherwise. */ RF_SectorCount_t numBlocks; /* number of blocks, obtained via READ * CAPACITY */ - int blockSize; RF_SectorCount_t partitionSize; /* The *actual* and *full* size of the partition, from the disklabel */ - int auto_configured;/* 1 if this component was autoconfigured. - 0 otherwise. */ dev_t dev; }; +#if 0 /* The per-component label information that the user can set */ typedef struct RF_ComponentInfo_s { int row; /* the row number of this component */ @@ -420,6 +415,7 @@ typedef struct RF_ComponentInfo_s { int serial_number; /* a user-specified serial number for this RAID set */ } RF_ComponentInfo_t; +#endif /* The per-component label information */ typedef struct RF_ComponentLabel_s { @@ -513,13 +509,12 @@ rf_component_label_set_partitionsize(RF_ComponentLabel_t *cl, } typedef struct RF_SingleComponent_s { - int row; + int row; /* obsolete */ int column; char component_name[50]; /* name of the component */ } RF_SingleComponent_t; typedef struct RF_DeviceConfig_s { - u_int rows; u_int cols; u_int maxqdepth; int ndevs; @@ -550,18 +545,18 @@ typedef struct RF_LayoutSW_s { int (*Configure) (RF_ShutdownList_t ** shutdownListp, RF_Raid_t * raidPtr, RF_Config_t * cfgPtr); - /* routine to map RAID sector address -> physical (row, col, offset) */ + /* routine to map RAID sector address -> physical (col, offset) */ void (*MapSector) (RF_Raid_t * raidPtr, RF_RaidAddr_t raidSector, RF_RowCol_t * col, RF_SectorNum_t * diskSector, int remap); - /* routine to map RAID sector address -> physical (r,c,o) of parity + /* routine to map RAID sector address -> physical (c,o) of parity * unit */ void (*MapParity) (RF_Raid_t * raidPtr, RF_RaidAddr_t raidSector, RF_RowCol_t * col, RF_SectorNum_t * diskSector, int remap); - /* routine to map RAID sector address -> physical (r,c,o) of Q unit */ + /* routine to map RAID sector address -> physical (c,o) of Q unit */ void (*MapQ) (RF_Raid_t * raidPtr, RF_RaidAddr_t raidSector, RF_RowCol_t * col, RF_SectorNum_t * diskSector, int remap); @@ -592,8 +587,7 @@ typedef struct RF_LayoutSW_s { RF_ReconUnitCount_t(*GetNumSpareRUs) (RF_Raid_t * raidPtr); /* spare table installation (may be NULL) */ - int (*InstallSpareTable) (RF_Raid_t * raidPtr, RF_RowCol_t frow, - RF_RowCol_t fcol); + int (*InstallSpareTable) (RF_Raid_t * raidPtr, RF_RowCol_t fcol); /* recon buffer submission function */ int (*SubmitReconBuffer) (RF_ReconBuffer_t * rbuf, int keep_it, |
