diff options
author | Thierry Deval <tdeval@cvs.openbsd.org> | 2002-08-09 15:10:21 +0000 |
---|---|---|
committer | Thierry Deval <tdeval@cvs.openbsd.org> | 2002-08-09 15:10:21 +0000 |
commit | 4c54f18f04b4867809076b446cce65277de3ab3f (patch) | |
tree | c9e2a5a06b17850f58f5f1886a06ec9d63a8a894 /sys/dev/raidframe/rf_openbsdkintf.c | |
parent | 7ca1798c557106ef6290ba8913d2ce6fc3e94475 (diff) |
Remove those noisy informational messages from dmesg.
Use the option RAIDDEBUG to get these.
Theo, thanks for suggesting.
Diffstat (limited to 'sys/dev/raidframe/rf_openbsdkintf.c')
-rw-r--r-- | sys/dev/raidframe/rf_openbsdkintf.c | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/sys/dev/raidframe/rf_openbsdkintf.c b/sys/dev/raidframe/rf_openbsdkintf.c index bb101951113..62b966abb35 100644 --- a/sys/dev/raidframe/rf_openbsdkintf.c +++ b/sys/dev/raidframe/rf_openbsdkintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rf_openbsdkintf.c,v 1.18 2002/08/05 22:11:27 tdeval Exp $ */ +/* $OpenBSD: rf_openbsdkintf.c,v 1.19 2002/08/09 15:10:20 tdeval Exp $ */ /* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -470,7 +470,7 @@ raidattach(num) if (raidautoconfig) { /* 1. locate all RAID components on the system */ -#ifdef DEBUG +#ifdef RAIDDEBUG printf("Searching for raid components...\n"); #endif ac_list = rf_find_raid_components(); @@ -517,14 +517,14 @@ rf_buildroothack(arg) if (!retcode) { if (cset->rootable) { rootID = raidID; -#ifdef DEBUG +#ifdef RAIDDEBUG printf("eligible root device %d: raid%d\n", num_root, rootID); -#endif /* DEBUG */ +#endif /* RAIDDEBUG */ num_root++; } } else { /* The autoconfig didn't work :( */ -#ifdef DEBUG +#ifdef RAIDDEBUG printf("Autoconfig failed with code %d for raid%d\n", retcode, raidID); #endif rf_release_all_vps(cset); @@ -1144,6 +1144,7 @@ raidioctl(dev, cmd, data, flag, p) trying to patch things. */ +#ifdef RAIDDEBUG printf("Got component label:\n"); printf("Version: %d\n",clabel->version); printf("Serial Number: %d\n",clabel->serial_number); @@ -1154,6 +1155,7 @@ raidioctl(dev, cmd, data, flag, p) printf("Num Columns: %d\n", clabel->num_columns); printf("Clean: %d\n", clabel->clean); printf("Status: %d\n", clabel->status); +#endif row = clabel->row; column = clabel->column; @@ -1227,13 +1229,13 @@ raidioctl(dev, cmd, data, flag, p) case RAIDFRAME_SET_AUTOCONFIG: d = rf_set_autoconfig(raidPtr, *(int *) data); - printf("New autoconfig value is: %d\n", d); + db1_printf(("New autoconfig value is: %d\n", d)); *(int *) data = d; return (retcode); case RAIDFRAME_SET_ROOT: d = rf_set_rootpartition(raidPtr, *(int *) data); - printf("New rootpartition value is: %d\n", d); + db1_printf(("New rootpartition value is: %d\n", d)); *(int *) data = d; return (retcode); @@ -1278,7 +1280,7 @@ raidioctl(dev, cmd, data, flag, p) sizeof(RF_SingleComponent_t)); row = component.row; column = component.column; - printf("Rebuild: %d %d\n",row, column); + db1_printf(("Rebuild: %d %d\n",row, column)); if ((row < 0) || (row >= raidPtr->numRow) || (column < 0) || (column >= raidPtr->numCol)) { return(EINVAL); @@ -1365,8 +1367,8 @@ raidioctl(dev, cmd, data, flag, p) rr->col < 0 || rr->col >= raidPtr->numCol) return (EINVAL); - printf("raid%d: Failing the disk: row: %d col: %d\n", - unit, rr->row, rr->col); + db1_printf(("raid%d: Failing the disk: row: %d col: %d\n", + unit, rr->row, rr->col)); /* * Make a copy of the recon request so that we don't @@ -1694,7 +1696,6 @@ raidinit(raidPtr) cf->cf_unit = unit; config_attach(NULL, cf, NULL, NULL); - printf("\n"); /* pretty up config_attach()'s output. */ } /* @@ -1944,7 +1945,7 @@ rf_DispatchKernelIO(queue, req) * I'm leaving this in, as I've never actually seen it * used, and I'd like folks to report it... GO */ - printf(("WAKEUP CALLED\n")); + db1_printf(("WAKEUP CALLED\n")); queue->numOutstanding++; /* XXX need to glue the original buffer into this?? */ @@ -2196,11 +2197,13 @@ raidgetdisklabel(dev) * same componets are used, and old disklabel may used * if that is found. */ +#ifdef RAIDDEBUG if (lp->d_secperunit != rs->sc_size) printf("WARNING: %s: " "total sector size in disklabel (%d) != " "the size of raid (%ld)\n", rs->sc_xname, lp->d_secperunit, (long) rs->sc_size); +#endif /* RAIDDEBUG */ for (i = 0; i < lp->d_npartitions; i++) { pp = &lp->d_partitions[i]; if (pp->p_offset + pp->p_size > rs->sc_size) @@ -2252,9 +2255,9 @@ raidlookup(path, p, vpp) NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, p); if ((error = vn_open(&nd, FREAD|FWRITE, 0)) != 0) { -#ifdef DEBUG +#ifdef RAIDDEBUG printf("RAIDframe: vn_open returned %d\n", error); -#endif +#endif /* RAIDDEBUG */ return (error); } vp = nd.ni_vp; @@ -2382,14 +2385,13 @@ raidread_component_label(dev, b_vp, clabel) rf_print_component_label( clabel ); #endif } else { -#if 0 - printf("Failed to read RAID component label!\n"); -#endif + db1_printf(("Failed to read RAID component label!\n")); } brelse(bp); return(error); } + /* ARGSUSED */ int raidwrite_component_label(dev, b_vp, clabel) @@ -2418,9 +2420,7 @@ raidwrite_component_label(dev, b_vp, clabel) error = biowait(bp); brelse(bp); if (error) { -#if 1 printf("Failed to write RAID component info!\n"); -#endif } return(error); @@ -2666,7 +2666,8 @@ rf_UnconfigureVnodes(raidPtr) for (r = 0; r < raidPtr->numRow; r++) { for (c = 0; c < raidPtr->numCol; c++) { - printf("Closing vnode for row: %d col: %d\n", r, c); + db1_printf(("Closing vnode for row: %d col: %d\n", + r, c)); vp = raidPtr->raid_cinfo[r][c].ci_vp; acd = raidPtr->Disks[r][c].auto_configured; rf_close_component(raidPtr, vp, acd); @@ -2675,7 +2676,7 @@ rf_UnconfigureVnodes(raidPtr) } } for (r = 0; r < raidPtr->numSpare; r++) { - printf("Closing vnode for spare: %d\n", r); + db1_printf(("Closing vnode for spare: %d\n", r)); vp = raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp; acd = raidPtr->Disks[0][raidPtr->numCol + r].auto_configured; rf_close_component(raidPtr, vp, acd); @@ -2890,7 +2891,7 @@ rf_find_raid_components() if (rf_reasonable_label(clabel) && (clabel->partitionSize <= label.d_partitions[i].p_size)) { -#ifdef DEBUG +#ifdef RAIDDEBUG printf("Component on: %s%c: %d\n", dv->dv_xname, 'a'+i, label.d_partitions[i].p_size); @@ -2976,7 +2977,7 @@ rf_print_component_label(clabel) clabel->root_partition ? "Yes" : "No" ); printf(" Last configured as: raid%d\n", clabel->last_unit ); #if 0 - printf(" Config order: %d\n", clabel->config_order); + printf(" Config order: %d\n", clabel->config_order); #endif } @@ -3162,7 +3163,7 @@ rf_have_enough_components(cset) (ac->clabel->column == c) && (ac->clabel->mod_counter == mod_counter)) { /* it's this one... */ -#ifdef DEBUG +#ifdef RAIDDEBUG printf("Found: %s at %d,%d\n", ac->devname,r,c); #endif @@ -3481,7 +3482,7 @@ rf_auto_config_set(cset,unit) int raidID; int retcode; - printf("RAID autoconfigure\n"); + db1_printf(("RAID autoconfigure\n")); retcode = 0; *unit = -1; @@ -3534,7 +3535,6 @@ rf_auto_config_set(cset,unit) printf("(Out of RAID devs!)\n"); return(1); } - printf("Configuring raid%d:\n",raidID); raidPtr = raidPtrs[raidID]; /* XXX all this stuff should be done SOMEWHERE ELSE! */ @@ -3562,6 +3562,13 @@ rf_auto_config_set(cset,unit) } } + printf(": (%s) total number of sectors is %lu (%lu MB)%s\n", + (raidPtrs[raidID]->Layout).map->configName, + (unsigned long) raidPtrs[raidID]->totalSectors, + (unsigned long) (raidPtrs[raidID]->totalSectors / 1024 * + (1 << raidPtrs[raidID]->logBytesPerSector) / 1024), + raidPtrs[raidID]->root_partition ? " as root" : ""); + /* 5. Cleanup */ free(config, M_RAIDFRAME); |