Commit Graph

221 Commits

Author SHA1 Message Date
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 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
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
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
elad 2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +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
rtr 421623e0f4 free storage of clabel before bailing out.
coverity 2745 / run 11
2006-03-25 13:15:41 +00:00
simonb 92610d767b Use tabs instead of spaces with previous change. 2006-03-19 05:46:50 +00:00
david f16962165c Fix memory leaks when some components of a raid where missing during
autoconfig.

From Coverity CIDs 2328, 2324, 2323, 1125
2006-03-19 05:31:38 +00:00
oster 17ebfc7e6c Fix lossage related to device_is_a() changes. Fix from cube@ (thanks!).
Tested by me.
2006-03-01 21:41:49 +00:00
oster 7e6acfc4fe - minor comment cleanup
- nuke an extraneous memset() (RF_Malloc() already does that)
from RAIDFRAME_GET_INFO in raidioctl().
2006-02-24 03:20:22 +00:00
thorpej 58853410ae Use device_class() instead of accessing dv_class directly. 2006-02-21 04:32:38 +00:00
oster 0d6d84878e Really move all of the bp initalization bits into InitBP(). 2006-01-08 22:26:30 +00:00
oster 96c9402704 For the normal (read/write) case, do all the buffer initialization
inside of InitBP().
2006-01-08 22:06:26 +00:00
oster aad92944f5 Cleanup the initialization of buffers a bit, and remove some old code
that works around a bug that no longer exists.  From yamt. Thanks!
(a bit more cleanup to follow)
2006-01-08 21:53:26 +00:00
yamt 5bb3912ab6 raidstrategy: fix weird ENOSPC when reading from/writing to a raw partition. 2006-01-08 09:11:21 +00:00
yamt 5bca923bc4 raidioctl:
- don't ignore raidread_component_label error.
- remove an unnessesary memset.
2006-01-08 09:09:53 +00:00
oster 55da57e0c1 Remove the component buffer bits, now that I know there is a
"private" structure in struct buf that can be used to keep track of
the request associated with this buffer (the buffer used here is one
allocated from rf_CreateDiskQueueData(), so it's ours to do with what
we please).  Shrinks code a little, reduces the run-time memory
footprint a bit, and simplifies both rf_DispatchKernelIO() and
KernelWakeupFunc().

Thanks to yamt for his "why is rf_DispatchKernelIO using another buf"
question which prompted me to revisit this code.
2006-01-07 16:08:44 +00:00
oster 35f400bfd9 We need to mark used spares as failed if they encounter IO errors!
Commit fixes problem reported (privately) by Jeff Rizzo.


XXX: Note that we are still are unable to allow a reconstruct of
a failed spare -- it's easy enough to attempt to do it, but the
code in rf_ContinueReconstructFailedDisk() isn't anywhere close to
ready to allow it.  Yet another reason why the whole disk/spare thing
needs to be re-worked. *sigh*
2006-01-04 04:56:41 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
oster 96ba5552fa Re-work the handling of incoming I/O in RAIDframe:
- introduce rf_buf_queue_check() which checks to see if there
is work to do in the incoming buffer queue
- rf_RaidIOThread() is now responsible for calling raidstart(), and is
also now the only place that calls raidstart()
- raidstrategy() now just queues requests in buf_queue
and signals rf_RaidIOThread() that work has arrived

Hopefully addresses PR#30233
2005-09-25 19:47:17 +00:00
oster feaabee0c2 This disk_detach() should be pseudo_disk_detach(). 2005-09-24 22:51:55 +00:00
yamt bc505ef8dd use pseudo_disk_{init,attach,detach} where appropriate. 2005-08-20 12:01:04 +00:00
christos ba7574326e - avoid variable shadowing
- add a lot of const
- remove parameters from functin declarations
2005-05-29 22:03:09 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
oster 1f113cb32a Don't allow -f to fail a disk while a reconstruction is taking place
since that would cause a panic.  (Problem noticed by dan@.)
2004-11-17 01:34:10 +00:00
oster e8aee550dd Initialize parity_rewrite_stripes_done to remove the window where
bogus values could be returned at the start of parity rewriting.
2004-11-16 16:52:30 +00:00
oster d7e754c41d On an idea from Thor (tls@), do not fail a component if doing so would
render the RAID set completely dead.  Instead, we retry the IO a
maximum of RF_RETRY_THRESHOLD times (currently '5'), and then just
return an IO error if the IO fails.  This should reduce the damage
caused by having multiple disks appear to fail when the culprit is
really something else (power, controllers, etc.)
2004-11-16 16:45:51 +00:00
yamt 05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
thorpej fae7cbfa65 rf_find_raid_components():
- If DIOCGDINFO failed with ENOTTY, don't print an error message; wedges
  don't support that ioctl.  Clean up the error message.
- If DIOCGDINFO fails, don't proceed to examine an invalid disklabel
  structure.
2004-10-15 06:41:35 +00:00
oster 98af6adb1d The result of rf_DoAccess() should *not* be assigned to bp->b_error.
As well, when we do detect some sort of an error, we should be doing a
biodone() here.  Thanks to yamt for noting the missing biodone(), as
that led to discovery of the additional lossage.
2004-07-01 17:48:45 +00:00
itojun aca4c091d3 sprintf -> snprintf 2004-04-22 00:17:10 +00:00
oster f95359dd19 - Introduce rf_pools which contains all of the various global pools used
by RAIDframe.  Convert all other RAIDframe global pools to use pools
defined within this new structure.
- Introduce rf_pool_init(), used for initializing a single pool in
RAIDframe.  Teach each of the configuration routines to use
rf_pool_init().
- Cleanup a few pool-related comments.
- Cleanup revent initialization and #defines.
- Add a missing pool_destroy() for the reconbuffer pool.

(Saves another 1K off of an i386 GENERIC kernel, and makes
stuff a lot more readable)
2004-03-07 22:15:19 +00:00
oster 834d494bb2 - Introduce rf_pools which contains all of the various global pools used
by RAIDframe.  Convert all other RAIDframe global pools to use pools
defined within this new structure.
- Introduce rf_pool_init(), used for initializing a single pool in
RAIDframe.  Teach each of the configuration routines to use
rf_pool_init().
- Cleanup a few pool-related comments.
- Cleanup revent initialization and #defines.
- Add a missing pool_destroy() for the reconbuffer pool.

(Saves another 1K off of an i386 GENERIC kernel, and makes
stuff a lot more readable)
2004-03-07 21:57:44 +00:00
oster a0413593bc - remove the RF_*_INC's, as necessary. They are not needed any more.
- introduce RF_MIN_*'s, as necessary.  These will indicate the
low-water mark for pools as well as the pool_prime() value.
- add pool_setlowat() for the critical pools.
- pool_prime() and pool_setlowat() the raidframe_cbufpool.
- re-order some pool_prime()'s and pool_sethiwat()'s for clarity.
2004-03-05 02:53:55 +00:00
oster c7eaad6a14 Use RF_ACC_TRACE to #if out more chunks of code related only
to access tracing.  (not turned on yet)
2004-03-01 23:30:57 +00:00
oster 2eaec068c9 Relegate some printf's to DEBUG land. 2004-02-08 04:37:56 +00:00
hannken 3db4e2acd8 Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.
VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp)  Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp)      Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.
2004-01-25 18:06:48 +00:00
yamt 7266a95907 store a i/o priority hint in struct buf for buffer queue discipline. 2004-01-10 14:39:50 +00:00