aboutsummaryrefslogtreecommitdiff
path: root/sbin/geom/misc
Commit message (Collapse)AuthorAgeFilesLines
* - Simplify code by using g_*() API.Pawel Jakub Dawidek2010-09-232-83/+62
| | | | | | | | | | | - Don't use u_char and u_int in userland. - Change 'unsigned' to 'unsigned int'. - Update copyright years. MFC after: 1 week Notes: svn path=/head/; revision=213074
* Check for overflow before it occurs. Also add check forAndrey V. Elsukov2010-06-211-2/+2
| | | | | | | | | | negative numbers. Suggested by: ache Approved by: kib (mentor) Notes: svn path=/head/; revision=209392
* Remove G_TYPE_ASCLBA type and replace it with G_TYPE_STRING in gpart.Andrey V. Elsukov2010-06-212-0/+91
| | | | | | | | | | | | | | | | | | Move code that converts params from humanized numbers to sectors count to subr.c and adjust comment. Add post-processing for "size" and "start offset" params in gpart, now they are properly converted to sectors count with known sector size that can be greater that 512 bytes. Also replace "unsigned long long" type to "off_t" for unify code since it used for medium size in libgeom(3) and DIOCGMEDIASIZE ioctl. PR: bin/146277 Reviewed by: marcel (previous version) Approved by: kib (mentor) MFC after: 1 month Notes: svn path=/head/; revision=209388
* bgeom(3) does strdup of param name.Andrey V. Elsukov2010-06-071-0/+1
| | | | | | | | | | | Don't leak memory when deleting param from gctl_req. Reviewed by: marcel Approved by: mav (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=208886
* Flush disk write cache after storing and clearing metadata.Pawel Jakub Dawidek2010-04-151-0/+2
| | | | Notes: svn path=/head/; revision=206666
* - Back out r186038. Rather than changing the intent of the caller, the problemUlf Lilleengen2008-12-271-1/+1
| | | | | | | | | should be handled internally in gvinum. Suggested by: pjd Notes: svn path=/head/; revision=186516
* - When writing metadata to a geom provider, open the it as read-write since itUlf Lilleengen2008-12-131-1/+1
| | | | | | | | | | | | | | | | | might do subsequent reads from other providers. This stopped geli (and probably other classes using g_metadata_store as well) from being put on top of gvinum raid5 volumes. Note: The reason it fails in the gvinum raid5 case is that gvinum will read back the old parity stripe before calculating the new parity stripe to be written out again. The write will then fail because the underlying disk to be read is opened write only. MFC after: 1 week Notes: svn path=/head/; revision=186038
* Add two support functions:Marcel Moolenaar2008-06-062-0/+47
| | | | | | | | | | | | | | | | o gctl_delete_param() -- intended for parameters that are consumed by geom(8) itself and which should not be passed to the kernel. o gctl_has_param() -- intended to check if optional parameters are present. Both are needed by gpart(8) to process the optional parameter for writing bootcode to a partition (as part of the bootcode verb). However, the kernel is itself not involved in this matter and the parameter needs to be removed from the request destined for the kernel. Notes: svn path=/head/; revision=179628
* Implement gctl_change_param() function, which changes value of existingPawel Jakub Dawidek2007-01-252-0/+28
| | | | | | | | | parameter. MFC after: 1 week Notes: svn path=/head/; revision=166215
* Add __printflike() attribute to various functions.Pawel Jakub Dawidek2006-09-301-4/+4
| | | | Notes: svn path=/head/; revision=162866
* Remove trailing spaces.Pawel Jakub Dawidek2006-02-012-2/+2
| | | | Notes: svn path=/head/; revision=155175
* - The geom(8) utility only uses three types of arguments: string (char *),Pawel Jakub Dawidek2005-12-072-48/+60
| | | | | | | | | | | | | | | | | | | | value (intmax_t) and boolean (int). Based on that provide three functions: - gctl_get_ascii() - gctl_get_int() - gctl_get_intmax() - Hide gctl_get_param() function, as it is only used internally in subr.c. - Allow to provide argument name as (fmt, ...). - Assert geom(8) bugs (missing argument is a geom(8) bug). - Clean-up and simplify the code by using new functions and assumtions (no more checking for missing argument). Tested by: regression tests Notes: svn path=/head/; revision=153190
* Move function for calculating number of bits into more central place.Pawel Jakub Dawidek2005-08-192-0/+13
| | | | | | | | | I want to use it so more. MFC after: 3 days Notes: svn path=/head/; revision=149302
* MFp4: gmirror(8) is coming soon, and we need g_metadata_read() there.Pawel Jakub Dawidek2004-07-052-0/+55
| | | | Notes: svn path=/head/; revision=131603
* Implement 3 new functions:Pawel Jakub Dawidek2004-06-162-4/+77
| | | | | | | | | | | | | - g_lcm() - calculates Least Common Multiple of two given values, it is helpful when we need to find sector size for provider which is based on disks with different sector size; - g_get_mediasize() - returns media size of given provider; - g_get_sectorsize() - returns sector size of given provider; Those function aren't used now, but are used by geom_mirror which will be committed soon. Notes: svn path=/head/; revision=130591
* Bring in geom(8) utility. It is an universal utility for operating onPawel Jakub Dawidek2004-05-202-0/+285
GEOM classes. It works by loading a shared library via dlopen(3) mechanism with class-specific code, it is also responsible for communicating with GEOM via libgeom(3). Per-class shared libraries are going to be stored in /lib/geom/ directory. It provides also few standard commands like 'list', 'load' and 'unload' for existing classes which aren't aware of geom(8). More info will be send on freebsd-current@ mailing list. Supported by: Wheel - Open Technologies - http://www.wheel.pl Notes: svn path=/head/; revision=129470