History log of /freebsd-10.0-release/sbin/geom/misc/subr.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 226718 25-Oct-2011 pjd

If 'req' is NULL, print error on stderr.

MFC after: 3 days


# 213074 23-Sep-2010 pjd

- Simplify code by using g_*() API.
- Don't use u_char and u_int in userland.
- Change 'unsigned' to 'unsigned int'.
- Update copyright years.

MFC after: 1 week


# 209392 21-Jun-2010 ae

Check for overflow before it occurs. Also add check for
negative numbers.

Suggested by: ache
Approved by: kib (mentor)


# 209388 21-Jun-2010 ae

Remove G_TYPE_ASCLBA type and replace it with G_TYPE_STRING in gpart.
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


# 208886 07-Jun-2010 ae

bgeom(3) does strdup of param name.
Don't leak memory when deleting param from gctl_req.

Reviewed by: marcel
Approved by: mav (mentor)
MFC after: 2 weeks


# 206666 15-Apr-2010 pjd

Flush disk write cache after storing and clearing metadata.


# 186516 27-Dec-2008 lulf

- Back out r186038. Rather than changing the intent of the caller, the problem
should be handled internally in gvinum.

Suggested by: pjd


# 186038 13-Dec-2008 lulf

- When writing metadata to a geom provider, open the it as read-write since it
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


# 179628 06-Jun-2008 marcel

Add two support functions:
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.


# 166215 25-Jan-2007 pjd

Implement gctl_change_param() function, which changes value of existing
parameter.

MFC after: 1 week


# 155175 01-Feb-2006 pjd

Remove trailing spaces.


# 153190 06-Dec-2005 pjd

- The geom(8) utility only uses three types of arguments: string (char *),
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


# 149302 19-Aug-2005 pjd

Move function for calculating number of bits into more central place.
I want to use it so more.

MFC after: 3 days


# 131603 05-Jul-2004 pjd

MFp4: gmirror(8) is coming soon, and we need g_metadata_read() there.


# 130591 16-Jun-2004 pjd

Implement 3 new functions:
- 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.


# 129470 20-May-2004 pjd

Bring in geom(8) utility. It is an universal utility for operating on
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