summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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().
* Add bio(4) status interface structs and utility functions to softraid(4).jsing2012-01-201-1/+31
|
* Check the metadata level against the assembly level before proceeding withjsing2012-01-171-19/+19
| | | | | | any assembly. This avoids a panic when attempting to assemble a RAID 1 (or other) volume as a RAID 0 volume. Also reorder some of the other checks and diagnostics performed during assembly.
* Add missing ioctl DNPRINTFs and nuke some rogue commas.jsing2012-01-171-6/+9
|
* Move softraid root mapping to later in the boot process - this will allowjsing2012-01-111-5/+12
| | | | us to play some tricks in setroot().
* Make sr_boot_chunk and sr_boot_volume accessible from userland. Add ajsing2012-01-111-25/+34
| | | | | | number of variables that are needed to detect and assemble volumes. A sr_metadata struct can be allocated and used via the sbc_metadata pointer, which we now do in the kernel boot probe/assembly code.
* Implement a concatenating discipline for softraid.jsing2011-12-311-2/+6
| | | | | Many thanks to Marco Peereboom for his assistance with testing and debugging. Thanks also to Josh Grosse and Chris Jackman for testing.
* Cleanup the metadata initialisation process - have sr_meta_init()jsing2011-12-281-131/+106
| | | | | | | initialise both the volume and chunk metadata before the discipline specific sd_create() function is called. The sr_meta_init_complete() function is then called to complete the initialisation based on values provided by sd_create().
* Avoid the use of an invalid disklabel by setting a DK_LABELVALID flagjsing2011-12-281-1/+2
| | | | | | | | | if we correctly read and validated the disklabel. Always check that this flag is set before using the DUID from the disklabel. Discussed with deraadt@ ok krw@
* Provide default set chunk state and set volume state functions whichjsing2011-12-261-3/+111
| | | | | cover the no redundancy/no rebuild case. Use these for the AOE, crypto and RAID 0 disciplines.
* Initialise discipline function pointers with defaults and only overridejsing2011-12-251-1/+20
| | | | those that are needed by a specific discipline.
* When initiating a rebuild update the DUID for the chunk so thatjsing2011-11-131-1/+3
| | | | | | installboot has the correct details. Also zero the boot DUID list before populating it in installboot, preventing the DUIDs of offline chunks from remaining around.
* Cleanup rebuild initialisation code. In particular, reconstruct the chunkjsing2011-11-131-40/+49
| | | | | metadata from the volume metadata rather than using the metadata from some random chunk. The coerced size is gained from another online chunk.
* Remove a bogus check which dereferences an uninitialised pointer.jsing2011-11-111-4/+1
| | | | | | From Pedro Martelletto. ok krw@ mikeb@
* When rebuilding check the size of the replacement chunk against thejsing2011-11-111-2/+2
| | | | coerced size rather than the physical size of another chunk.
* Remove unused sv_sensor_valid variable.jsing2011-11-111-3/+1
|
* When setting up a bootable softraid volume, do not try to save the bootjsing2011-11-111-1/+5
| | | | | | blocks or boot loader to chunks that are not online. ok mikeb@