Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe make various things static, and minor KNF ...
details: https://anonhg.NetBSD.org/src/rev/4a000f998350
branches: trunk
changeset: 983446:4a000f998350
user: mrg <mrg%NetBSD.org@localhost>
date: Mon May 24 07:43:15 2021 +0000
description:
make various things static, and minor KNF clean up.
ignore spiflash as a raid device.
diffstat:
sys/dev/raidframe/rf_netbsdkintf.c | 89 +++++++++++++++++++------------------
1 files changed, 46 insertions(+), 43 deletions(-)
diffs (252 lines):
diff -r 1a6ed8dde3c2 -r 4a000f998350 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c Mon May 24 07:27:39 2021 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c Mon May 24 07:43:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.392 2021/04/26 07:27:24 mrg Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.393 2021/05/24 07:43:15 mrg Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.392 2021/04/26 07:27:24 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.393 2021/05/24 07:43:15 mrg Exp $");
#ifdef _KERNEL_OPT
#include "opt_raid_autoconfig.h"
@@ -300,24 +300,23 @@
static void rf_markalldirty(RF_Raid_t *);
static void rf_set_geometry(struct raid_softc *, RF_Raid_t *);
-void rf_ReconThread(struct rf_recon_req_internal *);
-void rf_RewriteParityThread(RF_Raid_t *raidPtr);
-void rf_CopybackThread(RF_Raid_t *raidPtr);
-void rf_ReconstructInPlaceThread(struct rf_recon_req_internal *);
-int rf_autoconfig(device_t);
-void rf_buildroothack(RF_ConfigSet_t *);
-
-RF_AutoConfig_t *rf_find_raid_components(void);
-RF_ConfigSet_t *rf_create_auto_sets(RF_AutoConfig_t *);
+static void rf_ReconThread(struct rf_recon_req_internal *);
+static void rf_RewriteParityThread(RF_Raid_t *raidPtr);
+static void rf_CopybackThread(RF_Raid_t *raidPtr);
+static void rf_ReconstructInPlaceThread(struct rf_recon_req_internal *);
+static int rf_autoconfig(device_t);
+static void rf_buildroothack(RF_ConfigSet_t *);
+
+static RF_AutoConfig_t *rf_find_raid_components(void);
+static RF_ConfigSet_t *rf_create_auto_sets(RF_AutoConfig_t *);
static int rf_does_it_fit(RF_ConfigSet_t *,RF_AutoConfig_t *);
-int rf_reasonable_label(RF_ComponentLabel_t *, uint64_t);
-void rf_create_configuration(RF_AutoConfig_t *,RF_Config_t *, RF_Raid_t *);
-int rf_set_autoconfig(RF_Raid_t *, int);
-int rf_set_rootpartition(RF_Raid_t *, int);
-void rf_release_all_vps(RF_ConfigSet_t *);
-void rf_cleanup_config_set(RF_ConfigSet_t *);
-int rf_have_enough_components(RF_ConfigSet_t *);
-struct raid_softc *rf_auto_config_set(RF_ConfigSet_t *);
+static void rf_create_configuration(RF_AutoConfig_t *,RF_Config_t *, RF_Raid_t *);
+static int rf_set_autoconfig(RF_Raid_t *, int);
+static int rf_set_rootpartition(RF_Raid_t *, int);
+static void rf_release_all_vps(RF_ConfigSet_t *);
+static void rf_cleanup_config_set(RF_ConfigSet_t *);
+static int rf_have_enough_components(RF_ConfigSet_t *);
+static struct raid_softc *rf_auto_config_set(RF_ConfigSet_t *);
static void rf_fix_old_label_size(RF_ComponentLabel_t *, uint64_t);
/*
@@ -397,7 +396,7 @@
*/
}
-int
+static int
rf_autoconfig(device_t self)
{
RF_AutoConfig_t *ac_list;
@@ -481,7 +480,7 @@
return 0;
}
-void
+static void
rf_buildroothack(RF_ConfigSet_t *config_sets)
{
RF_ConfigSet_t *cset;
@@ -2614,7 +2613,7 @@
}
-void
+static void
rf_ReconThread(struct rf_recon_req_internal *req)
{
int s;
@@ -2636,7 +2635,7 @@
kthread_exit(0); /* does not return */
}
-void
+static void
rf_RewriteParityThread(RF_Raid_t *raidPtr)
{
int retcode;
@@ -2670,7 +2669,7 @@
}
-void
+static void
rf_CopybackThread(RF_Raid_t *raidPtr)
{
int s;
@@ -2686,7 +2685,7 @@
}
-void
+static void
rf_ReconstructInPlaceThread(struct rf_recon_req_internal *req)
{
int s;
@@ -2746,7 +2745,7 @@
return ac_list;
}
-RF_AutoConfig_t *
+static RF_AutoConfig_t *
rf_find_raid_components(void)
{
struct vnode *vp;
@@ -2775,21 +2774,21 @@
for (dv = deviter_first(&di, DEVITER_F_ROOT_FIRST); dv != NULL;
dv = deviter_next(&di)) {
- /* we are only interested in disks... */
+ /* we are only interested in disks */
if (device_class(dv) != DV_DISK)
continue;
- /* we don't care about floppies... */
+ /* we don't care about floppies */
if (device_is_a(dv, "fd")) {
continue;
}
- /* we don't care about CD's... */
+ /* we don't care about CDs. */
if (device_is_a(dv, "cd")) {
continue;
}
- /* we don't care about md's... */
+ /* we don't care about md. */
if (device_is_a(dv, "md")) {
continue;
}
@@ -2804,6 +2803,11 @@
continue;
}
+ /* we don't care about spiflash */
+ if (device_is_a(dv, "spiflash")) {
+ continue;
+ }
+
/* are we in the wedges pass ? */
wedge = device_is_a(dv, "dk");
if (wedge != dowedges) {
@@ -2953,15 +2957,14 @@
return ac_list;
}
-
int
rf_reasonable_label(RF_ComponentLabel_t *clabel, uint64_t numsecs)
{
- if (((clabel->version==RF_COMPONENT_LABEL_VERSION_1) ||
- (clabel->version==RF_COMPONENT_LABEL_VERSION)) &&
- ((clabel->clean == RF_RAID_CLEAN) ||
- (clabel->clean == RF_RAID_DIRTY)) &&
+ if ((clabel->version==RF_COMPONENT_LABEL_VERSION_1 ||
+ clabel->version==RF_COMPONENT_LABEL_VERSION) &&
+ (clabel->clean == RF_RAID_CLEAN ||
+ clabel->clean == RF_RAID_DIRTY) &&
clabel->row >=0 &&
clabel->column >= 0 &&
clabel->num_rows > 0 &&
@@ -3052,7 +3055,7 @@
}
#endif
-RF_ConfigSet_t *
+static RF_ConfigSet_t *
rf_create_auto_sets(RF_AutoConfig_t *ac_list)
{
RF_AutoConfig_t *ac;
@@ -3168,7 +3171,7 @@
return(1);
}
-int
+static int
rf_have_enough_components(RF_ConfigSet_t *cset)
{
RF_AutoConfig_t *ac;
@@ -3271,7 +3274,7 @@
return(1);
}
-void
+static void
rf_create_configuration(RF_AutoConfig_t *ac, RF_Config_t *config,
RF_Raid_t *raidPtr)
{
@@ -3305,7 +3308,7 @@
}
}
-int
+static int
rf_set_autoconfig(RF_Raid_t *raidPtr, int new_value)
{
RF_ComponentLabel_t *clabel;
@@ -3332,7 +3335,7 @@
return(new_value);
}
-int
+static int
rf_set_rootpartition(RF_Raid_t *raidPtr, int new_value)
{
RF_ComponentLabel_t *clabel;
@@ -3358,7 +3361,7 @@
return(new_value);
}
-void
+static void
rf_release_all_vps(RF_ConfigSet_t *cset)
{
RF_AutoConfig_t *ac;
@@ -3377,7 +3380,7 @@
}
-void
+static void
rf_cleanup_config_set(RF_ConfigSet_t *cset)
{
RF_AutoConfig_t *ac;
@@ -3431,7 +3434,7 @@
#endif
}
-struct raid_softc *
+static struct raid_softc *
rf_auto_config_set(RF_ConfigSet_t *cset)
{
RF_Raid_t *raidPtr;
Home |
Main Index |
Thread Index |
Old Index