diff options
Diffstat (limited to 'sbin/raidctl')
-rw-r--r-- | sbin/raidctl/Makefile | 4 | ||||
-rw-r--r-- | sbin/raidctl/raidctl.8 | 206 | ||||
-rw-r--r-- | sbin/raidctl/raidctl.c | 80 | ||||
-rw-r--r-- | sbin/raidctl/rf_configure.c | 18 |
4 files changed, 154 insertions, 154 deletions
diff --git a/sbin/raidctl/Makefile b/sbin/raidctl/Makefile index 5b254eed896..25b3c163f95 100644 --- a/sbin/raidctl/Makefile +++ b/sbin/raidctl/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.6 2001/12/29 21:54:57 tdeval Exp $ +# $OpenBSD: Makefile,v 1.7 2002/06/09 08:13:09 todd Exp $ # $NetBSD: Makefile,v 1.8 2001/01/27 19:32:47 oster Exp $ -PROG= raidctl +PROG= raidctl SRCS= rf_configure.c raidctl.c MAN= raidctl.8 diff --git a/sbin/raidctl/raidctl.8 b/sbin/raidctl/raidctl.8 index 795ef13295b..3f38c6a43c4 100644 --- a/sbin/raidctl/raidctl.8 +++ b/sbin/raidctl/raidctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: raidctl.8,v 1.23 2002/02/18 22:57:05 tdeval Exp $ +.\" $OpenBSD: raidctl.8,v 1.24 2002/06/09 08:13:09 todd Exp $ .\" $NetBSD: raidctl.8,v 1.24 2001/07/10 01:30:52 lukem Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -114,7 +114,7 @@ will execute the requested action for all the configured .Xr raid 4 devices. .Pp -The command-line options for +The command-line options for .Nm are as follows: .Bl -tag -width indent @@ -125,7 +125,7 @@ as a hot spare for the device .Ar dev . .It Fl A Ic yes Ar dev Make the RAID set auto-configurable. The RAID set will be -automatically configured at boot +automatically configured at boot .Ar before the root file system is mounted. Note that all components of the set must be of type RAID in the @@ -135,21 +135,21 @@ Turn off auto-configuration for the RAID set. .It Fl A Ic root Ar dev Make the RAID set auto-configurable, and also mark the set as being eligible to be the root partition. A RAID set configured this way -will +will .Ar override the use of the boot disk as the root device. All components of the set must be of type RAID in the disklabel. Note that the kernel being booted must currently reside on a non-RAID set. .It Fl B Ar dev Initiate a copyback of reconstructed data from a spare disk to -its original disk. This is performed after a component has failed, +its original disk. This is performed after a component has failed, and the failed drive has been reconstructed onto a spare drive. .It Fl c Ar config_file Ar dev Configure the RAIDframe device .Ar dev according to the configuration given in -.Ar config_file . -A description of the contents of +.Ar config_file . +A description of the contents of .Ar config_file is given later. .It Fl C Ar config_file Ar dev @@ -179,10 +179,10 @@ or .Fl C . .It Fl i Ar dev Initialize the RAID device. In particular, (re-write) the parity on -the selected device. This +the selected device. This .Ar MUST -be done for -.Ar all +be done for +.Ar all RAID sets before the RAID device is labeled and before file systems are created on the RAID device. .It Fl I Ar serial_number Ar dev @@ -191,7 +191,7 @@ Initialize the component labels on each component of the device. is used as one of the keys in determining whether a particular set of components belong to the same RAID set. While not strictly enforced, different serial numbers should be used for -different RAID sets. This step +different RAID sets. This step .Ar MUST be performed when a new RAID set is created. .It Fl p Ar dev @@ -231,27 +231,27 @@ re-writing, and copybacks, provide a progress indicator. .Ss Configuration file The format of the configuration file is complex, and only an abbreviated treatment is given here. In the configuration -files, a +files, a .Sq # indicates the beginning of a comment. .Pp There are 4 required sections of a configuration file, and 2 -optional sections. Each section begins with a -.Sq START , +optional sections. Each section begins with a +.Sq START , followed by the section name, and the configuration parameters associated with that -section. The first section is the +section. The first section is the .Sq array section, and it specifies the number of rows, columns, and spare disks in the RAID set. For -example: +example: .Bd -unfilled -offset indent START array 1 3 0 .Ed .Pp indicates an array with 1 row, 3 columns, and 0 spare disks. Note -that although multi-dimensional arrays may be specified, they are +that although multi-dimensional arrays may be specified, they are .Ar NOT supported in the driver. .Pp @@ -269,28 +269,28 @@ START disks specifies the three component disks to be used in the RAID device. If any of the specified drives cannot be found when the RAID device is configured, then they will be marked as -.Sq failed , +.Sq failed , and the system will -operate in degraded mode. Note that it is +operate in degraded mode. Note that it is .Ar imperative that the order of the components in the configuration file does not change between configurations of a RAID device. Changing the order of the components will result in data loss if the set is configured -with the +with the .Fl C option. In normal circumstances, the RAID set will not configure if only .Fl c -is specified, and the components are out-of-order. +is specified, and the components are out-of-order. .Pp -The next section, which is the +The next section, which is the .Sq spare section, is optional, and, if -present, specifies the devices to be used as +present, specifies the devices to be used as .Sq hot spares -- devices which are on-line, but are not actively used by the RAID driver unless -one of the main components fail. A simple +one of the main components fail. A simple .Sq spare section might be: .Bd -unfilled -offset indent @@ -299,7 +299,7 @@ START spare .Ed .Pp for a configuration with a single spare component. If no spare drives -are to be used in the configuration, then the +are to be used in the configuration, then the .Sq spare section may be omitted. .Pp @@ -326,7 +326,7 @@ While certain values above 1 are permitted, a discussion of valid values and the consequences of using anything other than 1 are outside the scope of this document. The last value in this section (5 in this example) indicates the parity configuration desired. Valid entries -include: +include: .Bl -tag -width inde .It 0 RAID level 0. No parity, only simple striping. @@ -356,7 +356,7 @@ fifo 100 .Ed .Pp where the queuing method is specified as fifo (first-in, first-out), -and the size of the per-component queue is limited to 100 requests. +and the size of the per-component queue is limited to 100 requests. Other queuing methods may also be specified, but a discussion of them is beyond the scope of this document. .Pp @@ -364,7 +364,7 @@ The final section, the .Sq debug section, is optional. For more details on this the reader is referred to the RAIDframe documentation -discussed in the +discussed in the .Sx HISTORY section. @@ -381,14 +381,14 @@ with the use of and that they understand how the component reconstruction process works. The examples in this section will focus on configuring a number of different RAID sets of varying degrees of redundancy. -By working through these examples, administrators should be able to +By working through these examples, administrators should be able to develop a good feel for how to configure a RAID set, and how to initiate reconstruction of failed components. .Pp In the following examples .Sq raid0 -will be used to denote the RAID device. -.Sq /dev/rraid0c +will be used to denote the RAID device. +.Sq /dev/rraid0c may be used in place of .Sq raid0 . .Pp @@ -404,9 +404,9 @@ f: 1800000 200495 RAID # (Cyl. 405*- 4041*) .Ed .Pp While -.Dv FS_BSDFFS +.Dv FS_BSDFFS (e.g. 4.2BSD) will also work as the component type, the type -.Dv FS_RAID +.Dv FS_RAID (e.g. RAID) is preferred for RAIDframe use, as it is required for features such as auto-configuration. As part of the initial configuration of each RAID set, each component will be given a @@ -425,7 +425,7 @@ required for the auto-detection and auto-configuration of RAID sets at boot time. For a component label to be considered valid, that particular component label must be in agreement with the other component labels in the set. For example, the serial number, -.Sq modification counter , +.Sq modification counter , number of rows and number of columns must all be in agreement. If any of these are different, then the component is not considered to be part of the set. See @@ -433,10 +433,10 @@ not considered to be part of the set. See for more information about component labels. .Pp Once the components have been identified, and the disks have -appropriate labels, +appropriate labels, .Nm "" is then used to configure the -.Xr raid 4 +.Xr raid 4 device. To configure the device, a configuration file which looks something like: .Bd -unfilled -offset indent @@ -516,16 +516,16 @@ the RAID 5 case above. Note as well that RAID 1 sets are currently limited to only 2 components. At present, n-way mirroring is not possible. .Pp -The first time a RAID set is configured, the +The first time a RAID set is configured, the .Fl C option must be used: .Bd -unfilled -offset indent # raidctl -C raid0.conf raid0 .Ed .Pp -where +where .Sq raid0.conf -is the name of the RAID configuration file. The +is the name of the RAID configuration file. The .Fl C forces the configuration to succeed, even if any of the component labels are incorrect. The @@ -534,7 +534,7 @@ option should not be used lightly in situations other than initial configurations, as if the system is refusing to configure a RAID set, there is probably a very good reason for it. After the initial configuration is done (and -appropriate component labels are added with the +appropriate component labels are added with the .Fl I option) then raid0 can be configured normally with: .Bd -unfilled -offset indent @@ -551,19 +551,19 @@ parity on the RAID set. Initializing the component labels is done with: where .Sq 112341 is a user-specified serial number for the RAID set. This -initialization step is -.Ar required +initialization step is +.Ar required for all RAID sets. As well, using different -serial numbers between RAID sets is -.Ar strongly encouraged , +serial numbers between RAID sets is +.Ar strongly encouraged , as using the same serial number for all RAID sets will only serve to decrease the usefulness of the component label checking. .Pp Initializing the RAID set is done via the .Fl i -option. This initialization +option. This initialization .Ar MUST -be done for +be done for .Ar all RAID sets, since among other things it verifies that the parity (if any) on the RAID set is correct. Since this initialization may be @@ -583,7 +583,7 @@ Parity Re-write status: 10% |**** | ETA: 06:03 / .Ed .Pp -The output provides a +The output provides a .Sq Percent Complete in both a numeric and graphical format, as well as an estimated time to completion of the operation. @@ -594,7 +594,7 @@ part of RAID, it is critical that the parity is correct as much as possible. If the parity is not correct, then there is no guarantee that data will not be lost if a component fails. .Pp -Once the parity is known to be correct, +Once the parity is known to be correct, it is then safe to perform .Xr disklabel 8 , .Xr newfs 8 , @@ -631,13 +631,13 @@ fifo 100 /dev/sd0e is the real component, and will be the second disk of a RAID 1 set. The component /dev/sd6e, which must exist, but have no physical device associated with it, is simply used as a placeholder. -Configuration (using +Configuration (using .Fl C -and +and .Fl I Ar 12345 as above) proceeds normally, but initialization of the RAID set will have to wait until all physical components are present. After -configuration, this set can be used normally, but will be operating +configuration, this set can be used normally, but will be operating in degraded mode. Once a second physical component is obtained, it can be hot-added, the existing data mirrored, and normal operation resumed. @@ -685,11 +685,11 @@ Copyback is 100% complete. This indicates that all is well with the RAID set. Of importance here are the component lines which read .Sq optimal , -and the +and the .Sq Parity status line which indicates that the parity is up-to-date. Note that if there are file systems open on the RAID set, the individual components -will not be +will not be .Sq clean but the set as a whole can still be clean. .Pp @@ -781,7 +781,7 @@ Spares: Note that with the use of .Fl f a reconstruction has not been started. To both fail the disk and -start a reconstruction, the +start a reconstruction, the .Fl F option must be used: .Bd -unfilled -offset indent @@ -809,7 +809,7 @@ Copyback is 100% complete. .Ed .Pp This indicates that a reconstruction is in progress. To find out how -the reconstruction is progressing the +the reconstruction is progressing the .Fl S option may be used. This will indicate the progress in terms of the percentage of the reconstruction that is completed. When the @@ -831,7 +831,7 @@ Copyback is 100% complete. .Ed .Pp At this point there are at least two options. First, if /dev/sd2e is -known to be good (i.e. the failure was either caused by +known to be good (i.e. the failure was either caused by .Fl f or .Fl F , @@ -866,12 +866,12 @@ START drives .Ed .Pp This can be done as /dev/sd4e is completely interchangeable with -/dev/sd2e at this point. Note that extreme care must be taken when +/dev/sd2e at this point. Note that extreme care must be taken when changing the order of the drives in a configuration. This is one of the few instances where the devices and/or their orderings can be changed without loss of data! In general, the ordering of components -in a configuration file should -.Ar never +in a configuration file should +.Ar never be changed. .Pp If a component fails and there are no hot spares @@ -904,7 +904,7 @@ Reconstruction could then take place using .Fl F as describe above. .Pp -A second option is to rebuild directly onto /dev/sd2e. Once the disk +A second option is to rebuild directly onto /dev/sd2e. Once the disk containing /dev/sd2e has been replaced, one can simply use: .Bd -unfilled -offset indent # raidctl -R /dev/sd2e raid0 @@ -950,8 +950,8 @@ spare, the following could be done: # raidctl -F component1 raid0 .Ed .Pp -at which point the data missing from -.Sq component1 +at which point the data missing from +.Sq component1 would be reconstructed onto /dev/sd3e. .Pp .Ss RAID on RAID @@ -1008,7 +1008,7 @@ have become scrambled. Having a system's root file system .Pq Pa / on a RAID set is also allowed, -with the +with the .Sq a partition of such a RAID set being used for .Pa / . @@ -1022,12 +1022,12 @@ To return raid0a to be just an auto-configuring set simply use the arguments. .Pp .\" Note that kernels can only be directly read from RAID 1 components on -.\" alpha and pmax architectures. On those architectures, the +.\" alpha and pmax architectures. On those architectures, the .\" .Dv FS_RAID .\" file system is recognized by the bootblocks, and will properly load the -.\" kernel directly from a RAID 1 component. +.\" kernel directly from a RAID 1 component. .\" For other architectures, or -Note that kernels can't be directly read from a RAID component. +Note that kernels can't be directly read from a RAID component. To support the root file system on RAID sets, some mechanism must be used to get a kernel booting. For example, a small partition containing only the secondary boot-blocks and an alternate kernel (or two) could be @@ -1040,32 +1040,32 @@ as root devices. .Pp A typical RAID 1 setup with root on RAID might be as follows: .Bl -enum -.It +.It wd0a - a small partition, which contains a complete, bootable, basic .Ox -installation. +installation. .It wd1a - also contains a complete, bootable, basic .Ox installation. -.It +.It wd0e and wd1e - a RAID 1 set, raid0, used for the root file system. .It wd0f and wd1f - a RAID 1 set, raid1, which will be used only for -swap space. +swap space. .It wd0g and wd1g - a RAID 1 set, raid2, used for .Pa /usr , .Pa /home , or other data, if desired. -.It +.It wd0h and wd0h - a RAID 1 set, raid3, if desired. .El .Pp RAID sets raid0, raid1, and raid2 are all marked as auto-configurable. raid0 is marked as being a root file system. When new kernels are installed, the kernel is not only copied to -.Pa / , +.Pa / , but also to wd0a and wd1a. The kernel on wd0a is required, since that is the kernel the system boots from. The kernel on wd1a is also required, since that will be the kernel used should wd0 fail. The @@ -1074,7 +1074,7 @@ available, in the event that one of the drives fail. .Pp There is no requirement that the root file system be on the same disk as the kernel. For example, obtaining the kernel from wd0a, and using -sd0e and sd1e for raid0, and the root file system, is fine. It +sd0e and sd1e for raid0, and the root file system, is fine. It .Ar is critical, however, that there be multiple kernels available, in the event of media failure. @@ -1083,7 +1083,7 @@ Multi-layered RAID devices (such as a RAID 0 set made up of RAID 1 sets) are .Ar not supported as root devices or auto-configurable devices at this point. -(Multi-layered RAID devices +(Multi-layered RAID devices .Ar are supported in general, however, as mentioned earlier.) Note that in order to enable component auto-detection and auto-configuration of @@ -1124,7 +1124,7 @@ Distribution of components among controllers IO bandwidth .It file system access patterns -.It +.It CPU speed .El .Pp @@ -1151,13 +1151,13 @@ be calculated before the stripe is written, and then the stripe data and parity can be written in parallel. When the amount of data being written is less than a full stripe worth, the .Sq small write -problem occurs. Since a +problem occurs. Since a .Sq small write means only a portion of the stripe on the components is going to change, the data (and parity) on the components must be updated -slightly differently. First, the +slightly differently. First, the .Sq old parity -and +and .Sq old data must be read from the components. Then the new parity is constructed, using the new data to be written, and the old data and old parity. @@ -1171,7 +1171,7 @@ from the system will use exactly one large stripe write. As is seen later, there are some file system dependencies which may come into play here as well. .Pp -Since the size of a +Since the size of a .Sq large IO is often (currently) only 32K or 64K, on a 5-drive RAID 5 set it may be desirable to select a SectPerSU value of 16 blocks (8K) or 32 @@ -1181,8 +1181,8 @@ empirical measurement will provide the best indicators of which values will yeild better performance. .Pp The parameters used for the file system are also critical to good -performance. For -.Xr newfs 8 , +performance. For +.Xr newfs 8 , for example, increasing the block size to 32K or 64K may improve performance dramatically. As well, changing the cylinders-per-group parameter from 16 to 32 or higher is often not only necessary for @@ -1194,57 +1194,57 @@ Despite the length of this man-page, configuring a RAID set is a relatively straight-forward process. All that needs to be done is the following steps: .Bl -enum -.It -Use -.Xr disklabel 8 +.It +Use +.Xr disklabel 8 to create the components (of type RAID). -.It -Construct a RAID configuration file: e.g. -.Sq raid0.conf -.It -Configure the RAID set with: +.It +Construct a RAID configuration file: e.g. +.Sq raid0.conf +.It +Configure the RAID set with: .Bd -unfilled -offset indent # raidctl -C raid0.conf raid0 .Ed .Pp -.It -Initialize the component labels with: +.It +Initialize the component labels with: .Bd -unfilled -offset indent # raidctl -I 123456 raid0 .Ed .Pp -.It -Initialize other important parts of the set with: +.It +Initialize other important parts of the set with: .Bd -unfilled -offset indent # raidctl -i raid0 .Ed .Pp .It -Get the default label for the RAID set: +Get the default label for the RAID set: .Bd -unfilled -offset indent # disklabel raid0 > /tmp/label .Ed .Pp -.It -Edit the label: +.It +Edit the label: .Bd -unfilled -offset indent # vi /tmp/label .Ed .Pp -.It -Put the new label on the RAID set: +.It +Put the new label on the RAID set: .Bd -unfilled -offset indent # disklabel -R -r raid0 /tmp/label .Ed .Pp -.It -Create the file system: +.It +Create the file system: .Bd -unfilled -offset indent -# newfs /dev/rraid0e +# newfs /dev/rraid0e .Ed .Pp .It -Mount the file system: +Mount the file system: .Bd -unfilled -offset indent # mount /dev/raid0e /mnt .Ed @@ -1256,7 +1256,7 @@ Use: .Ed .Pp To re-configure the RAID set the next time it is needed, or put -raid0.conf into /etc where it will automatically be started by +raid0.conf into /etc where it will automatically be started by the /etc/rc scripts. .El .Pp diff --git a/sbin/raidctl/raidctl.c b/sbin/raidctl/raidctl.c index ca1e49266d0..57f2d8f3db7 100644 --- a/sbin/raidctl/raidctl.c +++ b/sbin/raidctl/raidctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raidctl.c,v 1.17 2002/03/31 13:12:09 tdeval Exp $ */ +/* $OpenBSD: raidctl.c,v 1.18 2002/06/09 08:13:09 todd Exp $ */ /* $NetBSD: raidctl.c,v 1.27 2001/07/10 01:30:52 lukem Exp $ */ /*- @@ -37,8 +37,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -/* - * This program is a re-write of the original rf_ctrl program +/* + * This program is a re-write of the original rf_ctrl program * distributed by CMU with RAIDframe 1.1. * * This program is the userland interface to the RAIDframe kernel @@ -133,7 +133,7 @@ main(argc, argv) force = 0; actionstr = NULL; - while ((ch = getopt(argc, argv, "a:A:Bc:C:f:F:g:GiI:l:r:R:sSpPuv")) + while ((ch = getopt(argc, argv, "a:A:Bc:C:f:F:g:GiI:l:r:R:sSpPuv")) != -1) switch(ch) { case 'a': @@ -193,7 +193,7 @@ main(argc, argv) serial_number = atoi(optarg); num_options++; break; - case 'l': + case 'l': action = RAIDFRAME_SET_COMPONENT_LABEL; strlcpy(component, optarg, PATH_MAX); num_options++; @@ -238,7 +238,7 @@ main(argc, argv) argc -= optind; argv += optind; - if ((num_options > 1) || (argc == NULL)) + if ((num_options > 1) || (argc == NULL)) usage(); strlcpy(name, argv[0], PATH_MAX); @@ -305,7 +305,7 @@ main(argc, argv) case RAIDFRAME_REWRITEPARITY: i = nfd; while (i--) { - do_ioctl(fds[i].fd, RAIDFRAME_REWRITEPARITY, NULL, + do_ioctl(fds[i].fd, RAIDFRAME_REWRITEPARITY, NULL, "RAIDFRAME_REWRITEPARITY"); } actionstr = "Parity Re-Write"; @@ -377,10 +377,10 @@ rf_configure(fds, config_file, force) cfg.force = force; - /* + /* * Note the extra level of redirection needed here, since - * what we really want to pass in is a pointer to the pointer to - * the configuration structure. + * what we really want to pass in is a pointer to the pointer to + * the configuration structure. */ generic = (void *) &cfg; @@ -432,14 +432,14 @@ rf_get_device_status(fds, nfd) printf("raid%d Components:\n", fds[i].id); for (j = 0; j < device_config.ndevs; j++) { - printf("%20s: %s\n", device_config.devs[j].devname, + printf("%20s: %s\n", device_config.devs[j].devname, device_status(device_config.devs[j].status)); } if (device_config.nspares > 0) { printf("Spares:\n"); for (j = 0; j < device_config.nspares; j++) { printf("%20s: %s\n", - device_config.spares[j].devname, + device_config.spares[j].devname, device_status(device_config.spares[j].status)); } } else { @@ -461,11 +461,11 @@ rf_get_device_status(fds, nfd) if (device_config.nspares > 0) { for(j=0; j < device_config.nspares; j++) { - if ((device_config.spares[j].status == + if ((device_config.spares[j].status == rf_ds_optimal) || - (device_config.spares[j].status == + (device_config.spares[j].status == rf_ds_used_spare)) { - get_component_label(&fds[i], + get_component_label(&fds[i], device_config.spares[j].devname); } else { printf("%s status is: %s. " @@ -554,8 +554,8 @@ rf_output_configuration(fds, nfd) "# sectPerSU SUsPerParityUnit SUsPerReconUnit " "RAID_level_%c\n", (char) component_label.parityConfig); - printf("%d %d %d %c\n", - component_label.sectPerSU, component_label.SUsPerPU, + printf("%d %d %d %c\n", + component_label.sectPerSU, component_label.SUsPerPU, component_label.SUsPerRU, (char) component_label.parityConfig); printf("\n"); @@ -595,14 +595,14 @@ get_component_number(fds, component_name, component_number, num_columns) } if (!found) { /* maybe it's a spare? */ for (i = 0; i < device_config.nspares; i++) { - if (strncmp(component_name, + if (strncmp(component_name, device_config.spares[i].devname, PATH_MAX) == 0) { found = 1; *component_number = i + device_config.ndevs; /* the way spares are done should really change... */ - *num_columns = device_config.cols + + *num_columns = device_config.cols + device_config.nspares; } } @@ -631,7 +631,7 @@ rf_fail_disk(fds, component_to_fail, do_recon) } else { recon_request.flags = RF_FDFLAGS_NONE; } - do_ioctl(fds->fd, RAIDFRAME_FAIL_DISK, &recon_request, + do_ioctl(fds->fd, RAIDFRAME_FAIL_DISK, &recon_request, "RAIDFRAME_FAIL_DISK"); if (do_recon && verbose) { printf("Reconstruction status:\n"); @@ -663,22 +663,22 @@ get_component_label(fds, component) printf("Component label for %s:\n", component); printf(" Row: %d, Column: %d, Num Rows: %d, Num Columns: %d\n", - component_label.row, component_label.column, + component_label.row, component_label.column, component_label.num_rows, component_label.num_columns); printf(" Version: %d, Serial Number: %d, Mod Counter: %d\n", component_label.version, component_label.serial_number, component_label.mod_counter); printf(" Clean: %s, Status: %d\n", - component_label.clean ? "Yes" : "No", + component_label.clean ? "Yes" : "No", component_label.status); printf(" sectPerSU: %d, SUsPerPU: %d, SUsPerRU: %d\n", - component_label.sectPerSU, component_label.SUsPerPU, + component_label.sectPerSU, component_label.SUsPerPU, component_label.SUsPerRU); printf(" Queue size: %d, blocksize: %d, numBlocks: %d\n", component_label.maxOutstanding, component_label.blockSize, component_label.numBlocks); printf(" RAID Level: %c\n", (char) component_label.parityConfig); - printf(" Autoconfig: %s\n", + printf(" Autoconfig: %s\n", component_label.autoconfigure ? "Yes" : "No"); printf(" Root partition: %s\n", component_label.root_partition ? "Yes" : "No"); @@ -733,7 +733,7 @@ init_component_labels(fds, serial_number) do_ioctl(fds->fd, RAIDFRAME_INIT_LABELS, &component_label, "RAIDFRAME_SET_COMPONENT_LABEL"); } - + static void set_autoconfig(fds, autoconf) fdidpair *fds; @@ -778,7 +778,7 @@ add_hot_spare(fds, component) hot_spare.row = 0; hot_spare.column = 0; - strlcpy(hot_spare.component_name, component, + strlcpy(hot_spare.component_name, component, sizeof(hot_spare.component_name)); do_ioctl(fds->fd, RAIDFRAME_ADD_HOT_SPARE, &hot_spare, @@ -799,7 +799,7 @@ remove_hot_spare(fds, component) hot_spare.row = component_num / num_cols; hot_spare.column = component_num % num_cols; - strlcpy(hot_spare.component_name, component, + strlcpy(hot_spare.component_name, component, sizeof(hot_spare.component_name)); do_ioctl(fds->fd, RAIDFRAME_REMOVE_HOT_SPARE, &hot_spare, @@ -882,9 +882,9 @@ check_parity(fds, nfd, do_rewrite) } else { i = nfd; while (i--) { - do_ioctl(fds[i].fd, - RAIDFRAME_CHECK_PARITYREWRITE_STATUS, - &percent_done, + do_ioctl(fds[i].fd, + RAIDFRAME_CHECK_PARITYREWRITE_STATUS, + &percent_done, "RAIDFRAME_CHECK_PARITYREWRITE_STATUS" ); if (percent_done == 100) { @@ -919,15 +919,15 @@ check_status(fds, nfd, meter) printf("raid%d Status:\n", fds[i].id); } do_ioctl(fds[i].fd, RAIDFRAME_CHECK_RECON_STATUS, - &recon_percent_done, + &recon_percent_done, "RAIDFRAME_CHECK_RECON_STATUS"); printf("Reconstruction is %d%% complete.\n", recon_percent_done); if (recon_percent_done < 100) { do_recon |= 1 << fds[i].id; } - do_ioctl(fds[i].fd, RAIDFRAME_CHECK_PARITYREWRITE_STATUS, - &parity_percent_done, + do_ioctl(fds[i].fd, RAIDFRAME_CHECK_PARITYREWRITE_STATUS, + &parity_percent_done, "RAIDFRAME_CHECK_PARITYREWRITE_STATUS"); printf("Parity Re-write is %d%% complete.\n", parity_percent_done); @@ -935,7 +935,7 @@ check_status(fds, nfd, meter) do_parity |= 1 << fds[i].id; } do_ioctl(fds[i].fd, RAIDFRAME_CHECK_COPYBACK_STATUS, - ©back_percent_done, + ©back_percent_done, "RAIDFRAME_CHECK_COPYBACK_STATUS"); printf("Copyback is %d%% complete.\n", copyback_percent_done); @@ -1044,7 +1044,7 @@ do_meter(fds, nfd, option) elapsed_sec--; } - elapsed = (double) elapsed_sec + + elapsed = (double) elapsed_sec + (double) elapsed_usec / 1000000.0; if (amount <= 0) { /* we don't do negatives (yet?) */ @@ -1058,14 +1058,14 @@ do_meter(fds, nfd, option) if (rate > 0.0) { simple_eta = (int) - (((double)progress_total - - (double) progress_completed) + (((double)progress_total - + (double) progress_completed) / rate); } else { simple_eta = -1; } - if (simple_eta <= 0) { + if (simple_eta <= 0) { simple_eta = last_eta; } else { last_eta = simple_eta; @@ -1081,7 +1081,7 @@ do_meter(fds, nfd, option) write(fileno(stdout), buffer, strlen(buffer)); fflush(stdout); - if (++tbit_value > 3) + if (++tbit_value > 3) tbit_value = 0; if (not_done) @@ -1117,7 +1117,7 @@ get_bar(string, percent, max_strlen) if (max_strlen > STAR_MIDPOINT) { max_strlen = STAR_MIDPOINT; } - offset = STAR_MIDPOINT - + offset = STAR_MIDPOINT - (int)((percent * max_strlen) / 100); if (offset < 0) offset = 0; diff --git a/sbin/raidctl/rf_configure.c b/sbin/raidctl/rf_configure.c index 198f5433c33..5d1bb0b91b9 100644 --- a/sbin/raidctl/rf_configure.c +++ b/sbin/raidctl/rf_configure.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rf_configure.c,v 1.8 2002/05/22 21:23:49 tdeval Exp $ */ +/* $OpenBSD: rf_configure.c,v 1.9 2002/06/09 08:13:09 todd Exp $ */ /* $NetBSD: rf_configure.c,v 1.14 2001/02/04 21:05:42 christos Exp $ */ /* @@ -67,7 +67,7 @@ #define ATTRIBUTE_UNUSED #endif -/* +/* * XXX we include this here so we don't need to drag rf_debugMem.c into * the picture... This is userland, afterall... */ @@ -152,7 +152,7 @@ int rf_get_next_nonblank_line(char *buf, int len, FILE *fp, * version of the driver, and in the user-level program that configures * the system via ioctl. */ -int +int rf_MakeConfig(configname, cfgPtr) char *configname; RF_Config_t *cfgPtr; @@ -310,7 +310,7 @@ out: /* used in architectures such as RAID0 where there is no layout-specific * information to be passed into the configuration code. */ -int +int rf_MakeLayoutSpecificNULL(fp, cfgPtr, ignored) FILE *fp ATTRIBUTE_UNUSED; RF_Config_t *cfgPtr; @@ -321,7 +321,7 @@ rf_MakeLayoutSpecificNULL(fp, cfgPtr, ignored) return(0); } -int +int rf_MakeLayoutSpecificDeclustered(configfp, cfgPtr, arg) FILE *configfp; RF_Config_t *cfgPtr; @@ -379,7 +379,7 @@ rf_MakeLayoutSpecificDeclustered(configfp, cfgPtr, arg) cfgPtr->layoutSpecificSize = RF_SPAREMAP_NAME_LEN + 6 * sizeof(int) + b * k; /* can't use RF_Malloc here b/c debugMem module not yet init'd */ - cfgBuf = (char *) malloc(cfgPtr->layoutSpecificSize); + cfgBuf = (char *) malloc(cfgPtr->layoutSpecificSize); cfgPtr->layoutSpecific = (void *) cfgBuf; p = cfgBuf; @@ -424,7 +424,7 @@ rf_MakeLayoutSpecificDeclustered(configfp, cfgPtr, arg) * utilities * ***************************************************************************/ - + /* finds a non-white character in the line */ char * rf_find_non_white(char *p) @@ -445,7 +445,7 @@ rf_find_white(char *p) * searches a file for a line that says "START string", where string is * specified as a parameter */ -int +int rf_search_file_for_start_of(string, buf, len, fp) const char *string; char *buf; @@ -468,7 +468,7 @@ rf_search_file_for_start_of(string, buf, len, fp) } /* reads from file fp into buf until it finds an interesting line */ -int +int rf_get_next_nonblank_line(buf, len, fp, errmsg) char *buf; int len ATTRIBUTE_UNUSED; |