summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid_raid1.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* No need to rescan chunks in each discipline to find appropriatekrw2016-04-121-10/+1
| | | | | | volume sector size. Determine volume sector size in sr_meta_init(). Pointed out, tweaked and ok jsing@
* Enable creation of softraid volumes using disks with non-512 bytekrw2016-04-041-1/+10
| | | | | | | | | sectors. Volumes created will present a sector size equal to the largest sector size of the constituent disks. Softraid Metadata version cranks to 6 due to new field. ok jsing@ with tweaks that will follow soon.
* A few more daddr_t fixes. Rename 'phys_off' variables to 'offset'krw2015-07-211-5/+5
| | | | | | | | | since they are now relative to chunks. Use 'blkno' as normal variable name for daddr_t items rather than mix of 'blkno, blk, offset. Change field name ssd_data_offset to ssd_data_blkno since it is a block and not byte quantity. No intentional functional change.
* Remove unneeded #include <disklabel.h>.krw2015-07-191-2/+1
| | | | ok jsing@
* Stop adding and subtracting data offset. Just keep to chunk relativekrw2015-07-191-4/+1
| | | | | | | | | block offsets until actual i/o is constructed and needs the physical offset. Eliminate a number of <<DEV_BSIZE shifts as a bonus. No intentional functional change. Fixed and ok jsing@
* remove #include <sys/workq.h>. it wont exist anymore soon.dlg2015-01-271-2/+1
|
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-2/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* essentially mechanical conversion of softraid rebuild fromblambert2014-07-121-2/+2
| | | | | | workq to taskq ok jsing@
* Switch metadata saves from the system workq to the system taskq.jsing2014-01-221-2/+4
| | | | ok dlg@
* Order the volume state transitions by state value.jsing2014-01-211-10/+10
|
* Sprinkle (long long) casts where %lld is being used to print daddr_tkrw2013-11-011-3/+3
| | | | | | variables. Some random whitespace/knf repairs encountered on the way. ok miod@ on inspection, feedback & more suggestions from millert@
* final removal of daddr64_t. daddr_t has been 64 bit for a long enoughderaadt2013-06-111-2/+2
| | | | | test period; i think 3 years ago the last bugs fell out. ok otto beck others
* Provide a function that handles the scheduling of work units. Thisjsing2013-05-211-22/+4
| | | | | | | simplifies the discipline code, avoids code duplication and moves the scheduling logic into a single location. ok krw@
* Use a state to indicate that a work unit should only be constructed and notjsing2013-05-211-3/+3
| | | | scheduled, rather than trying to imply this from the rebuild flag.
* Convert RAID1 to the new work unit completion functions and genericjsing2013-04-211-71/+26
| | | | | | | | | 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 consistent error handling when validating the number of chunksjsing2013-03-311-3/+3
| | | | provided.
* More runtime value initialisation functions.jsing2013-03-311-4/+8
|
* Provide default resource allocation and free functions. Convert alljsing2013-03-311-38/+1
| | | | disciplines except for AOE and CRYPTO, which require custom handlers.
* Properly release ccbs when restarting a work unit.jsing2013-03-291-3/+2
|
* Decouple wakeups on work unit completion from the type of I/O beingjsing2013-03-291-9/+6
| | | | | | performed. ok krw@
* sd_wu_pending is only decremented when scsi_done() or scsi_io_put() arejsing2013-03-291-4/+1
| | | | | | | | | 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@
* Rewrite the work unit handling code in the RAID 1/4/5/6 interrupt handlers.jsing2013-03-271-69/+52
| | | | | | | | | This simplifies the code and will allow for easier conversion to the workq based work unit completion routines. It also ensures that work units are always removed from the pending queue and that colliders are started, even in the event of an I/O failure. ok krw@
* Factor out the code that is used to recreate work units - one copy of thejsing2013-03-251-24/+2
| | | | | | code is sufficient. ok krw@
* sr_alloc_resources() and sr_free_resources() can never be called withoutjsing2013-03-021-7/+1
| | | | a valid struct sr_discipline. Remove redundant NULL pointer checks.
* Convert RAID1 to new ccb functions.jsing2013-01-181-69/+8
| | | | ok krw@
* Restructure the RAID1 I/O path so that we only get a ccb once we arejsing2013-01-171-49/+48
| | | | | | | certain that we need one. Also make code more consistent with other disciplines. ok krw@
* Consistently call sr_scsi_done instead of scsi_done.jsing2013-01-161-3/+3
| | | | ok krw@
* Add a new capability flag to identify disciplines where read failures arejsing2013-01-161-2/+2
| | | | | | not necessarily terminal (i.e. we have redundancy). ok krw@
* Set resid to zero if the scsi transfer completed without error.jsing2013-01-161-2/+1
| | | | ok krw@
* Factor out code used to release ccbs from a workunit.jsing2013-01-161-9/+2
| | | | ok krw@
* Always initialise the discipline name, not just when we are doing a create.jsing2013-01-151-3/+2
|
* 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.
* Provide a mechanism for the kernel to pass data through to the disciplinejsing2012-10-081-3/+3
| | | | during volume assembly.
* Convert softraid(4) to new bio(4) status interface. This allows bioctl(8)jsing2012-01-221-2/+4
| | | | | | 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.
* Provide default set chunk state and set volume state functions whichjsing2011-12-261-1/+3
| | | | | 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-11/+4
| | | | those that are needed by a specific discipline.
* Move chunk state debugging code to a more useful location.jsing2011-12-251-7/+8
|
* Iopoolification. Testing by marco@.krw2011-04-051-5/+1
| | | | ok dlg@ marco@
* Move raid1 and crypto io to a workq. This is to avoid a potential VOP_marco2010-11-061-1/+8
| | | | | | | | | call while in interrupt context. Contains an additional spl dance as found by thib. Tested by many opn various arches. Note that raid 0/4/5/6 have not been moved over yet.
* Determine the data offset using a variable specified within the softraidjsing2010-07-021-2/+2
| | | | | | | | | | metadata. This allows us to implement seamless transitions from the previous metadata version to the current version, avoiding the need to recreate the softraid volume. Joint work with marco@ during c2k10. ok marco@
* make sure that buf's on the stack set the b_bq to NULL.thib2010-07-011-1/+2
| | | | | | one memset -> bzero. ok marco@, jsing@
* Add storage for the boot block and boot loader to the softraid metadata.jsing2010-03-261-2/+2
| | | | | | | | | | | | | Also add a new optional metadata type for boot data. This is the first step (of many) towards being able to boot from softraid volumes. WARNING: This version of the softraid metadata is not compatible with previous versions. As a result, any softraid volumes created with older kernels will not assemble. Data on existing softraid volumes should be backed up before upgrading. The volume should then be recreated and the data restored. ok marco@
* Zap all setting of ITSDONE in drivers that don't look at it. Nobodykrw2010-01-091-3/+1
| | | | | | | else cares so it's just noise. Drivers that actually look at ITSDONE are unchanged. ok marco@ (for his files) dlg@ beck@
* Factor out discipline specific create/assemble code.jsing2009-12-151-2/+33
| | | | "in, in, in!" marco@
* Define discipline capabilities using a set of flags.jsing2009-12-071-2/+3
| | | | "shiny!!" marco@
* Switch softraid to vnodes to prevent bad things from happening when usingmarco2009-08-091-27/+31
| | | | | | d_open/d_close. tested by many, ok jsing, thib, krw
* Clean up debug droppings in sr_raid1_set_vol_state().jsing2009-07-121-5/+9
| | | | ok marco@
* Enable hotspare rebuilds for softraid RAID1.jsing2009-07-121-1/+5
| | | | ok marco@
* Abort the current rebuild if the rebuild chunk disappears. Whilst here alsojsing2009-06-241-1/+4
| | | | | | rename the abort flag so that it is more generalised. ok marco@