From 90c4fe0cc6fd57f75f3be39bce2002255532cdcd Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 24 May 2021 07:43:15 +0000 Subject: make various things static, and minor KNF clean up. ignore spiflash as a raid device. --- sys/dev/raidframe/rf_netbsdkintf.c | 87 ++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 42 deletions(-) (limited to 'sys/dev/raidframe') diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 15bc13b269e..421cc1c39cf 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -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 -__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 int raid_detach_unlocked(struct raid_softc *); 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 *); +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 *); -RF_AutoConfig_t *rf_find_raid_components(void); -RF_ConfigSet_t *rf_create_auto_sets(RF_AutoConfig_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 @@ raidattach(int num) */ } -int +static int rf_autoconfig(device_t self) { RF_AutoConfig_t *ac_list; @@ -481,7 +480,7 @@ rf_containsboot(RF_Raid_t *r, device_t bdv) { return 0; } -void +static void rf_buildroothack(RF_ConfigSet_t *config_sets) { RF_ConfigSet_t *cset; @@ -2614,7 +2613,7 @@ rf_UnconfigureVnodes(RF_Raid_t *raidPtr) } -void +static void rf_ReconThread(struct rf_recon_req_internal *req) { int s; @@ -2636,7 +2635,7 @@ rf_ReconThread(struct rf_recon_req_internal *req) kthread_exit(0); /* does not return */ } -void +static void rf_RewriteParityThread(RF_Raid_t *raidPtr) { int retcode; @@ -2670,7 +2669,7 @@ rf_RewriteParityThread(RF_Raid_t *raidPtr) } -void +static void rf_CopybackThread(RF_Raid_t *raidPtr) { int s; @@ -2686,7 +2685,7 @@ rf_CopybackThread(RF_Raid_t *raidPtr) } -void +static void rf_ReconstructInPlaceThread(struct rf_recon_req_internal *req) { int s; @@ -2746,7 +2745,7 @@ rf_get_component(RF_AutoConfig_t *ac_list, dev_t dev, struct vnode *vp, return ac_list; } -RF_AutoConfig_t * +static RF_AutoConfig_t * rf_find_raid_components(void) { struct vnode *vp; @@ -2775,21 +2774,21 @@ rf_find_raid_components(void) 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 @@ rf_find_raid_components(void) 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 @@ rf_find_raid_components(void) 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 @@ rf_print_component_label(RF_ComponentLabel_t *clabel) } #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 @@ rf_does_it_fit(RF_ConfigSet_t *cset, RF_AutoConfig_t *ac) return(1); } -int +static int rf_have_enough_components(RF_ConfigSet_t *cset) { RF_AutoConfig_t *ac; @@ -3271,7 +3274,7 @@ rf_have_enough_components(RF_ConfigSet_t *cset) return(1); } -void +static void rf_create_configuration(RF_AutoConfig_t *ac, RF_Config_t *config, RF_Raid_t *raidPtr) { @@ -3305,7 +3308,7 @@ rf_create_configuration(RF_AutoConfig_t *ac, RF_Config_t *config, } } -int +static int rf_set_autoconfig(RF_Raid_t *raidPtr, int new_value) { RF_ComponentLabel_t *clabel; @@ -3332,7 +3335,7 @@ rf_set_autoconfig(RF_Raid_t *raidPtr, int new_value) return(new_value); } -int +static int rf_set_rootpartition(RF_Raid_t *raidPtr, int new_value) { RF_ComponentLabel_t *clabel; @@ -3358,7 +3361,7 @@ rf_set_rootpartition(RF_Raid_t *raidPtr, int new_value) return(new_value); } -void +static void rf_release_all_vps(RF_ConfigSet_t *cset) { RF_AutoConfig_t *ac; @@ -3377,7 +3380,7 @@ rf_release_all_vps(RF_ConfigSet_t *cset) } -void +static void rf_cleanup_config_set(RF_ConfigSet_t *cset) { RF_AutoConfig_t *ac; @@ -3431,7 +3434,7 @@ raid_init_component_label(RF_Raid_t *raidPtr, RF_ComponentLabel_t *clabel) #endif } -struct raid_softc * +static struct raid_softc * rf_auto_config_set(RF_ConfigSet_t *cset) { RF_Raid_t *raidPtr; -- cgit