summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Move the block get/put routines into the common code, instead of havingjsing2014-01-181-1/+13
| | | | RAID 6 borrow them from RAID 5.
* Rename softraid RAIDP to softraid RAID5.jsing2014-01-181-2/+2
| | | | Discussed with krw@
* Remove the RAID 4 discipline from softraid. Anyone sensible would use RAIDjsing2014-01-181-4/+1
| | | | | | 5 instead of RAID 4, assuming both were functional. Discussed with krw@
* On some architectures you can get away with using an uninitialised mutex;jsing2014-01-051-2/+2
| | | | | | | this is not the case on hppa (practically the only architecture where unlocked has a non-zero value). This one has been hiding since r1.223... Found the hard way by juanfra@
* Print daddr_t's with %lld, size_t's with %zu, int's with %d andkrw2013-11-191-18/+21
| | | | | | | | | u_int32_t's with %u. Translate DL_GETPSIZE() results to 512-byte-block values with DL_SECTOBLK(). ok jsing@
* substantial namespace cleanup. Might go a little bit too far, but wederaadt2013-11-041-1/+2
| | | | | can expose some of the kernel structures with split .h files if need be. Discussed with various, including jsing.
* Sprinkle (long long) casts where %lld is being used to print daddr_tkrw2013-11-011-8/+10
| | | | | | variables. Some random whitespace/knf repairs encountered on the way. ok miod@ on inspection, feedback & more suggestions from millert@
* Don't use uninitialized variable when a simple 0 will do.krw2013-07-191-2/+2
| | | | | | Found by Maxime Villard. ok jsing@
* When an I/O error occurs on a softraid chunk, only take it offline if thejsing2013-07-011-3/+5
| | | | | | | | discipline supports redundancy. In the non-redundant case, there is little to gain my failing the chunk, in fact it just makes any form of data recovery significantly harder. ok krw@ todd@
* final removal of daddr64_t. daddr_t has been 64 bit for a long enoughderaadt2013-06-111-16/+16
| | | | | test period; i think 3 years ago the last bugs fell out. ok otto beck others
* Ensure that sc_lock is held when calling sr_meta_native_bootprobe() - thejsing2013-05-211-2/+6
| | | | | | softraid status functions will complain otherwise. Found the hard way by ajacoutot@
* sr_raid_startwu() is no longer called from interrupt context, hence doesjsing2013-05-211-25/+13
| | | | not need to invoke a workq-based callback.
* Provide a function that handles the scheduling of work units. Thisjsing2013-05-211-42/+58
| | | | | | | simplifies the discipline code, avoids code duplication and moves the scheduling logic into a single location. ok krw@
* Make the sr_raid_startwu() function handle deferred work units, instead ofjsing2013-05-211-11/+7
| | | | the caller having to handle the state changes.
* Fix missing work unit state initialisations.jsing2013-05-211-1/+2
|
* Use a state to indicate that a work unit should only be constructed and notjsing2013-05-211-1/+3
| | | | scheduled, rather than trying to imply this from the rebuild flag.
* Add a SR_WUF_DISCIPLINE flag that identifies work units that have resultedjsing2013-04-261-5/+16
| | | | | from discipline specific I/O. Such work units are not associated with a SCSI xfer and are returned via sr_wu_put() on completion.
* Rename ccb_flag to ccb_flags.jsing2013-04-231-3/+3
|
* Convert RAID1 to the new work unit completion functions and genericjsing2013-04-211-9/+23
| | | | | | | | | interrupt handler. Disciplines such as RAID1/4/5/6 need a way to intercept I/O when the work unit is complete, but before the SCSI xfer is complete. This is provided via a sd_scsi_wu_done hook, which enables work units to be restarted or otherwise modified before the SCSI xfer completion occurs. ok krw@
* Use the discipline name instead of the product string when reporting thejsing2013-03-311-2/+2
| | | | attachment.
* The return value of sd_free_resources() is never checked and all of thejsing2013-03-311-5/+3
| | | | | implementations only ever returned zero. Change the return value from int to void instead of pretending it might mean something.
* Fix compilation with debug.jsing2013-03-311-3/+3
|
* Provide default resource allocation and free functions. Convert alljsing2013-03-311-3/+29
| | | | disciplines except for AOE and CRYPTO, which require custom handlers.
* Provide wrappers for scsi_io_get() and scsi_io_put(), that also includejsing2013-03-301-10/+21
| | | | | | the sd_sync check/wakeup. Remove some unnecessary NULL checks whilst here. ok krw@
* Provide a default discipline interrupt handling function and migrate all ofjsing2013-03-301-2/+22
| | | | | | the disciplines that now have the same interrupt code. ok krw@
* Decouple wakeups on work unit completion from the type of I/O beingjsing2013-03-291-2/+2
| | | | | | performed. ok krw@
* sd_wu_pending is only decremented when scsi_done() or scsi_io_put() arejsing2013-03-291-11/+11
| | | | | | | | | called. As a result, factor out the the sd_sync check/wakeup code and move it to after the scsi_done() call in sr_scsi_done(). Perform the same sd_sync check/wakeup after scsi_io_put() calls (including the addition of some that were previously missed). ok krw@
* Factor out the code that is used to recreate work units - one copy of thejsing2013-03-251-1/+23
| | | | | | code is sufficient. ok krw@
* Rename sc_dis to sc_targets, since it is an array of targets that alsojsing2013-03-101-10/+10
| | | | | | happen to be softraid disciplines. ok krw@
* Track attached softraid disciplines via a queue. This prevents the need tojsing2013-03-051-135/+100
| | | | | | | | scan the sparse SCSI targets array and simplifies code. Disciplines are now also shutdown in reverse attach order, making manually stacked softraid volumes somewhat more practical. ok krw@
* The workunit completion needs to run at IPL_BIO, at least for now.jsing2013-01-181-6/+11
|
* Tweak workunit completion.jsing2013-01-181-11/+17
|
* Implement common workunit completion functions and handle the completionjsing2013-01-181-1/+57
| | | | | | | via a workq callback. Also provide a discipline specific hook that allows it to optionally handle the final part of the workunit completion. ok krw@
* Reset I/O counters when releasing ccbs.jsing2013-01-181-1/+6
| | | | ok krw@
* Add a function that handles the completion of a ccb.jsing2013-01-161-1/+37
| | | | ok krw@
* Set resid to zero if the scsi transfer completed without error.jsing2013-01-161-1/+4
| | | | ok krw@
* Factor out code used to release ccbs from a workunit.jsing2013-01-161-9/+18
| | | | ok krw@
* Implement a function that gets and correctly initialises a ccb for I/O,jsing2013-01-151-2/+65
| | | | | | along with a function that enqueues a ccb on a workunit. ok krw@
* Keep a function pointer to the per-discipline I/O interrupt handler in thejsing2013-01-151-1/+2
| | | | discipline data structure. To be used with an upcoming diff.
* Factor out workunit initialisation code.jsing2013-01-151-44/+36
| | | | ok krw@
* Provide a mechanism for the kernel to directly pass a mask key through tojsing2012-10-091-2/+11
| | | | a crypto volume when it is assembling it.
* Provide a mechanism for the kernel to pass data through to the disciplinejsing2012-10-081-6/+8
| | | | during volume assembly.
* Change handling for volumes that are marked no-auto assemble. If we bootedjsing2012-10-081-19/+23
| | | | | from the given volume ignore the no-auto assemble flag, since the root file system is located on it.
* bzero the right variable.jsing2012-10-081-2/+2
|
* Prevent softraid from being used with devices that do not have a sectorjsing2012-01-301-1/+25
| | | | | | size of 512 bytes - any other size is not currently supported. ok krw@
* Only pass bio ioctls through to the softraid bio ioctl handler. Rename thejsing2012-01-281-8/+10
| | | | | | handler to emphasise that it is for bio ioctls only. Discovered the hard way by dhill@
* Convert softraid(4) to new bio(4) status interface. This allows bioctl(8)jsing2012-01-221-130/+119
| | | | | | to provide useful feedback, rather than reporting an ioctl failure and leaving the user to consult dmesg. For now we continue to print most things to the console, even if the message is a result of an ioctl.
* Disable the softraid disk attach hook on detach.jsing2012-01-221-1/+3
|
* Ensure that the sc_lock is held before the status functions are called.jsing2012-01-221-1/+7
|
* Split sr_uuid_print() into two functions - one that formats and one thatjsing2012-01-211-10/+25
| | | | prints. Also rename sr_uuid_get() to sr_uuid_generate().