aboutsummaryrefslogtreecommitdiff
path: root/lib/libgeom/libgeom.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b3e7694832e8)
* spdx: The BSD-3-Clause-FreeBSD identifier never was, drop -FreeBSDWarner Losh2023-07-251-1/+1
| | | | | | | | | | | There never was a BSD-3-Clause-FreeBSD SPDX identifier. Replace it with BSD-3-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix (cherry picked from commit eb8f887758f31f605829c995ce71a627dec0838a)
* GEOM: Introduce partial confxml APIAlexander Motin2022-05-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Traditionally the GEOM's primary channel of information from kernel to user-space was confxml, fetched by libgeom through kern.geom.confxml sysctl. It is convenient and informative, representing full state of GEOM in a single XML document. But problems start to arise on systems with hundreds of disks, where the full confxml size reaches many megabytes, taking significant time to first write it and then parse. This patch introduces alternative solution, allowing to fetch much smaller XML document, subset of the full confxml, limited to 64KB and representing only one specified geom and optionally its parents. It uses existing GEOM control interface, extended with new "getxml" verb. In case of any error, such as the buffer overflow, it just transparently falls back to traditional full confxml. This patch uses the new API in user-space GEOM tools where it is possible. Reviewed by: imp MFC after: 2 month Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D34529 (cherry picked from commit 7f16b501e25b6c792fefc4535e0d1b8363392fe0)
* GEOM: Introduce gctl_add_param() API.Alexander Motin2022-04-061-0/+2
| | | | | | | | | | | Make gctl_add_param() API public, allowing more precise control over parameter flags. Previously it was impossible to properly declare write-only ASCII parameters, used for result reporting, they were declared as read-write binary instead, that was not nice. MFC after: 1 month (cherry picked from commit 2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc)
* [skip ci] correct a few SPDX license tagsAlan Somers2021-07-271-1/+1
| | | | | | | | | | These were all incorrectly labeled as 2-clause BSD licenses by a semi-automated process, when in fact they are 3-clause. Discussed with: pfg, imp Sponsored by: Axcient (cherry picked from commit 3874c0abb0afaea6adc24ac96dc9dc5043f2b69e)
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-261-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified 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=326219
* Since there's no defined schema for the XML that's generated by theScott Long2013-07-191-0/+4
| | | | | | | | | | | | kern.geom.confxml sysctl, it's silly to warn about tags in libgeom, especially since libgeom exists simply to build a tree out of the conf information. Obtained from: Netflix MFC after: 3 days Notes: svn path=/head/; revision=253469
* Back out r233646. Although it fixed most libgeom consumers under 32-bitJuli Mallett2012-04-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | compatibility, it broke programs using devstat, under 32-bit compatibility and not. It's very difficult to fix the identifiers used by devstat, so this change is simply being backed out. Since changes to 3rd-party code seem likely, and may be necessary to properly fix 32-bit binaries on 64-bit kernel, it would seem better to make more invasive changes to fix GEOM's problems with 32-bit compatibility in general. The right thing to do is to replace all of the use of pointers as opaque identifiers with a fixed-size (64-bit or even 32-bit should be enough for tracking unique GEOM elments) field. That probably maintains source compatibility with most GEOM consumers, and allows xml2tree to make better assumptions about how to decode the identifiers. Submitted by: Anton Yuzhaninov Notes: svn path=/head/; revision=234107
* Fix 32-bit libgeom consumers run on 64-bit kernels with COMPAT_FREEBSD32.Juli Mallett2012-03-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel pointer values are used as opaque unique identifiers, which are then used to reconstruct references between various providers, classes, etc., inside libgeom from the source XML. Unfortunately, they're converted to pointer-width integers (in the form of pointers) to do this, and 32-bit userland pointers cannot hold sensible representations (however opaque) of 64-bit kernel pointers on all systems. In the case where the leading bits are zero and 32 distinct bits of pointer can be identified, this will happen to work. On systems where the upper 32-bits of kernel pointers are non-zero and the same for all kernel pointers, this will result in double frees and all kinds of bizarre crashes and linkage between objects inside libgeom. To mitigate this problem, treat the opaque identifiers in the XML as C strings instead, and internalize them to give unique and consistent per-object pointer values in userland for each identifier in the XML. This allows us to keep the libgeom logic the same with only minor changes to initial setup and parsing. It might be more sensible for speed reasons to treat the identifiers as numbers of a large size (uintmax_t, say) rather than strings, but strings seem fine for now. (As an added side-effect, this makes it slightly easier to identify unresolved references, but nothing has been added to inform the user of those.) Notes: svn path=/head/; revision=233646
* Expose stripe offset and stripe size through libgeom and geom(8) userlandXin LI2010-01-171-0/+4
| | | | | | | | | utilities. Reviewed by: pjd, mav (earlier version) Notes: svn path=/head/; revision=202454
* - Add a new ioctl for getting the provider name of a geom provider.Ulf Lilleengen2008-09-071-0/+2
| | | | | | | | | | | - Add a routine for looking up a device and checking if it is a valid geom provider given a partial or full path to its device node. Reviewed by: phk Approved by: pjd (mentor) Notes: svn path=/head/; revision=182843
* Remove parameter names from prototypes to avoid namespace issues.Dag-Erling Smørgrav2007-05-061-22/+22
| | | | Notes: svn path=/head/; revision=169305
* Implement and document some utility functions that can be used to communicatePawel Jakub Dawidek2007-05-061-0/+11
| | | | | | | | | with GEOM providers. OK'ed by: phk Notes: svn path=/head/; revision=169299
* Make libgeom usable by C++ programs:John Baldwin2004-03-091-37/+43
| | | | | | | | | | | | | - Add DECL wrappers to libgeom.h. - Rename structure members in libgeom.h to use a lg_ prefix for member names. This is required because a few structures had members named 'class' which made g++ very unhappy. - Catch gstat(8) and gconcat(8) up to these API changes. Reviewed by: phk Notes: svn path=/head/; revision=126786
* Add the part of the last commit which cvs appearantly didn't likePoul-Henning Kamp2003-06-011-1/+1
| | | | | | | the first time. Notes: svn path=/head/; revision=115625
* Collapse the meta arguments into normal arguments, trying to distinguishPoul-Henning Kamp2003-04-221-2/+0
| | | | | | | just makes our own life harder. Notes: svn path=/head/; revision=113861
* Run a revision on the OAM api.Poul-Henning Kamp2003-03-271-15/+9
| | | | | | | | | | Use prefix gctl_ systematically. Add flag with access perms for each argument. Add ro/rw versions of argument building functions. General cleanup. Notes: svn path=/head/; revision=112709
* Add marshalling functions for OAM api.Poul-Henning Kamp2003-03-231-0/+23
| | | | Notes: svn path=/head/; revision=112510
* Use devstat instead of GEOM private statistics structure.Poul-Henning Kamp2003-03-181-2/+1
| | | | Notes: svn path=/head/; revision=112372
* Constify arg to geom_lookupid().Poul-Henning Kamp2003-03-171-1/+1
| | | | | | | Improve a diagnostic printf. Notes: svn path=/head/; revision=112340
* Leak more stuff into libgeom.Poul-Henning Kamp2003-02-101-0/+83
| | | | Notes: svn path=/head/; revision=110603
* Include <sys/time.h>, it's not the users problem that we use bintimePoul-Henning Kamp2003-02-081-0/+1
| | | | | | | internally. Notes: svn path=/head/; revision=110547
* Add libgeom to the system.Poul-Henning Kamp2003-02-081-0/+45
Initially this only contains the functions for accessing the I/O statistics data. Notes: svn path=/head/; revision=110545