summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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@
* Typo. BIOC_SSOFFLINE is the ioctl command. Pass BIOC_SDOFFLINE tokrw2011-11-081-2/+2
| | | | | | sd_set_chunk_state() as the new state. ok jsing@
* If the rootduid matches a softraid chunk of a bootable softraid volume,jsing2011-09-191-1/+46
| | | | | | | | | | | | | map the rootduid to the DUID of the softraid volume. This means that regardless of where the kernel is loaded from we always get the softraid volume as the root device, providing we booted from one of its chunks. If we boot from any other disk then the rootduid remains unchanged. With this diff it is now possible to have the root filesystem on softraid, however at this stage the kernel still needs to be loaded from a separate FFS partition. ok deraadt@
* When installboot is run on a softraid volume, add boot optional metadatajsing2011-09-191-6/+49
| | | | | | | to store the DUID of the softraid volume and each of the chunks that it is assembled from. This allows us to correctly identify the root disk. ok deraadt@
* Cleanup sr_ioctl_createraid(). There are three clear cases - (1) corruptjsing2011-09-191-40/+27
| | | | | | | | | | or invalid metadata; (2) a new volume with no existing metadata; and (3) an existing volume with metadata. This removes duplicated code and simplifies the code path. Also ensure that we only process the optional metadata once per volume and not once per chunk. Move the optional metadata handler calls into sr_ioctl_createraid().
* Add support for variable length optional metadata in softraid(4). Thisjsing2011-09-181-29/+113
| | | | | | | | | | | will allow new optional metadata types to be added without needing to change the softraid metadata version. Note that this commit changes the softraid metadata version, however an upgrade from older metadata is handled automatically. A full backup prior to upgrading is still strongly recommended. With feedback from stsp@ and marco.
* Rename the optional metadata handler function and factor out the optionaljsing2011-09-181-30/+33
| | | | metadata handling code. This will simplify upcoming changes.
* Fix a formating bug that caused a bad print on big endian arches.marco2011-08-081-2/+2
| | | | ok deraadt
* Backout a bunch of my SCSI commits from c2k11. At least one of thesematthew2011-07-171-3/+3
| | | | | | is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@