Commit Graph

151 Commits

Author SHA1 Message Date
oster 9768cda12b Fix up locking on a call to rf_update_component_labels().
Noticed by Manuel.  Thanks Manuel!
2002-11-21 15:37:55 +00:00
oster 58ac277dd0 #if out some stuff that's only used for some distributed sparing stuff.
Shaves another 500 bytes from an i386 kernel.
2002-11-19 01:49:41 +00:00
oster 6ac4a184c4 For reconstructs, move checks for failed components to before the
kernel threads are created.
2002-11-19 01:45:28 +00:00
oster 7a58f70fb2 When setting root or autoconfig status, be sure to update used_spares too! 2002-11-17 22:41:36 +00:00
oster 35f6622aa7 These printf's have outlived their usefulness. *poof* 2002-11-15 03:00:12 +00:00
oster 56f6918fef rf_markalldirty() needs to update the mod_counter for used_spares too!
This bug appears as "incorrect Mod Counters" in 'raidctl -s'.  The
reason it was seen only in 'raidctl -s' is because of the conditions
needed to trigger the bug:
  a) a raid set is configured
  b) no partitions on that set are mounted or are otherwise in-use
  c) a component is failed, and subsequently rebuilt to a hot spare
  d) the machine is rebooted while something (e.g. 'raidctl -s') has
the device open (and, therefore, rf_markalldirty() has been called)
but before the final rf_update_component_labels() is done.

Needless to say, the window for this happening is *very* small, and it
was only because I was testing some obscure stuff that I even noticed it.
2002-11-14 17:11:54 +00:00
mrg 603098b9b5 implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
	- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
	when processing hw.diskstats, add the read&write bytes/transfers for
	the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail.  however, the next time this is
change it will not fail again.

this is just the kernel portion.
2002-11-01 11:31:50 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
oster 8bdc70d040 As part of the effort to get RAIDframe playing nicely with LOCKDEBUG,
rework how completed requests are handled.  In particular, instead of
doing all sorts of work and locking in interrupt context, completed
requests are now queued.  A new kernel thread (rf_RaidIOThread) now
handles calling rf_DiskIOComplete() and (req->CompleteFunc)() for each
completed request.  There is still work to be done to make RAIDframe
LOCKDEBUG friendly, but this change is a huge step forward.

Reviewed by (and many thanks to): thorpej
2002-10-04 20:05:14 +00:00
thorpej 2b99f7cc34 Add a generic config finalization hook, to be called once all real
devices have been discovered.  All finalizer routines are iteratively
invoked until all of them report that they have done no work.

Use this hook to fix a latent bug in RAIDframe autoconfiguration of
RAID sets exposed by the rework of SCSI device discovery.
2002-10-01 18:11:57 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej d1ad2ac4f2 Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver.  The cfdriver is then looked
up in a list which is built at run-time.
2002-09-27 02:24:06 +00:00
oster a8c038ad35 struct proc *p was only assigned to. Thanks Simon B. 2002-09-23 03:31:51 +00:00
oster f1529267b8 Make this build w/ DEBUG. 2002-09-23 03:28:41 +00:00
itojun 393f467c67 make it compile with DIAGNOSTIC 2002-09-23 03:17:36 +00:00
oster 7264a7cc8c RAIDGETBUF and RAIDPUTBUF were #defines that were only used in
one place.  Simplify things by removing them, and clean up more
unneeded instances of 'unit' and 'rs'.
2002-09-22 03:56:08 +00:00
oster fe654a583a rf_flags wasn't being used. *poof* 2002-09-22 03:46:40 +00:00
oster f99563a0ff A little housecleaning to nuke stuff that was unused. 2002-09-22 03:44:42 +00:00
oster 61da76cbbe #if 0 out one other function, and shuffle DEBUG code. Actually
reclaims another 14K!?!?!!  Thanks Krister!
2002-09-21 07:05:06 +00:00
oster 22f5e1b6bb Garbage collect some old mountroothook stuff. Thanks Krister! 2002-09-21 01:09:43 +00:00
oster f1113b29c2 Nuke old (and now incorrect) comment. 2002-09-19 17:55:22 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
oster 9c2db4ef79 Let's not bother poking CD's to see if they might have RAID sets
on them.
2002-08-07 20:45:39 +00:00
oster 522009f8a9 Nuke some unneeded #includes. 2002-08-04 03:27:04 +00:00
oster de6f092d9d RAIDframe doesn't need to be so chatty on autoconfigure. Leave it
a chatty if DEBUG is set... (for now..)
2002-07-24 02:55:22 +00:00
hannken 7de36862a8 Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.
2002-07-21 15:32:17 +00:00
hannken 856bd17f66 Convert to new device buffer queue interface. 2002-07-20 16:30:18 +00:00
oster 8fcfe433d8 No need to unlock and then immediately relock a mutex. 2002-07-13 17:47:44 +00:00
oster 38f0cae9e2 - don't be quite so chatty.
- if we need to print stuff, print out which raid device the information
is related to  (where applicable).
2002-07-13 17:24:41 +00:00
oster 73eaafcf06 As suggested by MRG, if we have an autoconfig set for root, we should
set booted_device, even if RB_ASKNAME is set.  That way the appropriate
device gets set as the default when it asks where you want to look for /.
2002-07-13 17:04:09 +00:00
leo 4fdfe6f24c Exclude the Atari/Milan floppy driver from being a RAID capable device. 2002-06-27 05:13:33 +00:00
leo c80fa51681 Not so fast... Add a bit of comment to the previous change. 2002-05-23 15:12:59 +00:00
leo 2ac118b51f Treat the "hdfd" (Atari/Hades floppy) like all the other "fd"s. OK-ed by
Greg Oster.
2002-05-23 15:03:33 +00:00
wiz 45bbb2368f bcopy -> memcpy. Reviewed by Greg Oster. 2002-05-22 15:40:47 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
thorpej bd4e2862b0 We only need a single component buffer pool. 2002-01-09 04:21:43 +00:00
oster 3b488c3f27 Fix an off-by-one error when autoconfig is hunting for a free RAID
device in the rare event that the one it wants is already in use.
Thanks to Wolfgang Stukenbrock for noticing the bug and filing the PR.
This fix addresses PR#14862.
2001-12-16 22:57:32 +00:00
lukem 371fd3fc10 use #ifdef RAID_AUTOCONFIG (for consistency with the rest of the kernel) 2001-11-28 05:39:13 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem a3746e00b7 add RCSIDs 2001-11-13 07:11:12 +00:00
oster 525f4a9bed Backout a line that accidentally got included when the .h reorg went in. 2001-10-06 00:47:46 +00:00
oster 765e00d3de Step 2 of the disentanglement. We now look to <dev/raidframe/*> for
the stuff that used to live in rf_types.h, rf_raidframe.h, rf_layout.h,
rf_netbsd.h, rf_raid.h, rf_decluster,h, and a few other places.
Believe it or not, when this is all done, things will be cleaner.

No functional changes to RAIDframe.
2001-10-04 15:58:51 +00:00
oster 99020323e6 Nuke the 5 NULL parameters from rf_DoAccess(). Observe that 4 of
the variables are passed directly to rf_AllocRaidAccDesc(), and the 5th
isn't even used.  Hunt them down and nuke them too.
2001-07-27 03:30:07 +00:00
thorpej cf56c44a86 bzero -> memset 2001-07-18 06:45:33 +00:00
oster 81f5c58b58 If we're closing the last partition on a RAID set and the system is
being shutdown, then unconfigure the RAID set too.  This fixes a number
of issues with doing proper unconfigures/shutdowns of multi-level RAID
sets.

Thanks to Jason Thorpe and Bill Squier for the ideas/suggestions on
how/where to do this, and to Bill Squier for testing.
2001-07-16 15:50:27 +00:00
oster bdfad3793f We don't need to check for raidautoconfig here, so nuke it and
clean up a little.
2001-06-21 03:07:04 +00:00
oster 856e0a920e A value of 1 for tracks/cylinder in the disklabel is apparently sub-optimal.
Thus we choose "4 * number_of_columns" as a more reasonable
value (until someone comes up with something better).
This pretends to properly address PR#11989.
2001-04-05 02:48:51 +00:00
oster cc2a28f2c0 Un-'__P'ify. 2001-01-27 20:42:20 +00:00
fvdl d040bd5908 Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
2001-01-08 02:03:45 +00:00
fvdl e2d1c1f926 Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
2001-01-07 18:09:01 +00:00