summaryrefslogtreecommitdiff
path: root/sys/geom/geom_ccd.c
Commit message (Collapse)AuthorAgeFilesLines
* geom: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-3/+0
| | | | Notes: svn path=/head/; revision=365226
* Use snprintf instead of sprintf.Xin LI2020-07-261-2/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=363540
* Fix indent for if clause.Xin LI2020-07-201-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=363360
* Annotate geom modules with MODULE_VERSIONKyle Evans2018-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | GEOM ELI may double ask the password during boot. Once at loader time, and once at init time. This happens due a module loading bug. By default GEOM ELI caches the password in the kernel, but without the MODULE_VERSION annotation, the kernel loads over the kernel module, even if the GEOM ELI was compiled into the kernel. In this case, the newly loaded module purges/invalidates/overwrites the GEOM ELI's password cache, which causes the double asking. MFC Note: There's a pc98 component to the original submission that is omitted here due to pc98 removal in head. This part will need to be revived upon MFC. Reviewed by: imp Submitted by: op Obtained from: opBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14992 Notes: svn path=/head/; revision=332387
* geom_ccd.c: Fix the licenses properlyPedro F. Giffuni2017-12-301-19/+51
| | | | | | | | | | | | | | | The license merging in r109471 didn't take into account that licensing could change. Just removing the 3rd clause obviates the copyright assignment to the NetBSD Foundation. We do have plenty of files that have two or more licensing as in this case, so fix this properly by splitting back the licenses as they are upstream. Obtained from: NetBSD Notes: svn path=/head/; revision=327373
* geom_ccd.c: Update the license with changes from upstream.Pedro F. Giffuni2017-12-301-6/+2
| | | | | | | | | | | | | | | | | | Part of this file originated in NetBSD, with the original file carrying two versions of 4-clause BSD licenses. r109471 attempted to simplify the situation by putting both licenses together. Meanwhile, NetBSD dropped Clauses 3 and 4 from their own license, and eventually NetBSD got permission from the University of Utah to drop the 3rd clause. Keep the license "simple" by dropping the third clause since both TNF, Utah/Berkeley and phk agree in principle that it can be dropped. Obtained from: NetBSD (ccd.c CVS 1.128, 1.138) Notes: svn path=/head/; revision=327372
* sys/geom: adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326270
* sys/geom: spelling fixes in comments.Pedro F. Giffuni2016-04-291-2/+2
| | | | | | | No functional change. Notes: svn path=/head/; revision=298808
* Include sys/sbuf.h directly.Andrey V. Elsukov2011-07-111-0/+1
| | | | | | | Reviewed by: pjd Notes: svn path=/head/; revision=223921
* - Fix a potential NULL pointer reference. Note that this should not happen inUlf Lilleengen2008-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 Notes: svn path=/head/; revision=185318
* Add sbuf_new_auto as a shortcut for the very common case of creating aDag-Erling Smørgrav2008-08-091-2/+2
| | | | | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks Notes: svn path=/head/; revision=181463
* Make CCD be able to read and write Linux software raids.Martin 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 Notes: svn path=/head/; revision=157740
* Change gctl_set_param() to return an error instead of setting anMarcel Moolenaar2006-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. Notes: svn path=/head/; revision=157581
* /* -> /*- for copyright notices, minor format tweaks as necessaryWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139778
* Tag all geom classes in the tree with a version number.Poul-Henning Kamp2004-08-081-0/+1
| | | | Notes: svn path=/head/; revision=133318
* Use default method initialization on geoms.Poul-Henning Kamp2004-08-081-3/+3
| | | | Notes: svn path=/head/; revision=133314
* Remove the absolute count g_access_abs() function since experience hasPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=125755
* don't call sbuf_clear() right after sbuf_new(), it is not necessary.Poul-Henning Kamp2004-02-101-2/+0
| | | | Notes: svn path=/head/; revision=125651
* Make sure to return errors if we have any.Poul-Henning Kamp2003-11-121-1/+1
| | | | | | | Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl> Notes: svn path=/head/; revision=122550
* Close the right consumers if we run into trouble opening them all.Poul-Henning Kamp2003-10-241-1/+1
| | | | | | | Submitted by: Pawel Jakub Dawidek <nick@garage.freebsd.pl> Notes: svn path=/head/; revision=121476
* Change the the size fields to daddr_t to support greater than 2TB ccd volumes.Paul Saab2003-08-221-5/+5
| | | | | | | Reviewed by: phk Notes: svn path=/head/; revision=119300
* Make CCD unloadable.Poul-Henning Kamp2003-08-221-8/+11
| | | | Notes: svn path=/head/; revision=119299
* Block all GETATTR calls hitting the CCD, we wouldn't know which childPoul-Henning Kamp2003-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). Notes: svn path=/head/; revision=119296
* Check for null softc pointers, these happens when a ccd is withering.Poul-Henning Kamp2003-08-221-2/+2
| | | | | | | Found by: David Schultz <dschultz@OCF.Berkeley.EDU> Notes: svn path=/head/; revision=119295
* Fix a memory leak in CCD's mirror code.Poul-Henning Kamp2003-07-291-0/+2
| | | | Notes: svn path=/head/; revision=118182
* Use __FBSDID().David E. O'Brien2003-06-111-4/+3
| | | | | | | Approved by: phk Notes: svn path=/head/; revision=116196
* Fix error handling for ENOMEM style issues.Poul-Henning Kamp2003-06-091-21/+9
| | | | Notes: svn path=/head/; revision=116107
* Polishing and nitpicking.Poul-Henning Kamp2003-06-071-16/+19
| | | | Notes: svn path=/head/; revision=115953
* Make this a true GEOM class:Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=115849
* Further devilification of CCD:Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=115731
* Begin deevilification of CCD:Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=115729
* Remove unused variable.Poul-Henning Kamp2003-05-311-2/+0
| | | | | | | Found by: FlexeLint Notes: svn path=/head/; revision=115492
* More correct patch: Only call biofinish if we have not already sentPoul-Henning Kamp2003-04-141-1/+18
| | | | | | | any children down the mesh. Notes: svn path=/head/; revision=113464
* Call biofinish() also when we get a malloc() failure.Poul-Henning Kamp2003-04-141-4/+1
| | | | Notes: svn path=/head/; revision=113462
* Use bioq_flush() to drain a bio queue with a specific error code.Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=112946
* Including <sys/stdint.h> is (almost?) universally only to be able to usePoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=112367
* Centralize the devstat handling for all GEOM disk device driversPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=111979
* Initialize the second buffer for mirroring to point to itself and not itsPoul-Henning Kamp2003-03-041-0/+1
| | | | | | | partner. Notes: svn path=/head/; revision=111863
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-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) Notes: svn path=/head/; revision=111815
* NO_GEOM cleanup: Convert CCD(4) to be use "struct disk*" instead of "dev_t"Poul-Henning Kamp2003-02-211-5/+5
| | | | | | | as "this" handle. Notes: svn path=/head/; revision=111232
* NO_GEOM cleanup:Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=111216
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-10/+11
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Announce our ability to do MAXPHYS transfers.Poul-Henning Kamp2003-02-111-0/+1
| | | | Notes: svn path=/head/; revision=110729
* Eliminate the sc_openmask, ccdopen() and ccdclose() functions, wePoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=110188
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-10/+10
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Finally give CCD the disk mini-layer treatment:Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=109535
* Unifdef -UDEBUG on the CCD driver. The debugging is mostly uselessPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=109534
* Inline now trivial functions getccdbuf() and putccdbuf().Poul-Henning Kamp2003-01-181-53/+8
| | | | | | | Fix another trivial memory-leak. Notes: svn path=/head/; revision=109486
* Fix minor memory-leak.Poul-Henning Kamp2003-01-181-0/+1
| | | | Notes: svn path=/head/; revision=109482
* Use the M_CCD malloc bucket instead of M_DEVBUF.Poul-Henning Kamp2003-01-181-41/+25
| | | | | | | Don't keep a private freelist of a low number of trivially small structures. Notes: svn path=/head/; revision=109474