1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

Clean up some comments.

format_config: code preening.

vinum_scandisk: If we find a partition in the first pass over a drive,
note the fact so we don't grab the compatibility partition as well.

Submitted-by:  peter
This commit is contained in:
Greg Lehey 1999-08-16 05:08:46 +00:00
parent f856f90e8e
commit 0888504040
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49868

View File

@ -467,7 +467,7 @@ check_drive(char *devicename)
driveno = find_drive_by_dev(devicename, 1); /* if entry doesn't exist, create it */ driveno = find_drive_by_dev(devicename, 1); /* if entry doesn't exist, create it */
drive = &vinum_conf.drive[driveno]; /* and get a pointer */ drive = &vinum_conf.drive[driveno]; /* and get a pointer */
if (read_drive_label(drive, 0) == DL_OURS) { /* not ours */ if (read_drive_label(drive, 0) == DL_OURS) { /* one of ours */
for (i = 0; i < vinum_conf.drives_allocated; i++) { /* see if the name already exists */ for (i = 0; i < vinum_conf.drives_allocated; i++) { /* see if the name already exists */
if ((i != driveno) /* not this drive */ if ((i != driveno) /* not this drive */
&&(DRIVE[i].state != drive_unallocated) /* and it's allocated */ &&(DRIVE[i].state != drive_unallocated) /* and it's allocated */
@ -477,8 +477,9 @@ check_drive(char *devicename)
if (mydrive->devicename[0] == '/') { /* we know a device name for it */ if (mydrive->devicename[0] == '/') { /* we know a device name for it */
/* /*
* set an error, but don't take the drive down: * set an error, but don't take the
* that would cause unneeded error messages. * drive down: that would cause unneeded
* error messages.
*/ */
drive->lasterror = EEXIST; drive->lasterror = EEXIST;
break; break;
@ -528,19 +529,15 @@ format_config(char *config, int len)
vol = &vinum_conf.volume[i]; vol = &vinum_conf.volume[i];
if ((vol->state > volume_uninit) if ((vol->state > volume_uninit)
&& (vol->name[0] != '\0')) { /* paranoia */ && (vol->name[0] != '\0')) { /* paranoia */
snprintf(s,
configend - s,
"volume %s state %s",
vol->name,
volume_state(vol->state));
if (vol->preferred_plex >= 0) /* preferences, */ if (vol->preferred_plex >= 0) /* preferences, */
snprintf(s, snprintf(s,
configend - s, " readpol prefer %s",
"volume %s state %s readpol prefer %s",
vol->name,
volume_state(vol->state),
vinum_conf.plex[vol->preferred_plex].name); vinum_conf.plex[vol->preferred_plex].name);
else /* default round-robin */
snprintf(s,
configend - s,
"volume %s state %s",
vol->name,
volume_state(vol->state));
while (*s) while (*s)
s++; /* find the end */ s++; /* find the end */
s = sappend("\n", s); s = sappend("\n", s);
@ -918,6 +915,7 @@ vinum_scandisk(char *devicename[], int drives)
drivelist[gooddrives] = drive->driveno; /* keep the drive index */ drivelist[gooddrives] = drive->driveno; /* keep the drive index */
drive->flags &= ~VF_NEWBORN; /* which is no longer newly born */ drive->flags &= ~VF_NEWBORN; /* which is no longer newly born */
gooddrives++; gooddrives++;
founddrive++;
} }
} }
} }