Commit Graph

780 Commits

Author SHA1 Message Date
oster
7f102f3ada Use CFATTACH_DECL_NEW instead of CFATTACH_DECL... ICB wisdom
is that this will fix the config_devalloc panic.
2007-12-11 01:54:46 +00:00
ad
a0ca06de3d lockmgr -> mutex 2007-12-05 08:39:46 +00:00
jmcneill
13ca221015 aprintify 2007-12-01 18:10:48 +00:00
pooka
61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
oster
d5020b9a35 Nuke debugging output that is a) misleading at best, and
b) often just wrong.  Thanks to wiz for catching this.
2007-11-17 18:11:19 +00:00
yamt
b290d1aea3 don't include <sys/namei.h> unnecessarily. 2007-11-13 11:39:41 +00:00
oster
5bbb6a856e We need to initialize dk_driver as well. Thanks to Ronald Roskens
for reporting the problem and testing the fix.
2007-11-08 04:10:09 +00:00
oster
ba0b8a3b17 Implement support for drvctl in RAIDframe. Thanks to jnemeth@ for
initial patch.
2007-11-01 04:11:22 +00:00
ad
9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
ad
2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
oster
8b11ddb95c Implement dumping kernel cores to RAID 1 sets. The component used
for the dump is selected in this order of preference:
   1) the master
   2) a used_spare of the master
   3) the slave
   4) a used_spare of the slave
2007-10-05 01:40:04 +00:00
oster
6384685d7c Fix wording in a comment and correct a debug line. From Olivier Cherrier
(via private mail).  Thanks!
2007-09-21 17:14:47 +00:00
oster
46ae972f1b Make a couple of variables 64-bit quantities to avoid overflow issues
when arrays have a large number of stripes.  Remove unused variable
(recon_stripes_done).  Thanks to Dieter Roelants for the report,
suggestions, and testing.  Addresses PR#36878.
2007-09-16 02:13:35 +00:00
ad
eb171eaaa7 It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:50:17 +00:00
ad
1c0f1b255b Fix fallout from recent kthread changes. 2007-07-18 19:04:58 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
cube
954bc13440 Change dk_lookup() to accept an additional argument of the type enum uio_seg
that tells whether the given path is in user space or kernel space, so it
can tell NDINIT().

While the raidframe calls were ok, both ccd(4) and cgd(4) were passing
pointers to user space data, which leads to strange error on i386, as
reported by Jukka Salmi on current-users.

The issue has been there since last august, I'm actually a bit surprised
that no one in the meantime has used ccd(4) or cgd(4) on an arch where it
would have simply faulted.
2007-06-26 15:22:23 +00:00
christos
daebf0edfe don't leak a vnode in the wedge case. 2007-06-24 21:38:21 +00:00
christos
84c0a4321c Fix typo in print statement; from khorben 2007-03-13 16:31:24 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
oster
fb3988281d In the case of multiple RAID sets that are marked as root, attempt to
use the RAID set that contains the component used for booting.  Thanks
to manu@ for the main part of this.
2007-03-09 15:57:34 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
hubertf
eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
oster
f654b0f228 Change a bunch of "#if DEBUG" to "#ifdef DEBUG". 2006-11-30 23:01:50 +00:00
oster
212a5b65f4 If the user has specified 'root on foo', then skip changing the booted_device
even if we've detected a 'root on raid' autoconfigure.  This change is really
only cosmetic, since setroot() will still do the right thing and honor
the 'root on foo' setting.
2006-11-30 15:12:17 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
oster
04200d30df Remove unused variable. (Noted by mrg. Thanks.) 2006-10-09 02:43:28 +00:00
oster
89d18f0e72 Fix previous a different way. (pseudo_disk_init() needed to be called earlier) 2006-10-08 23:22:26 +00:00
christos
aa4e53f0e7 Call pseudo_disk_init in the autoconfig case. 2006-10-08 22:57:51 +00:00
oster
1d51ed695f Re-work some of the initialization code to now use config_attach_pseudo()
and friends.  Addresses PR#32881.  BOOT_FROM_RAID_HOOKS dies.
More simplification possible now.
2006-10-08 02:39:01 +00:00
oster
71b8d6a6de It's ok to wait for memory for the emergency buffers. If we don't get
that memory, fail harder, and bail on configuring the RAID array.
Addresses PR#25787.
2006-10-07 17:42:53 +00:00
oster
2992626c96 Revert previous change: Remove an unused variable declaration that was
(likely accidentally) added as the only change in the last commit.
2006-10-05 17:59:36 +00:00
tls
8cc016b4bc Protect calls to pool_put/pool_get that may occur in interrupt context
with spl used to protect other allocations and frees, or datastructure
element insertion and removal, in adjacent code.

It is almost unquestionably the case that some of the spl()/splx() calls
added here are superfluous, but it really seems wrong to see:

	s=splfoo();
	/* frob data structure */
	splx(s);
	pool_put(x);

and if we think we need to protect the first operation, then it is hard
to see why we should not think we need to protect the next.  "Better
safe than sorry".

It is also almost unquestionably the case that I missed some pool
gets/puts from interrupt context with my strategy for finding these
calls; use of PR_NOWAIT is a strong hint that a pool may be used from
interrupt context but many callers in the kernel pass a "can wait/can't
wait" flag down such that my searches might not have found them.  One
notable area that needs to be looked at is pf.

See also:

http://mail-index.netbsd.org/tech-kern/2006/07/19/0003.html
http://mail-index.netbsd.org/tech-kern/2006/07/19/0009.html
2006-10-05 17:35:19 +00:00
oster
ed4d175ee4 Make sure the 'last configured as' field in the component labels
are updated each time the component labels are written.
2006-09-28 02:39:50 +00:00
oster
f23a530674 Per a suggestion from Manuel, make numBlocks and partitionSize
unsigned for now.  This prevents rf_reasonable_label() from rejecting
a valid label when these fields have an integer overflow.  The reality
is that these need to be 64-bit quantities, but that will come later.
2006-09-05 01:55:21 +00:00
christos
df7450f605 Fix uninitialized variables. 2006-08-28 02:58:16 +00:00
christos
ecdff16f80 - use dk_lookup instead of our home-spun version.
- allow raid to be configured in a wedge
- allow wedges to be configured in a raid
- add autoconfiguration of wedges in a raid
2006-08-27 05:07:12 +00:00
christos
35ca6c8b5b Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
2006-08-17 17:11:27 +00:00
oster
803c52c2a4 sc_size should be a 64-bit quantity. Notice by Matthias Drochner. 2006-08-07 20:02:22 +00:00
oster
ff30fd25f5 Fix a minor typo in a comment. 2006-08-07 17:08:18 +00:00
ad
3029ac48c7 - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
2006-07-21 16:48:45 +00:00
oster
8c090abdfc Do the "don't allocate > 1K on the stack" thing for raidioctl(). 2006-06-12 22:49:35 +00:00
kardel
de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
oster
4fafa4cc7a un-bitrot some of this code (which is not included by default in kernels),
and make it build again.  XXX: Paritylogging bits still won't build.
2006-04-26 17:08:48 +00:00
christos
24f5b2aec3 Coverity CID 1127: Prevent NULL deref. 2006-04-14 22:43:12 +00:00
christos
4d098765d0 Turn on RAID KASSERTS if __COVERITY__ 2006-04-14 22:40:09 +00:00
simonb
ad09581b8e Don't access b_fspriv.bf_private in struct buf directly - use the
b_private macro.

OK'd by oster@
2006-04-12 23:33:39 +00:00
thorpej
d717ea85c2 Use device_is_a() and device_unit(). 2006-03-28 17:32:20 +00:00