Commit Graph

300 Commits

Author SHA1 Message Date
Greg Lehey
e7a1a7d809 Fix a problem with device number parsing, which caused da10 to map to
da1, and da11 to da2.

Reported by:  Dan Nelson <dnelson@emsphone.com>

Implicitly-approved-by:	 jkh
2000-03-02 07:46:10 +00:00
Greg Lehey
2903a30d77 Set default revive block size to 64 kB.
Implicitly-sanctioned-by:	jkh
2000-03-01 07:25:46 +00:00
Greg Lehey
c6dd6dd0d0 Tidy up splbio() protection.
Tidy up locking.  Previously we were taking two locks for a parity
block, and only releasing one of them.

Implicitly-sanctioned-by:	jkh
2000-03-01 07:25:07 +00:00
Greg Lehey
bd685df802 vinumstrategy: Don't count the read and written bytes before they're
transferred, do it in complete_rqe instead.

launch_requests: Replace the inadvertently removed splbio() around the
                 main loop.  It may not be necessary, but the biggest
                 test of this stuff are IDE disks, which I'm not
                 using.

                 Remove throttling code, I'm pretty sure it's not
                 needed any more.

		 Don't set B_ORDERED, it's not necessary either.

Objected-to-by: alfred

build_rq_buffer: Don't lose the B_ORDERED bit, it still has some
		 residual meaning.  To do this right, Vinum needs to
		 look at the B_ORDERED bit and order the transfer
		 across all disks involved.  That's an exercise for
		 another day.

Objected-to-by: alfred

Implicitly-sanctioned-by:	jkh
2000-03-01 07:24:26 +00:00
Greg Lehey
38a54177c5 Add keywords raid4 and partition.
Implicitly-sanctioned-by:	jkh
2000-03-01 07:23:40 +00:00
Greg Lehey
7d6abd1af3 complete_rqe: Handle volume read stats here with other objects.
Previously vinumstrategy counted the bytes before they were hatched,
giving rise to strangenesses when a read failed.

Implicitly-sanctioned-by:	jkh
2000-03-01 07:23:13 +00:00
Greg Lehey
2cd253ad0f Replace the preprocessor variable names BDEV_MAJOR and CDEV_MAJOR with
VINUM_BDEV_MAJOR and VINUM_CDEV_MAJOR respectively.

Set DRIVE_MAXACTIVE and VINUM_MAXACTIVE to 30000, effectively
disabling the request limitation code.  This code was added as an
attempt to escape from a bug which seems to have gone away, and it's
very likely I'll remove the code Real Soon Now, but I don't want to do
it just yet.

struct drive: Remove references to vnode pointers, including debug
output.  Vinum now talks directly to the device driver.  Instead, add
a dev_t.

enum plexorg: Add an instance for RAID-4.

Change checks for striped or RAID-5 plexes to a macro 'isstriped',
which now also includes RAID-4.

Change checks for RAID-5 plexes to a macro 'isparity', which now also
includes RAID-4.

Approved-by:  jkh
2000-02-29 06:17:26 +00:00
Greg Lehey
536aceefa2 plex_org: Add case for RAID-4.
Approved-by:  jkh
2000-02-29 06:16:44 +00:00
Greg Lehey
5823cef910 set_drive_state: update subdisk states more correctly.
set_sd_state: update the state of a subdisk in a multi-plex volume
more correctly.

update_plex_state: Bring the plex up correctly when the last subdisk
comes up.

checksdstate: Update comments.

vpstate: Don't return an "up" state on a degraded, unattached plex.

start_object: Return a sensible error message when trying to revive a
subdisk whose drive is down.  Previously it returned EBUSY.

Approved-by:  jkh
2000-02-29 06:16:06 +00:00
Greg Lehey
ea77bd8579 Fix horrible, embarrassing breakage which caused occasional panics and
data corruption.  It's a wonder it worked at all.

Led-on-the-right-path-by:  dillon

revive_block: Add treatment for RAID-4.

Add function parityrebuild, called by revive_block and parityops.

Approved-by:  jkh
2000-02-29 06:15:26 +00:00
Greg Lehey
25ac879b0c launch_requests: If too many requests are active, include PCATCH in
the tsleep call flags.

Submitted-by:  Bernd Walter <ticso@cicely.de>

Remove references to vnode pointers, including debug output.  Vinum
now talks directly to the device driver.

bre: Add case for RAID-4.

sdio: Don't try to write to a down drive.  Set the sd state instead.

Approved-by:  jkh
2000-02-29 06:14:44 +00:00
Greg Lehey
857b0d4e21 Add support for RAID-4. This is the only change which is needed for
RAID-4 support: the rest is just configuration management.

Requested-by:	peter
Approved-by:	jkh
2000-02-29 06:14:06 +00:00
Greg Lehey
e08bedf9bf Malloc: Save the caller's file name in the correct entry. 2000-02-29 06:13:24 +00:00
Greg Lehey
6992cfe973 Add keywords 'partition' and 'raid4'.
Approved-by:  jkh
2000-02-29 06:13:02 +00:00
Greg Lehey
74a2966a34 Modify comments to indicate that RAID-5 functions also apply to
RAID-4.

Approved-by:  jkh
2000-02-29 06:12:34 +00:00
Greg Lehey
e862b9e36a open_drive: open drives directly rather than going via namei and
vn_open.  This is necessary in order to be able to open drives before
the root file system is mounted.  This also involves restructuring the
drive struct, which no longer contains a vnode pointer.  Instead,
open_drive sets an open flag.  It's a horrible kludge, and I'll gladly
borrow a Danish axe and hack it in little pieces when devfs comes.

read_drive, write_drive, drive_io_done: Replace with driveio.  The
function names are now macros.

driveio: Fix horrible, embarrassing breakage which was the reason why
read_drive and write_drive existed in the first place.

Code-torn-to-shreds-by:  dillon

format_config: Don't save config of objects in referenced state.  They
get rebuilt automatically.

Change checks for striped or RAID-5 plexes to a macro 'isstriped',
which now also includes RAID-4.

Change checks for RAID-5 plexes to a macro 'isparity', which now also
includes RAID-4.

Replace the preprocessor variable names BDEV_MAJOR and CDEV_MAJOR with
VINUM_BDEV_MAJOR and VINUM_CDEV_MAJOR respectively.

vinum_scandisk: Don't free memory twice on error, once is enough.

Approved-by:  jkh
2000-02-29 06:11:13 +00:00
Greg Lehey
09ebc38020 Remove references to vnode pointers, including debug output. Vinum
now talks directly to the device driver.

Approved-by:  jkh
2000-02-29 06:10:21 +00:00
Greg Lehey
3e0311b705 Remove declarations of read_drive and write_drive and replace them
with macros.

Add declaration for parityrebuild, a new function.

Approved-by:  jkh
2000-02-29 06:09:41 +00:00
Greg Lehey
e435b3206e Add support for RAID-4, even though it is inferior in almost every way
to RAID-5.  peter claims that it might be faster for sequential
reading, since the drive caches don't trip over the parity blocks.  I
have seen no evidence to support this, but it's a trivial change.

Requested-by:	peter

Change checks for striped or RAID-5 plexes to a macro 'isstriped',
which now also includes RAID-4.

Change checks for RAID-5 plexes to a macro 'isparity', which now also
includes RAID-4.

atoi(): Remove, nobody was talking to it.

give_sd_to_drive: If no space is available, make the subdisk down,
don't delete it.

Change the manner in which the subdisk count was maintained to avoid
cases where the count was not adjusted correctly.

config_drive: Check if we have subdisks referencing us, and add them
if so.  This fixes problems which arose when a drive is replaced in a
running system.

config_sd: Add support for a keyword 'partition', whose meaning will
	   be revealed in the fullness of time.

Cosmetic: Shorten some console messages.

Approved-by:  jkh
2000-02-29 06:08:33 +00:00
Greg Lehey
7a7d8290f0 Change the startup sequence of the vinum volume from SI_SUB_DRIVERS
to SI_SUB_VINUM, thus making it possible for Vinum to access I/O
devices and start.

Replace the preprocessor variable names BDEV_MAJOR and CDEV_MAJOR with
VINUM_BDEV_MAJOR and VINUM_CDEV_MAJOR respectively.

Style fixes: replace NULL with 0 where appropriate.

Submitted-by: Charlie Root <root@sms-1.follo.net> (yup, that's all I
	      have to go on).

Approved-by:	jkh
2000-02-29 06:07:39 +00:00
Greg Lehey
cb357bf915 Cosmetic changes.
Approved-by:	jkh
2000-02-29 06:07:01 +00:00
Poul-Henning Kamp
ba4ad1fcea Give vn_isdisk() a second argument where it can return a suitable errno.
Suggested by:	bde
2000-01-10 12:04:27 +00:00
Alfred Perlstein
a9dd30b96b revision 1.40 backed out the removal of PCATCH in a tsleep allowing
an infinite loop if a signal is delivered here.
remove it again, this still ought to be revisited as the error should
probably be returned.
2000-01-10 10:24:47 +00:00
Greg Lehey
b51b6b8a7b Don't tsleep with PCATCH, it's a wonderful way to hang the system.
Reported-by:	Bernd Walter <ticso@cicely.de>
2000-01-05 22:59:36 +00:00
Greg Lehey
3bd2a0a10c Add missing header file.
Not-reported-by:	peter
2000-01-05 22:58:39 +00:00
Greg Lehey
ffa258b0aa Explicitly type large scalar parameters to avoid compilation warnings
on alpha.

Submitted-by:	      Bernd Walter <ticso@cicely.de>

struct sd: Add a field for the pid of the reviver when the subdisk is
reviving.

Replace block device macros with generalized device macros.
2000-01-05 06:13:01 +00:00
Greg Lehey
a7482aa7d5 When attaching a plex to a volume with 'up' subdisks, make the plexes
subdisks 'stale', not 'reviving'.
2000-01-05 06:12:25 +00:00
Greg Lehey
b110a1e60b Correct printf format for pointers to avoid compilation warnings on
alpha.

Explicitly type large scalar parameters to avoid compilation warnings
on alpha.

Submitted-by:	      Bernd Walter <ticso@cicely.de>

Make better checks that the revive block size is valid, silently set
it to the defaults if not.

Replace block device macros with generalized device macros.
2000-01-05 06:11:46 +00:00
Greg Lehey
0ea9d6fbc7 Correct printf format for pointers to avoid compilation warnings on
alpha.

Modify the manner in which we lock RAID-5 plexes.  This appears to
solve some of the elusive panics we have seen with corrupted buffer
headers (specifically the zeroed-out b_iodone field).

Submitted-by:	      Bernd Walter <ticso@cicely.de>
2000-01-05 06:10:52 +00:00
Greg Lehey
984e8b9ada Modify the manner in which we lock RAID-5 plexes. This appears to
solve some of the elusive panics we have seen with corrupted buffer
headers (specifically the zeroed-out b_iodone field).

Submitted-by:	      Bernd Walter <ticso@cicely.de>
2000-01-05 06:09:43 +00:00
Greg Lehey
dbd8153d5e Change the name of the define 'SPACETAB' (originally 'isspace') to
'iswhite'.  The original change was required because of name
conflicts.

Add key pairs for the keywords 'mv' and 'move' (part of the move
command).

Add comments.
2000-01-05 06:08:55 +00:00
Greg Lehey
5b58d7c1a2 Include basename() function even if the system isn't i386.
Correct printf format for pointers to avoid compilation warnings on
alpha.

Submitted-by:	      Bernd Walter <ticso@cicely.de>
2000-01-05 06:08:23 +00:00
Greg Lehey
a86a06a0b5 Add the keywords 'mv' and 'move'. 2000-01-05 06:07:59 +00:00
Greg Lehey
5756902abc Add function moveobject, which currently moves subdisks to different
drives.  This function just does the low-level configuration changes;
the resultant subdisk is stale if it previously had any contents,
otherwise it is empty (i.e. in need of initializing if it's RAID-5).
We still need to handle getting the contents moved over, but the
current version will suffice to migrate subdisks from a disk which has
failed.

Submitted-by:  Marius Bendiksen <marius@marius.scancall.no>
2000-01-05 06:07:26 +00:00
Greg Lehey
233fb3be1e Add VINUM_MOVE ioctl.
Fix transfer lengths for some ioctls.

Rearrange file: put structs first, then ioctl requests.
2000-01-05 06:06:01 +00:00
Greg Lehey
f54047e7f4 Explicitly type large scalar parameters to avoid compilation warnings
on alpha.

Submitted-by:	      Bernd Walter <ticso@cicely.de>

Remove #include of vm/vm_zone.h.

Submitted-by:	Someone, I'm sure, but I seem to have lost the
		attribution.  Sorry.

Get the check for disk devices correct, and return an appropriate
message if the check fails.
2000-01-05 06:05:33 +00:00
Greg Lehey
3999d58378 Add declaration for give_sd_to_drive, needed for the 'move' command. 2000-01-05 06:04:17 +00:00
Greg Lehey
7da7966a73 Set P_SYSTEM in the daemon proc structure to alleviate delays on
shutdown.

Submitted-by:	Alfred Perlstein <bright@wintelcom.net>

Correct printf format for pointers to avoid compilation warnings on
alpha.

Submitted-by:	Bernd Walter <ticso@cicely.de>

Identify daemon as 'vinum', not 'vinumd', in messages.  This
corresponds to the name in ps.
2000-01-05 06:03:56 +00:00
Greg Lehey
140c8af97a Explicitly type large scalar parameters to avoid compilation warnings
on alpha.

Submitted-by:	      Bernd Walter <ticso@cicely.de>

Get parameters right for some error messages returned via
throw_rude_remark().

Fix typo in comment.

Remove the 'static' attribute from give_sd_to_drive.  This is needed
for the implementation of moveobject() in vinumioctl.c.
2000-01-05 06:02:57 +00:00
Greg Lehey
6bfed0f9c0 Don't forget the 'stripe' and 'mirror' keywords when we turn debugging
off.

Reported-by:	ppyy <ppyy@bentium.com>
1999-12-30 07:13:22 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Eivind Eklund
762e6b856c Introduce NDFREE (and remove VOP_ABORTOP) 1999-12-15 23:02:35 +00:00
Poul-Henning Kamp
b9fcd4a616 Look for disk devices rather than bdevs.
Approved by:	grog
1999-12-12 17:43:12 +00:00
Poul-Henning Kamp
7d5961670c Remove BAD144 support, it has already been disabled for some time. 1999-12-08 09:33:00 +00:00
Alfred Perlstein
1c01270e7a remove PCATCH from a tsleep that isn't checked for (avoid infinite loop).
this needs to be revisited.
1999-11-18 08:57:03 +00:00
Greg Lehey
4e449fe462 Emergency fix to stop world breakage.
Broken-by:	archie
1999-11-03 20:04:00 +00:00
Archie Cobbs
2ea6270424 Change isspace() macro name to avoid conflict. 1999-11-02 22:42:56 +00:00
Greg Lehey
5c920f6765 sdio_done:
Set the errors in the correct buffer header.

Inspection-provoked-by: Bernd Walter <ticso@cicely.de>
1999-10-17 23:56:47 +00:00
Greg Lehey
54cd2d3309 launch_requests:
Put splbio protection around the main launch loop.  We've seen cases where
  the bottom half was cutting off the branch on which we're sitting.

Experienced-by: Michael Reifenberger <root@nihil.plaut.de>
1999-10-17 23:55:10 +00:00
Greg Lehey
553faec194 Remove reference to obsolete initsd function.
This should have been committed yesterday.

Broke-world-for:	USW2 Root <root@usw2.freebsd.org>
1999-10-13 23:00:30 +00:00