summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_disks.h
diff options
context:
space:
mode:
authorThierry Deval <tdeval@cvs.openbsd.org>2002-12-16 07:01:06 +0000
committerThierry Deval <tdeval@cvs.openbsd.org>2002-12-16 07:01:06 +0000
commit9f4f754a2c89fa0aae2495b9897832c871e55410 (patch)
tree990a42520130e4092662926e20b65536fa947a43 /sys/dev/raidframe/rf_disks.h
parentd18f950d8b18360863af577de1796c0079f4bc20 (diff)
Major KNF. Incentive from Tedu
Diffstat (limited to 'sys/dev/raidframe/rf_disks.h')
-rw-r--r--sys/dev/raidframe/rf_disks.h128
1 files changed, 73 insertions, 55 deletions
diff --git a/sys/dev/raidframe/rf_disks.h b/sys/dev/raidframe/rf_disks.h
index bb15d365b5e..f6ea2e666d2 100644
--- a/sys/dev/raidframe/rf_disks.h
+++ b/sys/dev/raidframe/rf_disks.h
@@ -1,5 +1,6 @@
-/* $OpenBSD: rf_disks.h,v 1.4 2000/08/08 16:07:40 peter Exp $ */
+/* $OpenBSD: rf_disks.h,v 1.5 2002/12/16 07:01:03 tdeval Exp $ */
/* $NetBSD: rf_disks.h,v 1.8 2000/03/27 03:25:17 oster Exp $ */
+
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -28,20 +29,20 @@
*/
/*
- * rf_disks.h -- header file for code related to physical disks
+ * rf_disks.h -- Header file for code related to physical disks.
*/
-#ifndef _RF__RF_DISKS_H_
-#define _RF__RF_DISKS_H_
+#ifndef _RF__RF_DISKS_H_
+#define _RF__RF_DISKS_H_
#include <sys/types.h>
#include "rf_archs.h"
#include "rf_types.h"
-#if defined(__NetBSD__)
+#if defined(__NetBSD__)
#include "rf_netbsd.h"
-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__)
#include "rf_openbsd.h"
#endif
@@ -50,69 +51,86 @@
* IF YOU ADD A STATE, CHECK TO SEE IF YOU NEED TO MODIFY RF_DEAD_DISK() BELOW.
*/
enum RF_DiskStatus_e {
- rf_ds_optimal, /* no problems */
- rf_ds_failed, /* reconstruction ongoing */
- rf_ds_reconstructing, /* reconstruction complete to spare, dead disk
- * not yet replaced */
- rf_ds_dist_spared, /* reconstruction complete to distributed
- * spare space, dead disk not yet replaced */
- rf_ds_spared, /* reconstruction complete to distributed
- * spare space, dead disk not yet replaced */
- rf_ds_spare, /* an available spare disk */
- rf_ds_used_spare /* a spare which has been used, and hence is
- * not available */
+ rf_ds_optimal, /* No problems. */
+ rf_ds_failed, /* Reconstruction ongoing. */
+ rf_ds_reconstructing, /*
+ * Reconstruction complete to spare, dead disk
+ * not yet replaced.
+ */
+ rf_ds_dist_spared, /*
+ * Reconstruction complete to distributed
+ * spare space, dead disk not yet replaced.
+ */
+ rf_ds_spared, /*
+ * Reconstruction complete to distributed
+ * spare space, dead disk not yet replaced.
+ */
+ rf_ds_spare, /* An available spare disk. */
+ rf_ds_used_spare /*
+ * A spare which has been used, and hence is
+ * not available.
+ */
};
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 */
- 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;
+ 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.
+ */
+ 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;
};
+
/*
* An RF_DiskOp_t ptr is really a pointer to a UAGT_CCB, but I want
- * to isolate the cam layer from all other layers, so I typecast to/from
+ * to isolate the CAM layer from all other layers, so I typecast to/from
* RF_DiskOp_t * (i.e. void *) at the interfaces.
*/
typedef void RF_DiskOp_t;
-/* if a disk is in any of these states, it is inaccessible */
-#define RF_DEAD_DISK(_dstat_) (((_dstat_) == rf_ds_spared) || \
- ((_dstat_) == rf_ds_reconstructing) || ((_dstat_) == rf_ds_failed) || \
- ((_dstat_) == rf_ds_dist_spared))
+/* If a disk is in any of these states, it is inaccessible. */
+#define RF_DEAD_DISK(_dstat_) \
+ (((_dstat_) == rf_ds_spared) || \
+ ((_dstat_) == rf_ds_reconstructing) || \
+ ((_dstat_) == rf_ds_failed) || \
+ ((_dstat_) == rf_ds_dist_spared))
-#ifdef _KERNEL
-#if defined(__NetBSD__)
+#ifdef _KERNEL
+#if defined(__NetBSD__)
#include "rf_netbsd.h"
-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__)
#include "rf_openbsd.h"
#endif
-int rf_ConfigureDisks(RF_ShutdownList_t ** listp, RF_Raid_t * raidPtr,
- RF_Config_t * cfgPtr);
-int rf_ConfigureSpareDisks(RF_ShutdownList_t ** listp, RF_Raid_t * raidPtr,
- RF_Config_t * cfgPtr);
-int rf_ConfigureDisk(RF_Raid_t * raidPtr, char *buf, RF_RaidDisk_t * diskPtr,
- RF_RowCol_t row, RF_RowCol_t col);
-int rf_AutoConfigureDisks(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr,
- RF_AutoConfig_t *auto_config);
-int rf_CheckLabels( RF_Raid_t *, RF_Config_t *);
-int rf_add_hot_spare(RF_Raid_t *raidPtr, RF_SingleComponent_t *sparePtr);
-int rf_remove_hot_spare(RF_Raid_t *raidPtr, RF_SingleComponent_t *sparePtr);
-int rf_delete_component(RF_Raid_t *raidPtr, RF_SingleComponent_t *component);
-int rf_incorporate_hot_spare(RF_Raid_t *raidPtr,
- RF_SingleComponent_t *component);
-#endif /* _KERNEL */
+int rf_ConfigureDisks(RF_ShutdownList_t **, RF_Raid_t *, RF_Config_t *);
+int rf_ConfigureSpareDisks(RF_ShutdownList_t **, RF_Raid_t *, RF_Config_t *);
+int rf_ConfigureDisk(RF_Raid_t *, char *, RF_RaidDisk_t *,
+ RF_RowCol_t, RF_RowCol_t);
+int rf_AutoConfigureDisks(RF_Raid_t *, RF_Config_t *, RF_AutoConfig_t *);
+int rf_CheckLabels(RF_Raid_t *, RF_Config_t *);
+int rf_add_hot_spare(RF_Raid_t *, RF_SingleComponent_t *);
+int rf_remove_hot_spare(RF_Raid_t *, RF_SingleComponent_t *);
+int rf_delete_component(RF_Raid_t *, RF_SingleComponent_t *);
+int rf_incorporate_hot_spare(RF_Raid_t *, RF_SingleComponent_t *);
+#endif /* _KERNEL */
-#endif /* !_RF__RF_DISKS_H_ */
+#endif /* !_RF__RF_DISKS_H_ */