summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_ctl.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r298698:pfg2016-05-111-5/+5
| | | | | | | | | | | | | | | geom: unsign some types to match their definitions and avoid overflows. In struct:gctl_req, nargs is unsigned. In mirror: g_mirror_syncreqs is unsigned. In raid: in struct:g_raid_volume, v_disks_count is unsigned. In virstor: in struct:g_virstor_softc, n_components is unsigned.
* MFC r261084:ae2014-01-301-33/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | malloc() with M_WAITOK doesn't return NULL. MFC r261085: Fix typo in r261084. Add to the gctl_error() an ability to specify error description even if numeric error code is already specified. Also by default set error code to EINVAL. PR: 185852 MFC r261086: In gctl_copyin() remove unused error variable. geom_alloc_copyin() can't return ENOMEM, so describe its fail as bad control request. Add check for NULL pointer in gctl_dump(), since it can be NULL when geom_alloc_copyin() failed. MFC r261089: Remove another unneeded NULL check from geom_alloc_copyin(). Do copyout in case of gctl version mismatch and fix sbuf leak in g_ctl_ioctl_ctl(). MFC r261091: Always free sbuf in gctl_free().
* Finish r210923, 210926. Mark some devices as eternal.kib2011-01-041-1/+1
| | | | MFC after: 2 weeks
* Add sbuf_new_auto as a shortcut for the very common case of creating ades2008-08-091-1/+1
| | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks
* - Be more verbose when saying "foo" not found.delphij2007-03-301-10/+10
| | | | | | | - In gctl_get_geom(), don't issue error when we were not provided with an parameter, like gctl_get_provider() did. Reviewed by: pjd
* Change gctl_set_param() to return an error instead of setting anmarcel2006-04-071-12/+28
| | | | | | | | | | | 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.
* o Don't cause a panic when the control request lacks a verb.marcel2005-09-181-5/+9
| | | | | o Don't set the error twice when the named class does not exist. It causes ioctl(2) to return with error EEXIST.
* remove stale commentsphk2005-08-161-2/+0
|
* Fix a long-standing bug. Error string has to be copyied from the userpjd2005-04-081-5/+9
| | | | | | | process context. Approved by: phk MFC after: 3 days
* Discontinue zero-length g_ctl arguments as "just give him this pointer"phk2005-01-171-6/+1
| | | | | transfers. The necessary context for calling copyin() isn't available anyway and automatic code-validation chokes on this.
* Don't call g_waitidle(), it happens automagically now.phk2004-10-231-2/+3
|
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-2/+2
| | | | Bump __FreeBSD_version accordingly.
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* The present defaults for the open and close for device drivers whichphk2003-09-271-2/+0
| | | | | | | | | | | | | | provide no methods does not make any sense, and is not used by any driver. It is a pretty hard to come up with even a theoretical concept of a device driver which would always fail open and close with ENODEV. Change the defaults to be nullopen() and nullclose() which simply does nothing. Remove explicit initializations to these from the drivers which already used them.
* Only dump 512 bytes of debugging.phk2003-07-021-1/+2
| | | | Always wait for things to settle before returning.
* Use __FBSDID().obrien2003-06-111-2/+3
| | | | Approved by: phk
* Make sure we return an error message if the geom parameter is notphk2003-06-071-8/+8
| | | | located.
* Add missing va_end() calls.phk2003-06-071-0/+1
| | | | Noticed by: tmm
* Introduce g_provider_by_name() function, and use it.phk2003-06-041-10/+3
|
* Return an indicative error message.phk2003-06-021-1/+3
|
* Simplify the GEOM OAM api: Drop the request type, and let everythingphk2003-06-011-253/+185
| | | | | | | | hinge on the "verb" parameter which the class gets to interpret as it sees fit. Move the entire request into the kernel and move changed parameters back when done.
* Add gctl_set_param() function.phk2003-05-041-0/+25
|
* Plug memory leaks.phk2003-05-021-0/+16
|
* Back out all the stuff that didn't belong in the last commit.phk2003-05-021-4/+0
|
* Use g_slice_spoiled() rather than g_std_spoiled().phk2003-05-021-0/+4
| | | | Remember to free the buffer we got from g_read_data().
* Introduce gctl_get_paraml() which gets a parameter only if it has thephk2003-04-231-0/+17
| | | | right length.
* Make gctl_error() take printfline varargs.phk2003-04-231-6/+21
|
* Implement handling of CONFIG_GEOM OAM request.phk2003-04-221-0/+39
|
* Collapse meta arguments into regular arguments, the distinction isphk2003-04-221-10/+2
| | | | more trouble than it is worth.
* Make sure we don't ignore error codes.phk2003-04-031-32/+24
|
* Remove the old config interface, the new OAM is sufficiently functionalphk2003-04-011-50/+0
| | | | now.
* Remove some debugging in the new OAM[*] and add a debug flag for otherphk2003-03-311-5/+2
| | | | | | | | | parts of it. [*] I've been asked what "OAM" means: It's an acronym used in the telecom industry, "Operations And Maintenance", and there it covers anything from a single unlabeled led on the frontpanel the the full nightmare of CMIP for SS7.
* Run a revision on the OAM api.phk2003-03-271-53/+255
| | | | | | | Use prefix gctl_ systematically. Add flag with access perms for each argument. Add ro/rw versions of argument building functions. General cleanup.
* Turn /dev/geom.ctl from a GEOM class into a plain character device driverphk2003-03-241-94/+15
| | | | instead, it will never see a disk-I/O transaction, so this is a lot simpler.
* Marshalling stuff for OAM API.phk2003-03-231-0/+185
|
* 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.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Straighten up the geom.ctl config interface definitions.phk2002-11-061-28/+10
| | | | Sponsored by: DARPA & NAI Labs
* Now that the sectorsize and mediasize are properties of the provider,phk2002-10-201-0/+1
| | | | | | | | | | | don't take the detour over the I/O path to discover them using getattr(), we can just pick them out directly. Do note though, that for now they are only valid after the first open of the underlying disk device due compatibility with the old disk_create() API. This will change in the future so they will always be valid. Sponsored by: DARPA & NAI Labs.
* Make it possible to specify also via geom_t ID in the geom.ctl config ioctl.phk2002-10-201-3/+9
| | | | Sponsored by: DARPA & NAI Labs.
* Implement the GEOMCONFIGGEOM ioctl which can be used to manually createphk2002-10-141-1/+35
| | | | | | and configure an instance of a class on a give provider. Sponsored by: DARPA & NAI Labs
* Add the outline of the "/dev/geom.ctl" handling code.phk2002-10-131-0/+193
Sponsored by: DARPA & NAI Labs.
OpenPOWER on IntegriCloud