summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* No need to rescan chunks in each discipline to find appropriatekrw2016-04-121-2/+7
| | | | | | 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-33/+27
| | | | | | | | | 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.
* Avoid using uninitialized variables in two corner cases. In onekrw2016-02-141-4/+7
| | | | | | | | case check if it was set and bail out with a useful message if not. In the other the variable was the wrong one anyway, and we can just use the correct variable. Found by & ok jsg@
* Remove NULL-checks before free().mmcc2015-12-291-28/+15
| | | | ok tb@
* Stop passing around constants for metadata size and location. Justkrw2015-08-191-12/+9
| | | | | | use the constants where needed. ok jsing@
* Zap a SLIST in a more obviously correct/safe way.krw2015-07-291-3/+2
| | | | | | Originally from pelikan@, recent prodding from bluhm@ and jsg@. ok pelikan@ millert@ bluhm@
* Tweak a couple of [SLIST|TAILQ]_REMOVE() usages in loops to a morekrw2015-07-281-15/+15
| | | | | | obvious idiom. ok bluhm@ jsing@
* zap trailing linefeeds from sr_error() and panic() callshalex2015-07-271-5/+5
| | | | ok jsing@
* A few more daddr_t fixes. Rename 'phys_off' variables to 'offset'krw2015-07-211-38/+38
| | | | | | | | | 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.
* fix spacingmlarkin2015-07-201-2/+2
|
* Stop passing daddr_t parameters for lengths. Use long since that's the typekrw2015-07-191-3/+3
| | | | | | of the destination fields. ok jsing@
* Change some obviously incorrect usages of daddr_t (a DEV_BSIZEkrw2015-07-191-13/+41
| | | | | | | | | | address) to 64 signed or unsigned ints. Add some paranoia checks during partition size calculations to account for the fact that partition sizes (DL_GETPSIZE()) are unsigned values. More daddr_t rectification to do. ok jsing@
* Stop adding and subtracting data offset. Just keep to chunk relativekrw2015-07-191-2/+2
| | | | | | | | | 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@
* Use DEV_BSIZE instead of 512 where appropriate. Use DL_SECTOBLK()krw2015-07-191-28/+30
| | | | | | | | where appropriate. Noop for disks with 512-byte sectors. i.e. the only kind currently allowed in softraid volumes. But starts laying the groundwork to allow disks with other sector sizes. ok jsing@
* Nuke annoying whitespace nits to shrink some future diffs.krw2015-05-291-6/+5
|
* Signed types are bad array indicies - let it panic instead.pelikan2015-05-201-2/+3
| | | | ok deraadt krw millert
* Make softraid(4) compile with SR_DEBUG by fixing __kprintf__ specifiers.pelikan2015-05-111-18/+17
| | | | ok jsing krw
* Directly handle ioctls issued to a SCSI device associated with a softraidjsing2015-04-111-48/+75
| | | | | | | | | | | | | | | | | | | | | | | volume, ignoring any device name specified in the bio(4) ioctl struct. One of bio(4)'s design flaws is that the device name is hardcoded in many of the ioctl structs, making it basically unusable with DUIDs. In the case of `bioctl -d' the bioctl(8) code actually uses opendev(3) on the given name, then issues the ioctl directly to the resulting device. As such, we already know which device (or in this case, softraid volume) the ioctl was intended for, however the current softraid(4) code ignores this and instead attempts to perform a lookup using the name in the bio(4) ioctl struct. This diff splits the sr_bio_ioctl() code into two parts - one that implements the API required by bio(4) and the other that contains the ioctl handling code, which now takes an optional pointer to the softraid discipline. If an ioctl is issued to a SCSI device associated with a softraid volume, pass the corresponding softraid discipline struct through and to the bio ioctl handler and use it in preference to performing a device name lookup. Amongst other things, this makes bioctl -d now work with DUIDs. ok krw@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-3/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* we want to defer work traditionally (in openbsd) handled in andlg2015-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | interrupt context to a taskq running in a thread. however, there is a concern that if we do that then we allow accidental use of sleeping APIs in this work, which will make it harder to move the work back to interrupts in the future. guenther and kettenis came up with the idea of marking a proc with CANTSLEEP which the sleep paths can check and panic on. this builds on that so you create taskqs that run with CANTSLEEP set except when they need to sleep for more tasks to run. the taskq_create api is changed to take a flags argument so users can specify CANTSLEEP. MPSAFE is also passed via this flags field now. this means archs that defined IPL_MPSAFE to 0 can now create mpsafe taskqs too. lots of discussion at s2k15 ok guenther@ miod@ mpi@ tedu@ pelikan@
* remove the second void * argument on tasks.dlg2015-01-271-13/+14
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* bcopy to memcpy. ok deraadt millerttedu2014-12-191-33/+33
|
* only need lock.h here, not all of uvm_extern.htedu2014-12-161-3/+2
|
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+3
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-2/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* muliply to get correct size for free. reported by kspillnertedu2014-10-301-2/+2
|
* add some sizes to free()tedu2014-10-301-17/+11
|
* remove preliminary AOE (ata over ethernet) support. not finished aftertedu2014-10-071-16/+1
| | | | | many years and wide spread demand for support never materialized. time to pack it in.
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* Replace all queue *_END macro calls except CIRCLEQ_END with NULL.doug2014-09-131-12/+11
| | | | | | | | CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
* When attempting to rebuild a softraid volume, use the actual data offsetjsing2014-08-011-2/+2
| | | | | | | | | | | from the volume metadata rather than the currently defined data offset. This allows rebuilds to work correctly when the volume metadata has a different data offset to that currently in use (for example, volumes created prior to softraid gaining boot support). Found the hard way by henning@ ok deraadt@
* spacing glitchesderaadt2014-07-201-5/+4
|
* Support hibernating to softraid crypto volumes.mlarkin2014-07-201-1/+163
| | | | much help and ok from deraadt@
* Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishianderaadt2014-07-131-6/+7
| | | | ok tedu
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-38/+38
| | | | after discussions with beck deraadt kettenis.
* essentially mechanical conversion of softraid rebuild fromblambert2014-07-121-1/+3
| | | | | | workq to taskq ok jsing@
* Stop using a shutdown hook for softraid(4) and explicitly shutdownmpi2014-07-101-16/+12
| | | | | | | | | | | | | | | | | | | the disciplines right after vfs_shutdown(). This change is required in order to be able to set `cold' to 1 before traversing the device (mainbus) tree for DVACT_POWERDOWN when halting a machine. Yes, this is ugly because sr_shutdown() needs to sleep. But at least it is obvious and hopefully somebody will be ofended and fix it. In order to properly flush the cache of the disks under softraid0, sr_shutdown() now propagates DVACT_POWERDOWN for this particular subtree of devices which are not under mainbus. As a side effect sd(4) shutdown hook should no longer be necessary. Tested by stsp@ and Jean-Philippe Ouellet. ok deraadt@, stsp@, jsing@
* Add some debug messages to the rebuild process and fix a bogus comment.jsing2014-01-221-3/+16
|
* Add a debug flag for rebuild.jsing2014-01-221-1/+2
|
* Make rebuild a discipline specific function pointer. For now, this defaultsjsing2014-01-221-5/+14
| | | | | | to the existing rebuild code. ok krw@
* The sr_rebuild function does not actually do the rebuild, it only startsjsing2014-01-221-5/+5
| | | | | | the rebuild thread. Rename it to sr_rebuild_start to make this clearer. ok krw@
* Move sr_dump from the RAID5 code into shared code. Rename it tojsing2014-01-221-1/+21
| | | | sr_dump_block and place it under the debug define in the process.
* Switch metadata saves from the system workq to the system taskq.jsing2014-01-221-3/+4
| | | | ok dlg@
* Actually use the correct TAILQ field.jsing2014-01-211-2/+2
|
* Allow for variable sized work units.jsing2014-01-211-5/+4
| | | | ok krw@
* Use a TAILQ for tracking work units, rather than an array. This will allowjsing2014-01-211-15/+10
| | | | | | for variable size work units. While here, remove some pointless checks. ok krw@
* Stop bzeroing the work unit when it is initialised. Rather, only initialisejsing2014-01-211-5/+9
| | | | | | | | the specific fields that are either not persistent for the life of the workunit and/or not reinitialised in sr_wu_release_ccbs. This is also necessary for upcoming changes. ok krw@
* Convert the softraid work unit workqs to taskqs.jsing2014-01-201-8/+9
| | | | ok dlg@
* Replace dedicated swu_fake variable with a work unit flag.jsing2014-01-201-3/+3
| | | | ok krw@
* Assert that a workunit has ccbs if it is being scheduled. Otherwise wejsing2014-01-191-1/+3
| | | | | | | deadlock since nothing will ever come back to tell us that the workunit is completed. ok krw@