Commit Graph

689 Commits

Author SHA1 Message Date
oster b5e62ef069 As a LOCK_DEBUG kernel complains, we should really initialze
rf_tracing_mutex.
2004-02-29 23:10:58 +00:00
oster 4b8d5fc8b6 Unlock the mcpair mutex before we call rf_DispatchDAG(), and re-lock it once
we are back.  Makes things much happier on SMP boxen.  Problem noted
by SimonB. (Thanks!)
2004-02-29 23:03:30 +00:00
oster e9ec029612 Oops.. might still need this mutex in a few places. 2004-02-29 22:32:37 +00:00
oster 65ba8db490 Minor shuffling of variable declarations to clean RF_ACC_TRACE #defines
up a bit.  No functional changes.
2004-02-29 22:11:54 +00:00
oster 0d2f3606aa Add "RF_ACC_TRACE" as a new #define to rf_archs.h.
Use it to conditionalize some of the access tracing and tracerec bits.
Chops about 4 K off of an i386 GENERIC kernel.
2004-02-29 21:38:41 +00:00
oster cf01eb78b2 Minor comment reformatting. 2004-02-29 20:47:37 +00:00
oster d272af6ed2 When the 'if' condition is true, the function will return, so there
is no need for this chunk of code to be in the 'else' part.
Remove the 'else', and left-shift the code.

No functional changes.
2004-02-29 20:11:26 +00:00
oster 5a02af5b21 Adjust _rf_ShutdownCreate() so that it is willing to wait for more
memory.  Since we only now ever "return(0)", just return (void)
instead.

Cleanup all uses of rf_ShutdownCreate() to not worry about
it ever failing.  Shaves another 600 bytes off of an i386 GENERIC kernel.
2004-02-29 04:03:50 +00:00
oster da96c7f542 InitHdrNode() might as well return 'void'. Nothing ever pays attention
to what it returns anyway!
2004-02-29 01:50:23 +00:00
oster 4907fd699b rf_MakeAllocList() will always get memory. No point in checking for
a case that won't ever occur.
2004-02-29 01:49:13 +00:00
oster d4a8e64b16 We'd better have gotten a dag header from the pool. In any event, callers
arn't checking what we return anyway. (Cleanup memory allocations.)
2004-02-29 01:47:45 +00:00
oster 2e0cff190a TransferDagMemory() doesn't exist, so these lines are just wasting space. 2004-02-29 01:37:04 +00:00
oster 5e23bfcf9b Stripe functions are now handled by a linked-list instead of a
runtime-variable array.

Fix a bug where stripeFuncs was being freed, and then being used after
(in the case of numStripesBailed > 0).
2004-02-29 01:24:34 +00:00
oster 873f4a20f5 Add forgotten pool_destroy(). 2004-02-27 03:18:02 +00:00
oster 24099528e9 Use a dynamically allocated linked list of dagLists instead of using a
dynamically allocated variable-sized array (dagArray).  Convert code
to use the new linked list stuff instead of the array stuff (the ratio
of one dagList per stripe still applies).  The big advantage is in
being able to more efficiently allocate the dagLists on-the-fly, and
not have to know the size(s) of the array beforehand.
2004-02-27 02:55:17 +00:00
oster d3f3b25e8d Poolify alloclist stuff. Saves a whopping 32 bytes while decreasing code
complexity.
2004-02-25 02:15:52 +00:00
wiz f05e6f1a3a occured -> occurred. From Peter Postma. 2004-02-24 15:12:51 +00:00
oster 8bf9613af8 unlockQNodes, unlockDataNodes, and unlockParityNodes are not used. Turf. 2004-02-21 20:06:29 +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
oster b68ecaf95f Always ask for a new RF_StripeLockDesc_t "just in case", and then
give it back if we don't need it.  If we don't allocate it before
we take our lock, LOCKDEBUG (rightfully) complains that we're trying
to grab something from the pool with PR_WAITOK.  This code (and the
PR_WAITOK in particular) really needs to be revisited at some point.
2004-01-23 01:57:08 +00:00
oster 1a5bc3eb34 Add missing simple_lock_init(). Noted by skrueger-at-europe-dot-com. 2004-01-15 20:27:27 +00:00
oster 7ab3e4e2e3 Add 2 missing RF_LOCK_MUTEX()es. Problem pointed out by
skrueger-at-europe-dot-com.  (It turns out that the mutex used to
serve two different purposes, not just one, and for its current use,
it's actually miss-named.  Will fix that some other time.)
2004-01-14 15:10:55 +00:00
oster 6297e36a60 Since the LOCK and UNLOCK flags are never used, no need in extracting them.
Collapse the related variables down to zero.  That means 'flags' is 0
as well.  Nuke the extraction macros, a bunch of the variables, and replace
'flags' as well.
2004-01-10 17:04:44 +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
oster 2e19186660 iCleanup the RF_CREATE_PARAM3(). Middle two "arguments" were nothing
but 0 in all cases.
2004-01-10 00:56:27 +00:00
oster 5b7e949cbf More lu_flags disappear into oblivion. 2004-01-10 00:53:08 +00:00
oster 7edb3013bb Nuke lu_flag and code associated with it being non-zero.
The compiler already knew that these chunks of code
could never be reached (since lu_flag was always 0), so it
already ignored them.
No functional changes.
2004-01-09 23:35:59 +00:00
oster ac6b86acbb [This file should have been committed with the other
rf_enableAtomicRMW changes.]

Cleanup rf_enableAtomicRMW and its use.  According to the comments, we
can't set this to anything other than zero anyway.  Shaves off another
900 bytes.  lu_flag's days are numbered now, as are the middle
parameters of RF_CREATE_PARAM3.
2004-01-09 23:31:37 +00:00
oster 35d7c1ee7e Cleanup rf_enableAtomicRMW and its use. According to the comments, we
can't set this to anything other than zero anyway.  Shaves off another
900 bytes.  lu_flag's days are numbered now, as are the middle
parameters of RF_CREATE_PARAM3.
2004-01-09 23:26:17 +00:00
oster d9ff8342a0 Clean up a few comments, and improve code formatting somewhat.
Makes things a bit more readable.

No functional changes.
2004-01-06 03:27:13 +00:00
oster 181f2eebee remove terminate_disk_queues from RF_Raid_s. The hist_diskreq[]
stuff is only used for the CHAINDECLUSTERING, so hide it with an #if.
2004-01-05 01:19:07 +00:00
oster 290ef1fca7 raidPtr->reconControl->percentCompleted only gets used in one
debugging printf, and in rf_netbsdkintf.c.  We can do the calculations
inside of RF_DEBUG_RECON for the one debugging printf, and only
perform the percentCompleted calculation "on demand" in the
rf_netbsdkintf.c case.  Shaves a few more bytes off an i386 GENERIC
kernel, and ever-so-slightly decreases the amount of work performed
during a reconstruct.
2004-01-04 21:06:04 +00:00
oster 87e6ffb752 As noted by Thierry Deval in a posting to misc/at/openbsd.org,
rf_DecrAccessesCountState wasn't in the correct spot in
RF_AccessState_e.  Following up on that has resulted in one other
correction.  Changing orderings of these states is tricky, and
shouldn't be attempted without some thorough analysis.  For the
changes committed, the following analysis is offerred:

1) RAIDframe uses a little state machine to take care of building,
executing, and processing the DAGs used to direct IO.

2) The rf_DecrAccessesCountState state is handled by the function
rf_State_DecrAccessCount().  The purpose of this state is to
decrement the number of "accesses-in-flight".

3) rf_Cleanup_State is handled by rf_State_Cleanup().  Its job is to
do general cleanup of DAG arrays and any stripe locks.

4) DefaultStates[] in rf_layout.c indicates that the right spot
for rf_DecrAccessesCountState is just before rf_Cleanup_State.
Analysis of code for both states indicates that the order doesn't
matter too much, although rf_State_DecrAccessCount() should probably
take place *after* rf_State_Cleanup() to be more correct.

5) Comments in rf_State_ProcessDAG() indicates that the next state
should be rf_Cleanup_State.  However: it attempts to get there by using

 desc->state++;

which actually takes it to just rf_DecrAccessesCountState! This turned
out to be OK before, since rf_Cleanup_State would follow right after,
and all would be taken careof (albeit in arguably the "less correct"
order).

6) With the current ordering, if we head directly to rf_Cleanup_State
(as we do, for example, if multiple components fail in a RAID 5 set),
then we'll actually miss going trough rf_DecrAccessesCountState), and
could end up never being able to reach quiescence!  Perhaps not too
big of a deal, given that the RAID set is pretty much toast by that
point at which such a drastic state change happens, but might as well
have this correct.

The changes made are:
1) Since having rf_State_DecrAccessCount() come after
rf_State_Cleanup() is just fine, change rf_layout.c to reflect that
rf_DecrAccessesCountState comes after rf_Cleanup_State (i.e. they swap
positions in the state list).  This means that going to
rf_Cleanup_State after bailing on a failed DAG access will do all the
right things -- the state will get cleaned up, and then the access
counts will get decremented properly.  The comment in
rf_State_ProcessDAG() is now actually correct -- the next state *will*
be rf_Cleanup_State.

2) Move rf_DecrAccessesCountState in RF_AccessState_e to just after
rf_CleanupState.  This puts RF_AccessState_e in sync with
DefaultStates[].  Fortunately, these states are rarely referred to by
name, and so this change ends up being mostly cosmetic -- it really
only fixes cleanup behaviour for the recent "Failed to create a DAG"
changes.
2004-01-04 06:37:16 +00:00
oster 24b034a69e Fix the "We panic if we can't create a DAG" problem that's existed
~forever.  This requires a number of things:

1) If we can't create a DAG, set desc->numStripes to 0 in
rf_SelectAlgorithm.  This will ensure that we don't attempt to free
any dagArray[] elements in rf_StateCleanup.

2) Modify rf_State_CreateDAG() to not panic in the event of a DAG
failure.  Instead, set the bp->b_flags and bp->b_error, and set things
up to skip to rf_State_Cleanup().

3) Need to mark desc->status as "bad" so that we actually stop looking
for a different DAG.  (which we won't find... no matter how many times
we try).

4) rf_State_LastState() will then do the biodone(), and return EIO for
the IO in question.

5) Remove some " || 1 "'s from ProcessNode().  These were for
debugging, and we don't need the failure notices spewing
over and over again as the failing DAGs are processed.

6) Needed to change

       if (asmap->numDataFailed + asmap->numParityFailed > 1)

to

        if ((asmap->numDataFailed + asmap->numParityFailed > 1) ||
            (raidPtr->numFailures > 1)){

in rf_raid5.c so that it doesn't try to return
rf_CreateNonRedundantWriteDAG as the creation function.

7) Note that we can't apply the above change to the RAID 1 code as
with the silly "fake 2-D" RAID 1 sets, it is possible to have 2 failed
components in the RAID 1 set, and that would stop them from working.
(I really don't know why/how those "fake 2-D" RAID 1 sets even work
with all the "single-fault" assumptions present in the rest of the
code.)

8) Needed to protect rf_RAID0DagSelect() in a similar way -- it should
return NULL as the createFunc.

9) No point printing out "Multiple disks failed..." a zillion times.
2004-01-02 21:41:08 +00:00
hannken 897a1fc008 Remove "row" from DEBUG statements. 2004-01-02 11:52:15 +00:00
oster 5b70d1d979 Cleanup some unused desc->flags:
RF_DAG_RETURN_DAG
RF_DAG_RETURN_ASM
RF_DAG_TEST_ACCESS
and the code that goes with them.  A couple more of these
can probably go too, but I might need them in a bit.
2004-01-01 23:35:08 +00:00
oster f025a0425c Finally cleanup RF_BZERO. Turns out that 'bp' was only used to obtain
bp->b_proc for mapping userspace buffers to kernelspace in the
original rf_kintf.c.  That means bp isn't of any use in RF_BZERO()
for us, and the macro can be replaced with just the memset().

No functional changes.
2004-01-01 20:39:58 +00:00
oster da4ed88ce1 Tidy up the #includes a bit. 2004-01-01 19:37:17 +00:00
oster f2512ce061 Nuke a few more 'row'-related bits that were missed in the row-removal. 2004-01-01 19:32:55 +00:00
oster d3aa064253 Nuke a bunch of unused variables:
- node_queue_cond
 - quiescent_cond
 - eq_cond
 - desc->cond
 - desc->head
 - diskqueue->numWaiting

Nuke rf_print_unable_to_init_cond().
Nuke rf_TerminateDiskQueues prototype from rf_diskqueue.h.
2004-01-01 19:27:35 +00:00
oster 2c490b5588 Remove 3 unused debugging options:
RF_DBG_OPTION(accessTraceBufSize, 0)
RF_DBG_OPTION(disableAsyncAccs, 0)
RF_DBG_OPTION(suppressTraceDelays, 0)
2003-12-31 22:25:38 +00:00
oster 7ea5de8a08 Clean up a bunch of comments. 2003-12-31 17:47:53 +00:00
oster 7f9bbe325c Replace the DO_FREE() macro with just RF_Free(). No functional changes,
just less confusion.
2003-12-31 16:32:50 +00:00
oster 8ff567e586 Fix comments and make function declarations conform.
No functional changes.
2003-12-31 16:23:50 +00:00
oster a5c20197a4 Add in a bunch of RF_SIGNAL_COND()'s that were missing. Tidy up
a few lines.
2003-12-31 04:13:52 +00:00
oster abbecc25a2 Left-shift another else{} chunk. No functional changes. 2003-12-31 04:00:01 +00:00
oster b7bb3e3c62 left-shift the "else" part of the if(!lp_SubmitReconBuffer) condition.
Cleanup.  No real functional changes, just more readable.
2003-12-31 03:51:28 +00:00
oster 824f2ed930 Negate a condition, and flip if/else parts. Preparation for left-shifting
the (now) else part.  No real functional change.
2003-12-31 03:29:11 +00:00
oster 00515ece62 Remove a couple of incorrect comments. (rf_recon_req needs to be
passed to rf_ReconThread(), and there's no way around that for now.)
2003-12-31 03:02:57 +00:00
oster 4283fdd054 init_dqd and clean_dqd don't do enough to be their own functions,
and just serve to cause confusion.  Back-merge their contents to their
(only) calling spots and nuke them.
2003-12-31 02:47:58 +00:00
oster 7c465d22a7 Increase the scope of RF_DEBUG_PSS to cover a bit more stuff. 2003-12-31 00:42:46 +00:00
oster 4635d077cf nuke the 'bp' argument to rf_bxor and friends since it is no longer used.
In fact, bp was being set to "NULL" when passed rf_bxor() in
rf_parityscan.c:rf_VerifyParityBasic().
2003-12-31 00:00:06 +00:00
oster 6e2bbdfcc9 Very carefully remove REMAP_VA() macro. It's only doing a simple
assignement, and the 'bp' argument isn't used. (Guess what's going to
disappear next?)  No functional changes.
2003-12-30 23:40:20 +00:00
oster f5e96bf53e Nuke a forgotten 'row' from struct RF_PerDiskReconCtrl_s. 2003-12-30 23:23:17 +00:00
oster dd05ba5c10 sparediskids isn't used anywhere. turf. 2003-12-30 22:56:40 +00:00
oster 0b4f5c68b8 No point keeping 'pt' around. It's only ever assigned to. 2003-12-30 22:12:10 +00:00
oster 5a41c1d7ce rf_FreePDAList() and rf_FreeASMList() wern't using their l_end or
count arguments.  Nuke the unused args, and fix up callers and fn
prototypes.  Rename l_start arguments.
2003-12-30 22:11:14 +00:00
oster c43fc67d7d Some days you wonder if some of the function declaration consistency
was just an accident in the first place.  Cleanup function decls and
a few comments.  [ok.. so I wasn't going to fix this many.. but once
you're on a roll....]
2003-12-30 21:59:03 +00:00
oster 01635d963b Make function declarations consistent a) with each other and b) with
KNF.   Clean up comments.
2003-12-30 19:28:26 +00:00
oster 34ad01b703 Fix slight bogon from row removal. 'r' would have been 0 here, not 1,
which means r*raidPtr->numCol would have always been 0, not raidPtr->numCol.
2003-12-30 17:46:59 +00:00
oster ed1155b792 access_tracebuf is declared, allocated, and freed. No freeloading
datastructures allowed!  Punt.

accessTraceBufCount, rf_accessTraceBufSize, and
rf_stopCollectingTraces are similarly declared, initialized, and then
never changed.  Punt.

rf_ShutdownAccessTrace() now does nothing.  Remove it, and the
callback setup stuff from rf_ConfigureAccessTrace().
2003-12-30 17:29:41 +00:00
oster 5c71699f0b Clean up comments, and generally make more readable. No functional changes. 2003-12-29 17:13:36 +00:00
oster f7e3fe7a56 Clean up code/comments. No functional changes. Just a lot easier to read now. 2003-12-29 16:57:35 +00:00
oster 86c2a9ed65 The ugly wonderment of appropriately placed ASCII characters
formerly known as rf_threadstuff.c is no more.
2003-12-29 06:37:47 +00:00
oster ee0afdc3dc rf_lkmgr_mutex_init() is only called from one spot, and it really
can't fail.  Simplify life in rf_BootRaidframe(), and then nuke
rf_lkmgr_mutex_init().  Cleanup rf_threadstuff.h a bit more too.
rf_threadstuff.c is about to Go Away.
2003-12-29 06:30:42 +00:00
oster e276d553e6 Garbage-collect a whole mess of this RF_THREADGROUP_* stuff that isn't
being used.  Then, nuke rf_init_managed_threadgroup() and all
descendants and relations.
2003-12-29 06:19:28 +00:00
oster 8b09b35f45 Let's see... raidPtr->recon_done_procs is never set to anything
(other than NULL when raidPtr is initialized).  That means
SignalReconDone() never does anything useful.  Bye-bye!

Say good-bye to recon_done_procs and recon_done_procs_mutex (and its
initializer) as well.
2003-12-29 05:58:34 +00:00
oster 6a080d56e0 IO_BUF_ERR really doesn't need to be a macro. Replace the macro. 2003-12-29 05:52:58 +00:00
oster fc5966383f _rf_create_managed_cond() is now left doing nothing. Convert callers.
Mash DO_RAID_COND in rf_driver.c out of existance.

- Nuke (already #if 0'ed) _rf_create_managed_lkmgr_mutex() while we're
busy here.

simplify DO_INIT in rf_engine.c
2003-12-29 05:48:13 +00:00
oster 2f4066f82e cond_destroyer joins mutex_destroyer in the "nothing useful is done
here" department.

remove _rf_init_threadgroup() and rf_destroy_threadgroup() which were
already #if 0'ed.

rf_cond_destroy() does nothing.  Nuke it, and all callers.

rf_cond_init() doesn't deserve to be a separate function any more.
Fix up the remaining 3 callers, and nuke rf_cond_init().

Another 0.4K goes "poof", but still no functionality lost!
2003-12-29 05:36:19 +00:00
oster c629932636 _rf_create_managed_mutex() is doing just a simple:
rf_mutex_init(m)

now.  The rest of the fluff is no longer needed.
It also cannot fail, so error checking on rf_create_managed_mutex()
is just wasting space.

Nuke the #define's associated with rf_create_managed_mutex().
Convert rf_create_managed_mutex(listp,m) to just rf_mutex_init(m).
Remove wasteful "error checking" and simplify all instances where this
is called.  (another 0.3K saved in the binary, but the real savings
is in code readability!)
2003-12-29 05:22:16 +00:00
oster f7db986b43 mutex_destroyer() has been reduced to nothing. Turf it.
That means there is no point in having any of the shutdown stuff call
mutex_destroyer() on any of the mutexes.  Nuke related code.
2003-12-29 05:09:08 +00:00
oster 9a5cad32eb Since rf_mutex_destroy() is effectively a NOP now, nuke it. 2003-12-29 05:01:14 +00:00
oster b2b6428115 Simplify defn's of rf_mutex_init() and rf_mutex_destroy(). Since
neither of these ever fail, no need to have a return value.  That
makes all the "error detection" on these functions completely
unneeded.  But since we're here, if we don't have a return value, then
why not make these macros?  My.. look how things keep shrinking, with
no loss in functionality!
2003-12-29 04:56:26 +00:00
oster 99a9acd89d Reduce uses of rf_mutex_init() and rf_cond_init(). Streamlines code,
removes useless error detection, and generally makes things easier to follow.
2003-12-29 04:39:29 +00:00
oster c439c8a2c0 Tidy up a comment. 2003-12-29 04:34:36 +00:00
oster 46dd44132d init_mcpair() and clean_mcpair() are much like init_rad() and
clean_rad() were -- these days they only serve to clutter things up.
Remove the functions, and put the 2 lines of actual useful initialization
into rf_AllocMCPair().
2003-12-29 04:33:31 +00:00
oster c0a4bb0ea1 init_rad() and clean_rad() really do..... very little.. and only serve
to make things look far more complicated than they really are.  It was
also impossible for any of the mutex/cond initializations in
init_rad() to actually fail, making the "error detection code"
unneeded.  Collapse the little work done by init_rad into
rf_AllocRaidAccDesc(), and nuke init_rad() and clean_rad().  Save
another 0.25K in GENERIC.

[To be accurate/complete, init_rad() and clean_rad() *ARE* used in the
simulator version of RAIDframe.  But we're so far removed from that
now that there is no point pretending otherwise.]
2003-12-29 04:00:17 +00:00
oster f3e27c676e General format/comment cleanups. No functional changes. 2003-12-29 03:43:07 +00:00
oster 91c64aa051 Remove rf_freelist.h. Its contents are no longer needed. 2003-12-29 03:37:14 +00:00
oster ee19b085aa - first kick at a major reworking of RAIDframe's memory allocation code:
- all freelists converted to pools
  - initialization of structure members in certain cases where
	code was relying on specific allocation and usage properties
	to keep structures in a "known state" (that doesn't work with
	pools!).
  - make most pool_get() be "PR_WAITOK" until they can be analyzed
	further, and/or have proper error handling added.
  - all RF_Mallocs zero the space returned, so there is no difference
	between RF_Calloc and RF_Malloc.  In fact, all the RF_Calloc()'s
	do is tend to do is get things horribly confused.
	Make RF_Malloc() the "general memory allocator", with
	RF_MallocAndAdd() the "general memory allocator with
	allocation list".
  - some of these RF_Malloc's et al. are destined to disappear.
  - remove rf_rdp_freelist entirely (it's not used anywhere!)
  - remove: #include "rf_freelist.h"
  - to the files that were relying on the above, add: #include "rf_general.h"
  - add: #include "rf_debugMem.h" to rf_shutdown.h to make it happy
	about the loss of: #include "rf_freelist.h".

This shrinks an i386 GENERIC kernel by approx 5K.  RAIDframe now
weighs in at about 162K on i386.
2003-12-29 03:33:47 +00:00
oster 10f077a0fb [Having received a definite lack of strenuous objection, a small amount
of strenuous agreement, and some general agreement, this commit is
going ahead because it's now starting to block some other changes I
wish to make.]

Remove most of the support for the concept of "rows" from RAIDframe.
While the "row" interface has been exported to the world, RAIDframe
internals have really only supported a single row, even though they
have feigned support of multiple rows.

Nothing changes in configuration land -- config files still need to
specify a single row, etc.  All auto-config structures remain fully
forward/backwards compatible.

The only visible difference to the average user should be a
reduction in the size of a GENERIC kernel (i386) by 4.5K.  For those
of us trolling through RAIDframe kernel code, a lot of the driver
configuration code has become a LOT easier to read.
2003-12-29 02:38:17 +00:00
oster cdbecad002 (Although I want this code to Go Away, I might as well fix this bug for completeness)
If we don't have enough memory to allocate the pda freelist, make sure to
cleanup the asm freelist.
2003-12-21 19:36:31 +00:00
oster ad00b9c9b0 Since the 5th arg of pool_init() wasn't actually the number
of items with which to prime the pool, we now prime each
pool using pool_prime().
2003-12-21 15:56:20 +00:00
simonb 740725d725 Fix usage of fifth argument to pool_init(). 2003-12-21 07:53:58 +00:00
oster 3c778e952c infoFunc doesn't exist any more. Nuke commented out bits refering
to infoFunc.
2003-11-16 20:32:05 +00:00
simonb b6abb6ab1d Remove some assigned-to but otherwise unused variables. 2003-10-30 01:58:17 +00:00
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
simonb 59fb31d7cc Remove unreachable break after return and goto statements. 2003-10-19 01:44:48 +00:00
dsl 85b06a40e5 Let boot code include raidframe.h to get RF_PROTECTED_SECTORS. 2003-08-12 10:01:08 +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
oster 1121191d31 Actually toss the comment I said I was tossing in the last commit. 2003-07-01 23:53:48 +00:00
oster 556d051c14 - toss a comment that is no longer relevant.
- alist_mutex is a holdover from the simulator days, and it
wasn't even used back then.  Toss the variable and init/destroy calls.
2003-07-01 23:50:54 +00:00
oster 111c14e12c Minor cleanup. No functional changes. 2003-07-01 23:36:01 +00:00
oster ead7b02a99 Toss experimental versions of some functions that were already #if 0'ed. 2003-07-01 22:43:59 +00:00
oster 971e957065 UpdateNodeHdrPtr() isn't used anywhere. Turf. 2003-07-01 22:05:39 +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
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +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
oster 351bc1e187 Remember to close the component if we decide it's not suitable for use
as a hot spare.  Closes PR#20989 by David Brownlee.
2003-04-13 22:07:11 +00:00
simonb 40149dc0bb Remove an assigned-to but unused variable. 2003-04-10 04:11:50 +00:00
simonb 430903deae rf_MakeLockTable() and rf_ShutdownStripeLocks() are used only in
rf_stripelocks.c - make them static functions.
2003-04-10 04:10:17 +00:00
simonb d0f1ac2965 Remove an assigned-to but unused variable. 2003-04-10 03:36:02 +00:00
thorpej 24a4b8faa6 Use PAGE_SIZE rather than NBPG. 2003-04-09 00:28:28 +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
jdolecek e3c5d7b092 constify some 2003-02-09 10:04:32 +00:00
pk 338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
perry 1f4ad37fe3 "Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
2003-02-05 00:02:24 +00:00
tron f1eeaa9020 Only use MALLOC_DECLARE() in kernel namespace. 2003-02-01 18:34:14 +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
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
thorpej b97e4c2136 Merge the nathanw_sa branch. 2003-01-19 16:50:16 +00:00
junyoung 49f022f378 Fix typo. PR#19619. 2003-01-03 08:05:22 +00:00
oster 93e77ce121 Nuke all (but one) of the remaining RF_UTILITY's. 2002-11-23 02:44:14 +00:00
oster ceb8b43d54 Nuke some #if 0'ed code. 2002-11-23 02:38:59 +00:00
oster d8bae03774 One less goto. 2002-11-23 01:59:59 +00:00
oster a14698a359 Bye-bye to the completely unused reconCtrlPtr->priorityList. 2002-11-23 01:58:18 +00:00
oster 540f566858 rf_SelectMirrorDiskPartition() is only needed in a few cases. #if it
out in the rest.  Thanks to Krister!
2002-11-22 20:56:10 +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 61c0bdf3d3 #if 0 an unused function. Noted by Krister. Thanks! 2002-11-18 23:50:47 +00:00
oster b43d46d578 rf_DiskReadMirrorPartitionFunc() is only needed for some of the clustering
stuff, or if we're doing DAG validation.  Thanks to Krister!
2002-11-18 23:46: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 0cfd5a5b13 Cleanup more printfs. 2002-11-16 16:59:58 +00:00
oster c00752f98a Clean up error reporting, and nuke some printf verbosity. 2002-11-16 16:49:46 +00:00
oster ad8fd01bdf After a rebuild-in-place, a reconstruct, or a copyback, we should
really be updating the component labels.
2002-11-15 03:57:48 +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
oster f03dc09c94 Don't allow failing more than one component of a set, or
failing a component that has been spared, or "double-failing"
an already failed component.  XXX This isn't the right place to fix
this, but better here than no-where (and I'm hoping to move it sometime
soon).
2002-11-14 03:04:20 +00:00
oster bd2dd01d29 xorBufCount needs to be initialized too! 2002-11-12 00:01:32 +00:00
oster 1ac4be5d3e Nuke a printf() from rf_FailDisk(). 2002-11-09 19:50:03 +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
oster 661b040860 Poolify callback descriptor allocation. While some of the underlying
problems just get shuffled around a bit, we do play more nicely with
LOCKDEBUG now.
2002-10-25 03:14:37 +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 08933e5968 Better protect hot-spare adding, and make it LOCKDEBUG friendly. 2002-10-22 03:15:28 +00:00
oster 2eecfbf479 Improve and/or re-arrange a number of locks. While much of the locking is
still a mess, and there are a number of unresolved issues here, this
gets us closer to being happier in LOCKDEBUG land.
2002-10-18 02:46:36 +00:00
oster 4eb16a0a4f bye-bye to RF_FREELIST_GET_INIT_ARG and RF_FREELIST_FREE_CLEAN_ARG
whos services are no longer needed after poolification of PSS structures.
2002-10-11 02:15:57 +00:00
oster 9401ec32c0 poolify the allocation of Parity Stripe Status structures.
XXX: Current code may have problems if kernel memory is completely depleted.
This is, unfortunately, not the only chunk of RAIDframe code to have
this problem, and will have to be dealt with. :(
2002-10-11 02:10:08 +00:00
oster 16f8b30fa2 Minor comment and 80-column fixes. No functional changes. 2002-10-07 04:05:55 +00:00
oster 644e9151d0 poolify the RF_ReconMapListElem_t's used by rf_ReconMapUpdate().
Gives LOCKDEBUG kernels one less thing to complain about.
2002-10-06 18:49:12 +00:00
oster eb9d6f5ffa Add a missing RF_LOCK_MUTEX(). 2002-10-06 05:32:59 +00:00
oster 0567afd1cf Introduce a temp variable, and allocate the ReconCtrl structure before
we protect raidPtr.  One less thing for LOCKDEBUG to complain about.
2002-10-06 05:23:55 +00:00
oster 6108856337 update_size() does some bookkeeping, but nothing ever reads the data
it gathers.  Nuke it.  Without update_size, FreeReconMapListElem() can
do without mapPtr.  That, in turn, means crunch_list() doesn't need a
mapPtr either.
2002-10-05 22:45:46 +00:00
oster e29eccb29a RU_NIL is not used. Remove it. 2002-10-05 16:10:41 +00:00