summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_ccd.c
Commit message (Collapse)AuthorAgeFilesLines
* - Fix a potential NULL pointer reference. Note that this should not happen inlulf2008-11-251-1/+17
| | | | | | | | | practice, but it is a good programming practice and allows the kernel to not depend on userland correctness. - While there, make sizeof usage match the rest of the code. Found with: Coverity Prevent(tm) CID: 660, 662
* Add sbuf_new_auto as a shortcut for the very common case of creating ades2008-08-091-2/+2
| | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks
* Make CCD be able to read and write Linux software raids.cracauer2006-04-131-2/+24
| | | | | | | | | | Supported for raid-0 with <n> disks, raid-1 with 2 disks. Manpages have examples, warnings etc. Test scripts on http://www.cons.org/cracauer/ccdconfig-linux/ Reviewed by: alfred
* Change gctl_set_param() to return an error instead of setting anmarcel2006-04-071-2/+2
| | | | | | | | | | | error on the request. Add a wrapper, gctl_set_param_err(), that sets the error on the request from the error returned by gctl_set_param() and update current callers of gctl_set_param() to call gctl_set_param_err() instead. This makes gctl_set_param() much more usable in situations where the caller knows better what to do with certain (apparent) error conditions and setting an error on the request is not one of the things that need to be done.
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Tag all geom classes in the tree with a version number.phk2004-08-081-0/+1
|
* Use default method initialization on geoms.phk2004-08-081-3/+3
|
* Remove the absolute count g_access_abs() function since experience hasphk2004-02-121-2/+2
| | | | | | | | | | | | shown that it is not useful. Rename the relative count g_access_rel() function to g_access(), only the name has changed. Change all g_access_rel() calls in our CVS tree to call g_access() instead. Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source code compatibility.
* don't call sbuf_clear() right after sbuf_new(), it is not necessary.phk2004-02-101-2/+0
|
* Make sure to return errors if we have any.phk2003-11-121-1/+1
| | | | Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
* Close the right consumers if we run into trouble opening them all.phk2003-10-241-1/+1
| | | | Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
* Change the the size fields to daddr_t to support greater than 2TB ccd volumes.ps2003-08-221-5/+5
| | | | Reviewed by: phk
* Make CCD unloadable.phk2003-08-221-8/+11
|
* Block all GETATTR calls hitting the CCD, we wouldn't know which childphk2003-08-221-0/+10
| | | | | | | device should handle them. This prevents for instance GEOM::ioctl requests from reaching a lower BSDlabel node, which ps@ found would confuse newfs(8).
* Check for null softc pointers, these happens when a ccd is withering.phk2003-08-221-2/+2
| | | | Found by: David Schultz <dschultz@OCF.Berkeley.EDU>
* Fix a memory leak in CCD's mirror code.phk2003-07-291-0/+2
|
* Use __FBSDID().obrien2003-06-111-4/+3
| | | | Approved by: phk
* Fix error handling for ENOMEM style issues.phk2003-06-091-21/+9
|
* Polishing and nitpicking.phk2003-06-071-16/+19
|
* Make this a true GEOM class:phk2003-06-041-751/+294
| | | | | | | | | | | | | Attach to the component devices using GEOM semantics. Create a GEOM provider instead of using disk_create() Use the GEOM OAM api for configuration. I saw approx ~1% speedup in througput and ~7% in latency in a simple minded test of a two-disk striped device. This file was repo-copied from src/sys/dev/ccd/ccd.c. This is not yet linked into the build.
* Further devilification of CCD:phk2003-06-021-86/+87
| | | | | | | Change the list interface to simplify things. Remove old list ioctls which bogusly exported the softc to userland. Move the softc and associated structures from the public header to the source file.
* Begin deevilification of CCD:phk2003-06-021-1/+56
| | | | | | | | Make CCD a GEOM class. For now only use this for implementing a OAM config method which can return a list of configured CCD devices in the format which "ccdconfig -g[v]" would normally output.
* Remove unused variable.phk2003-05-311-2/+0
| | | | Found by: FlexeLint
* More correct patch: Only call biofinish if we have not already sentphk2003-04-141-1/+18
| | | | any children down the mesh.
* Call biofinish() also when we get a malloc() failure.phk2003-04-141-4/+1
|
* Use bioq_flush() to drain a bio queue with a specific error code.phk2003-04-011-0/+1
| | | | | | | | Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate.
* Including <sys/stdint.h> is (almost?) universally only to be able to usephk2003-03-181-1/+0
| | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble.
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-17/+1
| | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
* Initialize the second buffer for mirroring to point to itself and not itsphk2003-03-041-0/+1
| | | | partner.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+5
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* NO_GEOM cleanup: Convert CCD(4) to be use "struct disk*" instead of "dev_t"phk2003-02-211-5/+5
| | | | as "this" handle.
* NO_GEOM cleanup:phk2003-02-211-1/+1
| | | | | | | | Change the argument to disk_destroy() to be the same struct disk * as disk_create() takes. This enables drivers to ignore the (now) bogus dev_t which disk_create() returns.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-10/+11
| | | | Approved by: trb
* Announce our ability to do MAXPHYS transfers.phk2003-02-111-0/+1
|
* Eliminate the sc_openmask, ccdopen() and ccdclose() functions, wephk2003-02-011-46/+6
| | | | | | | can use the flag maintained by geom_disk.c Having only a strategy method to intialize, don't waste space using a cdevsw structure to do so.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-10/+10
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Finally give CCD the disk mini-layer treatment:phk2003-01-191-431/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CAUTION: Previously CCD would be different from all other disks in the system in that there were no "ccd0" device, only a "ccd0c" device. This is no longer so after this commit. If you access a ccd device through the "/dev/ccd0c" device _and_ have not actually put a BSD disklabel on the device, you will have to use the name "/dev/ccd0". If your CCD device contains a BSD disklabel there should be no difference. You need to recompile ccdconfig(8) using the changed src/sys/sys/ccdvar.h for the -g "show me" option to work. I have run the regression test I created before I started overhauling CCD and it flags no problems, but this code is mildly evil, so take care. If you would cry if you lost what's on CCD, make a back before you upgrade. Create separate cdevsw for the /dev/ccd.ctl device. Remove the cloning function, the disk-minilayer will do all naming for us. Remove the ccdunit and ccdpart functions and carry the softc pointer in the relevant dev_t's and structures. Release all memory when a CCD device is unconfigured, previously the softc would linger behind. Remove all traces of BSD disklabel fiddling code. Remove ccdpsize, the disk mini-layer does this for us. Don't allocate memory with M_WAITOK in ccdstrategy(). Remove boundary checks which the disk mini-layer does for us. Don't allocate space for more than 2 ccdbuf, RAID was never implemented. NB: I have not tried to address any of the preexisting ailments of CCD.
* Unifdef -UDEBUG on the CCD driver. The debugging is mostly uselessphk2003-01-191-145/+0
| | | | | | | | and can be added back selectively, should anybody start to interest themselves for the internal workings of ccd. This commit will make the diffs for the following commits much more readable.
* Inline now trivial functions getccdbuf() and putccdbuf().phk2003-01-181-53/+8
| | | | Fix another trivial memory-leak.
* Fix minor memory-leak.phk2003-01-181-0/+1
|
* Use the M_CCD malloc bucket instead of M_DEVBUF.phk2003-01-181-41/+25
| | | | Don't keep a private freelist of a low number of trivially small structures.
* Inline trivial function ccdintr() into its one caller ccdiodone().phk2003-01-181-21/+9
| | | | Only call ccdfind() once in ccdiodone() and cache the result.
* Sanitize the copyright section a bit: We do not need two copies of thephk2003-01-181-51/+17
| | | | four-clause BSD license in the file, one will do.
* Find places to store the previously implicityly passed unit number inphk2003-01-171-7/+122
| | | | | | | | | | | | | | | | | | | the three configuration ioctls which need a unit number. Add a "ccd.ctl" device for config operations. Implement ioctls on ccd.ctl which rely on the explicityly passed unit numbers. Update ccdconfig to use the new ccd.ctl interface. Add code to the kernel to detect old ccdconfig binaries, and whine about it. Add code to ccdconfig to detect old kernels, and whine about it. These two compatibility measures will be retained only for a limited period since they are in the way of GEOM'ification of ccd.
* Remove CCDF_SWAP and CCDF_PARITY, they have never been implemented.phk2003-01-031-21/+4
|
* Remove unused second argument from BIO_STRATEGY()phk2003-01-031-5/+5
|
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* - Use vrefcnt() instead of v_usecount.jeff2002-09-251-1/+1
|
* (This commit touches about 15 disk device drivers in a very consistentphk2002-09-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and predictable way, and I apologize if I have gotten it wrong anywhere, getting prior review on a patch like this is not feasible, considering the number of people involved and hardware availability etc.) If struct disklabel is the messenger: kill the messenger. Inside struct disk we had a struct disklabel which disk drivers used to communicate certain metrics to the disklayer above (GEOM or the disk mini-layer). This commit changes this communication to use four explicit fields instead. Amongst the benefits is that the fields do not get overwritten by wrong or bogus on-disk disklabels. Once that is clear, <sys/disk.h> which is included in the drivers no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in, the few places that needs them, have gotten explicit #includes for them. The disklabel inside struct disk is now only for internal use in the disk mini-layer, so instead of embedding it, we malloc it as we need it. This concludes (modulus any mistakes) the series of disklabel related commits. I belive it all amounts to a NOP for all the rest of you :-) Sponsored by: DARPA & NAI Labs.
* Fix another two printf() format errors which weren't warnedmux2002-09-131-4/+4
| | | | about because the bio_blknos were bogusly casted to long long.
OpenPOWER on IntegriCloud