Commit Graph

164 Commits

Author SHA1 Message Date
christos
8bfd5e3292 Fix uninitialized variable warnings 2003-10-25 18:34:14 +00:00
fvdl
2a11316bc0 Correct NULL abuse. 2003-10-21 00:22:04 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
thorpej
e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
dsl
d91455ce26 Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
2003-05-02 08:45:10 +00:00
simonb
d0f1ac2965 Remove an assigned-to but unused variable. 2003-04-10 03:36:02 +00:00
dsl
bd99e3429d Use 'void *' instead of 'caddr_t' in prototypes of VOP_IOCTL, VOP_FCNTL
and VOP_ADVLOCK, delete casts from callers (and some to copyin/out).
2003-03-21 23:11:19 +00:00
thorpej
eb14e86676 Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and
use it.  This fixes a few places where either b_dep or b_interlock were
not properly initialized.
2003-02-25 20:35:31 +00:00
pk
338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
thorpej
b193480908 Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
2003-02-01 06:23:35 +00:00
thorpej
b97e4c2136 Merge the nathanw_sa branch. 2003-01-19 16:50:16 +00:00
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