aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/mdioctl.h
Commit message (Collapse)AuthorAgeFilesLines
* md: Add MD_MUSTDEALLOC supportKa Ho Ng2021-09-111-0/+1
| | | | | | | | | | | This adds an option to detect if hole-punching is implemented by the underlying file system. If this flag is set, and if the underlying file system does not support hole-punching, md(4) fails BIO_DELETE requests with EOPNOTSUPP. Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31883
* md(4): remove the unused and unusable MDIOCLIST ioctl.Brooks Davis2019-08-161-2/+1
| | | | | | | | | | | | | | | | | | It is unused, the ABI was broken in r322969, and it is broken by design (more than MDNPAD md devices can exist and there is no way to retreive them with this interface). mdconfig(8) was converted to use libgeom to obtain this information in r157160 and any other consumers of MDIOCLIST should likewise be converted. Reviewed by: emaste Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18936 Notes: svn path=/head/; revision=351132
* Use VOP_ADVISE() with POSIX_FADV_DONTNEED instead of IO_DIRECT toBruce Evans2018-12-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implement not double-caching for reads from vnode-backed md devices. Use VOP_ADVISE() similarly instead of !IO_DIRECT unsimilarly for writes. Add a "cache" option to mdconfig to allow changing the default of not caching. This depends on a recent commit to fix VOP_ADVISE(). A previous version had optimizations for sequential i/o's (merge the i/o's and only uncache for discontiguous i/o's and for full blocks), but optimizations and knowledge of block boundaries belong in VOP_ADVISE(). Read-ahead should also be handled better, by supporting it in md and discarding it in VOP_ADVISE(). POSIX_FADV_DONTNEED is ignored by zfs, but so is IO_DIRECT. POSIX_FADV_DONTNEED works better than IO_DIRECT if it is not ignored, since it only discards from the buffer cache immediately, while IO_DIRECT also discards from the page cache immediately. IO_DIRECT was not used for writes since it was claimed to be too slow, but most of the slowness for writes is from doing them synchronously by default. Non-synchronous writes still deadlock in many cases. IO_DIRECT only has a special implementation for ffs reads with DIRECTIO configured. Otherwise, if it is not ignored than it uses the buffer and page caches normally except for discarding everything after each i/o, and then it has much the same overheads as POSIX_FADV_DONTNEED. The overheads for reading with ffs and DIRECTIO were similar in tests of md. Reviewed by: kib Notes: svn path=/head/; revision=342297
* md_pad is used by MDIOCLIST and not available for future use.Brooks Davis2018-03-131-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=330881
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Notes: svn path=/head/; revision=326023
* Add ability to label md(4) devices.Maxim Sobolev2017-08-281-1/+2
| | | | | | | | | | | | | | | This feature comes from the fact that we rely memory-backed md(4) in our build process heavily. However, if the build goes haywire the allocated resources (i.e. swap and memory-backed md(4)'s) need to be purged. It is extremely useful to have ability to attach arbitrary labels to each of the virtual disks so that they can be identified and GC'ed if neecessary. MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D10457 Notes: svn path=/head/; revision=322969
* Add MD_VERIFY option to enable O_VERIFY in open for vnode type.Stephen J. Kiernan2017-05-311-0/+1
| | | | | | | | | | | | | | | | Add -o [no]verify option to mdconfig (and document in man page.) Implement GEOM attribute MNT::verified to ask md if the backing vnode is verified. Check for MNT::verified in cd9660 mount to flag the mount as MNT_VERIFIED if the underlying device has been verified. Reviewed by: rwatson Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D2902 Notes: svn path=/head/; revision=319358
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add "null" backend to mdconfig(8). This does exactly what the nameEdward Tomasz Napierala2013-12-041-1/+1
| | | | | | | | | | | suggests, and is somewhat useful for benchmarking. MFC after: 1 month No objections from: kib Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=258909
* Make it possible to resize md(4) devices.Edward Tomasz Napierala2012-07-071-0/+1
| | | | | | | | Reviewed by: kib Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=238215
* Fix comment.Edward Tomasz Napierala2012-01-251-1/+1
| | | | Notes: svn path=/head/; revision=230536
* Rename GEOM class kernel module g_md.ko to geom_md.ko for consistencyPawel Jakub Dawidek2005-11-111-1/+0
| | | | | | | | | | | | | with the rest. mdconfig.c: Simplify mdmaybeload() function. mdioctl.h: Removed (now unused) #define. loader.conf: Sort GEOM classes properly. OK'ed by: phk Notes: svn path=/head/; revision=152309
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139825
* Rewrite piece of code which I committed some time ago that allows toPawel Jakub Dawidek2004-12-271-2/+2
| | | | | | | | | | | | show file name for 'mdconfig -l -u <x>' command. This allows to preserve API/ABI compatibility with version 0 (that's why I changed version number back to 0) and will allow to merge this change to RELENG_5. MFC after: 5 days Notes: svn path=/head/; revision=139359
* For file backed md(4) devices output their source file viaPawel Jakub Dawidek2004-11-061-2/+2
| | | | | | | | 'mdconfig -l -u <unit>'. Bump version number, as this change breaks ABI/API. Notes: svn path=/head/; revision=137310
* - Make md(4) 64-bit clean.Pawel Jakub Dawidek2004-09-161-2/+2
| | | | | | | | | | | | After this change it should be possible to use very big md(4) devices. - Clean up and simplify the code a bit. - Use humanize_number(3) to print size of md(4) devices. - Add 't' suffix which stands for terabyte. - Make '-S' to really work with all types of devices. - Other minor changes. Notes: svn path=/head/; revision=135340
* change the name of the md module, to g_md, introduce a define with theJohn-Mark Gurney2004-08-091-0/+1
| | | | | | | name MD_MODNAME, and make mdconfig use this new define... Notes: svn path=/head/; revision=133357
* Remove advertising clause from University of California Regent's license,Warner Losh2004-04-071-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core Notes: svn path=/head/; revision=127976
* Fix a long-standing deadlock issue with vnode backed md(4) devices:Poul-Henning Kamp2004-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On vnode backed md(4) devices over a certain, currently undetermined size relative to the buffer cache our "lemming-syncer" can provoke a buffer starvation which puts the md thread to sleep on wdrain. This generally tends to grind the entire system to a stop because the event that is supposed to wake up the thread will not happen until a fair bit of the piled up I/O requests in the system finish, and since a lot of those are on a md(4) vnode backed device which is currently waiting on wdrain until a fair amount of the piled up ... you get the picture. The cure is to issue all VOP_WRITES on the vnode backing the device with IO_SYNC. In addition to more closely emulating a real disk device with a non-lying write-cache, this makes the writes exempt from rate-limited (there to avoid starving the buffer cache) and consequently prevents the deadlock. Unfortunately performance takes a hit. Add "async" option to give people who know what they are doing the old behaviour. Notes: svn path=/head/; revision=126821
* Add a couple of undocumented test options to MD(4) to aid in regressionPoul-Henning Kamp2003-04-091-1/+3
| | | | | | | testting of GEOM. Notes: svn path=/head/; revision=113289
* Add a "-S sectorsize" option to enable Kirk to find a bug :-)Poul-Henning Kamp2003-03-031-1/+2
| | | | Notes: svn path=/head/; revision=111818
* Add an ioctl to return the unit numbers of the configured md devices.Poul-Henning Kamp2003-01-271-1/+3
| | | | Notes: svn path=/head/; revision=109928
* Actually make use of the md_version field of 'struct mdio'. In orderDima Dorfman2001-12-201-1/+1
| | | | | | | | | not to needlessly break compatibility, decrement MDIOVERSION to 0. Approved by: phk Notes: svn path=/head/; revision=88249
* Introduce a force option, MD_FORCE, that instructs the driver toDima Dorfman2001-08-071-0/+1
| | | | | | | | | | | | | | | | | | | bypass some extra anti-foot-shooting measures. Currently, its only effect is to allow detaching a device while it's still open (e.g., mounted). This is useful for testing how the system reacts to a disk suddenly going away, which can happen with some removeable media. At this point, the force option is only checked on detach, so it would've been possible to allow the option to be passed with the MDIOCDETACH operation. This was not done to allow the possibility of having the force flag influence other tests in the future, which may not necessarily deal with detaching the device. Reviewed by: sobomax Approved by: phk Notes: svn path=/head/; revision=81257
* Make "md" and "mdctl" macroized parameters.Poul-Henning Kamp2001-02-251-0/+3
| | | | | | | | | Implement "-l" option to mdconfig which can list one or all md devices. Submitted by: Dima Dorfman <dima@unixfreak.org> Notes: svn path=/head/; revision=73026
* Add padding space and a version number to the md_ioctl structre for futurePoul-Henning Kamp2001-01-011-2/+7
| | | | | | | | | | | | | | | extension. Add ability to create a preload disk giving an address and a length (suggested by imp) Fix bug relating to very small md(4) devices. Update md.c copyright to reflect the status of code copied from vn.c. (noticed by dillon) Notes: svn path=/head/; revision=70573
* Add compress option at the instigation of rgrimes.Poul-Henning Kamp2000-12-311-0/+1
| | | | Notes: svn path=/head/; revision=70535
* This is repo-copied from vnioctl.hPoul-Henning Kamp2000-12-281-24/+24
| | | | Notes: svn path=/head/; revision=70451
* Fix a bug in the block number calculation for VN disks with a sectorMatthew Dillon1999-09-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | size != 512 that are configured without a label. The bug should only have effected swap-backed VN mounts without a label. Add several major features to VN. In the kernel we add a swap pre-reservation capability, which can be used to guarentee seek consistency for swap-backed VN nodes. This also incidently allows a swap-backed VN filesystem to be recovered after a crash in some cases (if the same swap blocks happen to be reserved). We also add a number of new options to vnconfig which do the work of pre-zeroing or creating/truncating/extending a file which greatly simplifies using VN in a file-backed configuration. Add FreeBSD CVS label to sys/sys/vnioctl.h, as well as a new ioctl flag for the swap pre-reservation feature. Reviewed by: Alan Cox <alc@cs.rice.edu>, David Greenman <dg@root.com> Notes: svn path=/head/; revision=51341
* Reviewed by: julian with quick glances by bruce and othersJulian Elischer1995-08-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: terry (terry lambert) This is a composite of 3 patch sets submitted by terry. they are: New low-level init code that supports loadbal modules better some cleanups in the namei code to help terry in 16-bit character support some changes to the mount-root code to make it a little more modular.. NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able to test those cases.. certainly mounting root of disk still works just fine.. mfs should work but is untested. (tomorrows task) The low level init stuff includes a total rewrite of init_main.c to make it possible for new modules to have an init phase by simply adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can be added to the kernel without editing any other files other than the 'files' file. Notes: svn path=/head/; revision=10358
* A substantial change to the way this works. Not the "TEST_LABELING" isPoul-Henning Kamp1995-03-111-2/+12
| | | | | | | a option you can turn on and of on the fly, as is debugging. Notes: svn path=/head/; revision=6998
* ioctl definitions for the vn driver.Poul-Henning Kamp1994-12-041-0/+61
Notes: svn path=/head/; revision=4963