History log of /freebsd-current/sys/sys/mdioctl.h
Revision Date Author Comments
# 09647430 28-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

sys/sys: Remove some more vestiges of the $FreeBSD$

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42824


# 29363fb4 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 3703c188 11-Sep-2021 Ka Ho Ng <khng@FreeBSD.org>

md: Add MD_MUSTDEALLOC support

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


# dcb235ab 16-Aug-2019 Brooks Davis <brooks@FreeBSD.org>

md(4): remove the unused and unusable MDIOCLIST ioctl.

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


# 9e5ed859 21-Dec-2018 Bruce Evans <bde@FreeBSD.org>

Use VOP_ADVISE() with POSIX_FADV_DONTNEED instead of IO_DIRECT to
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


# c92c85ff 13-Mar-2018 Brooks Davis <brooks@FreeBSD.org>

md_pad is used by MDIOCLIST and not available for future use.

MFC after: 1 week


# 51369649 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys: further adoption of SPDX licensing ID tags.

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.


# f7ca2bbe 28-Aug-2017 Maxim Sobolev <sobomax@FreeBSD.org>

Add ability to label md(4) devices.

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


# 9a81ba0f 31-May-2017 Stephen J. Kiernan <stevek@FreeBSD.org>

Add MD_VERIFY option to enable O_VERIFY in open for vnode type.
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


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

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


# 0efd9bfd 04-Dec-2013 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add "null" backend to mdconfig(8). This does exactly what the name
suggests, and is somewhat useful for benchmarking.

MFC after: 1 month
No objections from: kib
Sponsored by: The FreeBSD Foundation


# dc604f0c 07-Jul-2012 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make it possible to resize md(4) devices.

Reviewed by: kib
Sponsored by: FreeBSD Foundation


# 5ad58319 25-Jan-2012 Edward Tomasz Napierala <trasz@FreeBSD.org>

Fix comment.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# d9414258 11-Nov-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Rename GEOM class kernel module g_md.ko to geom_md.ko for consistency
with the rest.

mdconfig.c: Simplify mdmaybeload() function.
mdioctl.h: Removed (now unused) #define.
loader.conf: Sort GEOM classes properly.

OK'ed by: phk


# 60727d8b 06-Jan-2005 Warner Losh <imp@FreeBSD.org>

/* -> /*- for license, minor formatting changes


# 88b5b78d 27-Dec-2004 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Rewrite piece of code which I committed some time ago that allows to
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


# 61a6eb62 06-Nov-2004 Pawel Jakub Dawidek <pjd@FreeBSD.org>

For file backed md(4) devices output their source file via
'mdconfig -l -u <unit>'.
Bump version number, as this change breaks ABI/API.


# b830359b 16-Sep-2004 Pawel Jakub Dawidek <pjd@FreeBSD.org>

- Make md(4) 64-bit clean.
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.


# a246f097 09-Aug-2004 John-Mark Gurney <jmg@FreeBSD.org>

change the name of the md module, to g_md, introduce a define with the
name MD_MODNAME, and make mdconfig use this new define...


# 82c6e879 06-Apr-2004 Warner Losh <imp@FreeBSD.org>

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core


# 7a6b2b64 10-Mar-2004 Poul-Henning Kamp <phk@FreeBSD.org>

Fix a long-standing deadlock issue with vnode backed md(4) devices:

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.


# 4e8bfe14 09-Apr-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Add a couple of undocumented test options to MD(4) to aid in regression
testting of GEOM.


# ebe789d6 03-Mar-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Add a "-S sectorsize" option to enable Kirk to find a bug :-)


# b6532aa9 27-Jan-2003 Poul-Henning Kamp <phk@FreeBSD.org>

Add an ioctl to return the unit numbers of the configured md devices.


# 53d745bc 19-Dec-2001 Dima Dorfman <dd@FreeBSD.org>

Actually make use of the md_version field of 'struct mdio'. In order
not to needlessly break compatibility, decrement MDIOVERSION to 0.

Approved by: phk


# 26a0ee75 07-Aug-2001 Dima Dorfman <dd@FreeBSD.org>

Introduce a force option, MD_FORCE, that instructs the driver to
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


# 174b5e9a 25-Feb-2001 Poul-Henning Kamp <phk@FreeBSD.org>

Make "md" and "mdctl" macroized parameters.

Implement "-l" option to mdconfig which can list one or all md devices.

Submitted by: Dima Dorfman <dima@unixfreak.org>


# e06b153a 01-Jan-2001 Poul-Henning Kamp <phk@FreeBSD.org>

Add padding space and a version number to the md_ioctl structre for future
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)


# e33941c7 31-Dec-2000 Poul-Henning Kamp <phk@FreeBSD.org>

Add compress option at the instigation of rgrimes.


# e159de56 28-Dec-2000 Poul-Henning Kamp <phk@FreeBSD.org>

This is repo-copied from vnioctl.h


# 447deba3 16-Sep-1999 Matthew Dillon <dillon@FreeBSD.org>

Fix a bug in the block number calculation for VN disks with a sector
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>


# 2b14f991 28-Aug-1995 Julian Elischer <julian@FreeBSD.org>

Reviewed by: julian with quick glances by bruce and others
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.


# 5511b2e4 11-Mar-1995 Poul-Henning Kamp <phk@FreeBSD.org>

A substantial change to the way this works. Not the "TEST_LABELING" is
a option you can turn on and of on the fly, as is debugging.


# 6f6b3f76 04-Dec-1994 Poul-Henning Kamp <phk@FreeBSD.org>

ioctl definitions for the vn driver.