aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/vinum
Commit message (Collapse)AuthorAgeFilesLines
* gvinum: Remove kernel supportJohn Baldwin2025-01-2319-9092/+0
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D48541
* gvinum: Emit deprecation notice upon drive tastingEd Maste2025-01-201-0/+9
| | | | | | Reviewed by: phk, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38607
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-2713-13/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1615-29/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1216-16/+16
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* gvinum: correct assertionsEd Maste2023-03-212-3/+3
| | | | | | | | | | | Pointer addresses are always >= 0. Assert that the value is >= 0 instead. PR: 207855, 207856 Reviewed by: imp Reported by: David Binderman Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37677
* GEOM: Remove redundant NULL pointer check before g_free()Zhenlei Huang2022-12-283-6/+3
| | | | | | Reviewed by: melifaro, pjd, imp Approved by: kp (mentor) Differential Revision: https://reviews.freebsd.org/D37779
* vinum/geom_vinum_var.h: Fix missing linefeed in license.Pedro F. Giffuni2022-10-131-1/+2
| | | | | | | The license is still standard BSD-4-clause and the text is unmodified but add a missing linefeed for readability. No functional change.
* geom_vinum: fix set but not used warningsRobert Wing2022-04-042-6/+2
|
* GEOM: Set G_CF_DIRECT_SEND/RECEIVE for taste consumers.Alexander Motin2022-01-301-0/+1
| | | | | | | | | | All I/O requests through the taste consumers are synchronous, done with g_read_data() and without any locks held. It makes no sense to delegate the I/O to g_down/g_up threads. This removes many of context switches during disk retaste. MFC after: 2 weeks
* geom(4): Fix some of the "set but not used" warningsEdward Tomasz Napierala2021-12-187-13/+5
| | | | | | The few I've left in place look like potential bugs. Sponsored By: EPSRC
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* geom: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0110-38/+21
| | | | Notes: svn path=/head/; revision=365226
* sys/geom: consistently use _PATH_DEV instead of hardcoding "/dev/".Xin LI2020-07-091-1/+2
| | | | | | | | | Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25565 Notes: svn path=/head/; revision=363034
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Reimplement gvinum orphanization.Alexander Motin2019-12-276-8/+33
| | | | | | | | | | | | | | | | gvinum was the only GEOM class, using consumer nstart/nend fields. Making it do its own accounting for orphanization purposes allows in perspective to remove burden of that expensive for SMP accounting from GEOM. Also the previous implementation spinned in a tight event loop, waiting for all active BIOs to complete, while the new one knows exactly when it is possible to close the consumer. MFC after: 1 month Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=356108
* GEOM: Reduce unnecessary log interleaving with sbufsConrad Meyer2019-08-0713-23/+16
| | | | | | | | | | | | | | | Similar to what was done for device_printfs in r347229. Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an sbuf; documented in g_bio.9. Reviewed by: markj Discussed with: rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21165 Notes: svn path=/head/; revision=350694
* 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
* sys/geom: adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2716-0/+32
| | | | | | | | | | | | | | | 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
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-183-1/+7
| | | | | | | | | | | | | | | | | | | | 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Fix logic error in gvinum's gv_set_sd_state()Dimitry Andric2017-01-081-1/+1
| | | | | | | | | | | | | | | | | | | With clang 4.0.0, I'm getting the following warnings: sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!flags & GV_SETSTATE_FORCE) ^ ~ The logical not operator should obiously be called after masking. Reviewed by: mav, pfg MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9093 Notes: svn path=/head/; revision=311688
* Use g_wither_provider() where applicable.Alexander Motin2016-09-231-2/+1
| | | | | | | | It is just a helper function combining G_PF_WITHER setting with g_orphan_provider(). Notes: svn path=/head/; revision=306279
* sys/geom: spelling fixes in comments.Pedro F. Giffuni2016-04-292-2/+2
| | | | | | | No functional change. Notes: svn path=/head/; revision=298808
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-2/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-1/+2
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+2
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Include sys/sbuf.h directly.Andrey V. Elsukov2011-07-114-0/+6
| | | | | | | Reviewed by: pjd Notes: svn path=/head/; revision=223921
* Prevent non-aligned reading from provider while tasting. RejectAndrey V. Elsukov2011-05-252-0/+10
| | | | | | | | | | providers with unsupported sectorsize. Reported by: Joerg Wunsch MFC after: 1 week Notes: svn path=/head/; revision=222283
* - Check flag with the bitwise operator, not the logical operator.Ulf Lilleengen2010-10-012-4/+4
| | | | | | | | Submitted by: arundel MFC after: 1 week Notes: svn path=/head/; revision=213318
* - Don't return EAGAIN from gv_unload(). It was used to work around theJaakko Heinonen2010-05-104-5/+20
| | | | | | | | | | | | | | deadlock fixed in r207671. - Wait for worker process to exit at class unload. The worker process was not guaranteed to exit before the linker unloaded the module. - Use 0 as the worker process exit status instead of ENXIO and style the NOTREACHED comment. Reviewed by: lulf X-MFC after: r207671 Notes: svn path=/head/; revision=207878
* - Remove obsolete flags.Ulf Lilleengen2010-05-081-6/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=207789
* - Set missing flag when initiating a plex rebuild with the rebuildparityUlf Lilleengen2010-03-081-0/+15
| | | | | | | | | command. - Check if plex is already syncing or rebuilding before initiating a parity rebuild or check. Notes: svn path=/head/; revision=204886
* Remove some pointless variable assignments.Edward Tomasz Napierala2010-01-252-4/+1
| | | | | | | Found with: clang Notes: svn path=/head/; revision=202974
* - Improve error message consistency and wording.Ulf Lilleengen2009-10-056-21/+21
| | | | Notes: svn path=/head/; revision=197767
* - Fix the issue with read access count modification on RAID-5 plexes properly.Ulf Lilleengen2009-07-181-4/+6
| | | | | | | | | | | | If the access counts were not increased and decreased in equal numbers by gvinum consumers, the read access count would be inconsistent with the write access count. Instead, modify the read access count with the write access count directly to prevent any inconsistencies. Approved by: re (kib) Notes: svn path=/head/; revision=195752
* Place hostnames and similar information fully under the prison system.Jamie Gritton2009-05-292-5/+2
| | | | | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor) Notes: svn path=/head/; revision=193066
* - Split up the BIO queue into a queue for new and one for completed requests.Ulf Lilleengen2009-05-065-86/+98
| | | | | | | | | | | | | | | | | | | | | | | This is necessary for two reasons: 1) In order to avoid collisions with the use of a BIOs flags set by a consumer or a provider 2) Because GV_BIO_DONE was used to mark a BIO as done, not enough flags was available, so the consumer flags of a BIO had to be misused in order to support enough flags. The new queue makes it possible to recycle the GV_BIO_DONE flag into GV_BIO_GROW. As a consequence, gvinum will now work with any other GEOM class under it or on top of it. - Use bio_pflags for storing internal flags on downgoing BIOs, as the requests appear to come from a consumer of a gvinum volume. Use bio_cflags only for cloned BIOs. - Move gv_post_bio to be used internally for maintenance requests. - Remove some cases where flags where set without need. PR: kern/133604 Notes: svn path=/head/; revision=191856
* - Fix a case where a RAID5 volume would think that it is supposed to grow a newUlf Lilleengen2009-05-061-2/+1
| | | | | | | subdisk after a parity rebuild. Notes: svn path=/head/; revision=191855
* - Check if any plexes are doing internal maintenance before removing them.Ulf Lilleengen2009-05-061-0/+7
| | | | Notes: svn path=/head/; revision=191854
* - Add forgotten KASSERT.Ulf Lilleengen2009-05-061-0/+1
| | | | Notes: svn path=/head/; revision=191853
* - Fix a bug where the bio_data field of the wrong BIO is freed if an errorUlf Lilleengen2009-05-061-1/+1
| | | | | | | occurs when doing a RAID5 request. Notes: svn path=/head/; revision=191852
* - GV_BIO_RETRY is not used, and it is actually impossible with more than 8Ulf Lilleengen2009-05-061-1/+0
| | | | | | | values for bio_cflags/bio_pflags. Notes: svn path=/head/; revision=191850
* - Split the queue mutex into one for the event queue and one for the BIO queue,Ulf Lilleengen2009-05-065-39/+60
| | | | | | | | | | as they do not really relate and to prepare for an additional queue to be covered by the BIO queue mutex. - Implement wrappers for fetching the next element from the event queue as well as for putting a new element into the BIO queue. Notes: svn path=/head/; revision=191849
* - Make the gvinum softc invisible to userland, as it is not needed.Ulf Lilleengen2009-05-041-5/+1
| | | | Notes: svn path=/head/; revision=191787
* - Remove assertion of topology lock remaining from 7.x gvinum. It is not needed,Ulf Lilleengen2009-04-182-4/+2
| | | | | | | | | as the renaming only changes internal gvinum names and will not alter the geom topology. - The topology lock was not held when calling g_wither_geom after renaming. Notes: svn path=/head/; revision=191248
* - Move out allocation part of different gvinum objects into its own routine andUlf Lilleengen2009-04-102-28/+76
| | | | | | | make use of it in the gvinum userland code. Notes: svn path=/head/; revision=190881
* - Add files that should have been added in r190507.Ulf Lilleengen2009-03-282-0/+831
| | | | Notes: svn path=/head/; revision=190513