Home | History | Annotate | Download | only in dm
History log of /src/sys/dev/dm/dm_target_error.c
RevisionDateAuthorComments
 1.29  21-Jan-2020  tkusumi dm: #if0 target's ->upcall() handler

This is part of NetBSD's dm design, but unimplemented
(all handlers return 0) and also unused.
 1.28  23-Dec-2019  tkusumi branches: 1.28.2;
dm: Make target's ->table() optional

Since ->info() (counter part of ->table() in the original dm design
in Linux kernel in .status where both INFO and TABLE are optional)
is an optional handler, make ->table() optional as well. Some
targets don't have anything to do in ->table() just as in ->info().

taken-from: DragonFlyBSD
 1.27  21-Dec-2019  tkusumi dm: Remove target's ->deps() by implementing deps in dm core

Retrieving device dependencies doesn't need to be target specific.
The reason it currently needs ->deps() is because dm core doesn't
have data structure that allows table to walk through target's
underlying devices. Add struct dm_mapping to be able to do this,
and remove ->deps()'s from targets which basically do the same thing.

=====(A) before this commit
table
| [dm core]
-------------------------------------------------------
| pdev pdev pdev [dm targets]
v ^ ^ ^
target----/---------/---------/
(void*)

=====(B) this commit
table---->mapping-->mapping-->mapping-->...
| | | |
| v v v [dm core]
-------------------------------------------------------
| pdev pdev pdev [dm targets]
v ^ ^ ^
target----/---------/---------/
(void*)

taken-from: DragonFlyBSD
 1.26  18-Dec-2019  tkusumi dm: Test # of args in target's ->init()

The # of args is part of target's spec.
Both Linux kernel and DragonFlyBSD test argc on ctr/init.
 1.25  16-Dec-2019  tkusumi dm: Enable dm-error and dm-zero target

Add these two targets to dm.kmod.
These are generally available in Linux and DragonFlyBSD,
so enable them in NetBSD as well.
 1.24  15-Dec-2019  tkusumi dm: Style cleanups (no functional changes)
 1.23  15-Dec-2019  tkusumi dm: Make targets' ->sync() optional

Apparently some targets have nothing to sync, so make it optional.
 1.22  15-Dec-2019  tkusumi dm: Make targets' ->secsize() optional

and make a caller assume secsize 0 if ->secsize not present.
This allows a dummy function to be removed which was added in
"dm: Add dummy target ->sync()/->secsize() to prevent panic on modload(8)".
 1.21  15-Dec-2019  tkusumi dm: Rename targets' ->status() to ->table() given ->info() exists

Since now that dm targets in NetBSD have ->info() for "status",
->status() should be renamed to ->table() for "table",
given how dm target status was originally designed in Linux kernel.

taken-from: DragonFlyBSD
 1.20  14-Dec-2019  tkusumi dm: Remove unconditional debug prints in targets' ->strategy()

Having debug prints in ->strategy() by default just to tell ->strategy()
is called is overkill.
taken-from: DragonFlyBSD
 1.19  12-Dec-2019  tkusumi dm: Make target's ->init() take parsed argc and argv

This gets rid of the same parser code in each target using strsep(3).
taken-from: DragonFlyBSD
 1.18  08-Dec-2019  tkusumi dm: Add dummy target ->sync()/->secsize() to prevent panic on modload(8)

dm_target_insert() has assertions to ensure targets implement all handlers.
Adding dummy ones at least prevents panic on modload(8).
 1.17  08-Dec-2019  tkusumi dm: Refactor target's ->init() i/f

Take dm_table_entry_t* instead of void**.
Remove dm_dev_t* unneeded by target code.
No functional change, but for future changes.

taken-from: DragonFlyBSD
 1.16  07-Dec-2019  tkusumi dm: Fix strange pointer declarations

Should be "type *name" or "type* name", but not "type * name".
taken-from: DragonFlyBSD
 1.15  06-Dec-2019  tkusumi dm: Don't ignore dm_target_alloc() argument

dm_target_alloc() is supposed to be copying the name argument to its ->name.
taken-from: DragonFlyBSD
 1.14  05-Dec-2019  tkusumi dm: Make dm core set config to NULL after destroy

Just let dm core do this instead of having a comment expecting each
target to do the right thing.

taken-from: DragonFlyBSD
 1.13  01-Dec-2019  tkusumi dm: Remove unused dm_dev::dev_type

Given OOP-like architecture of dm target device structure,
dm_dev doesn't need to have self contained target type field,
and in fact this is unused.
 1.12  05-Jan-2018  christos branches: 1.12.4;
use some size_t, add whitespace between functions, rcsids.
 1.11  18-May-2010  haad Add support for DIOCCACHESYNC ioctl for dm devices. Add new sync function
pointer to dm_target_t because that is the only part of dm which know real
block device. disk_ioctl_switch parses whole device table and for every
entry it calls particular sync routine which propagates DIOCCACHESYNC
to real disk.

While I was here implement some KNF fixes and remove unneeded symbols from
dm.h.

Problem reported on port-xen@ by Hugo Silva.
 1.10  04-Jan-2010  haad branches: 1.10.2; 1.10.4;
Indent files remove unnecessary blank lines, white spaces and KNFize code.
 1.9  01-Dec-2009  haad Revert my commit which have added knowledge about dm targets to libdevmapper,
this breaks abstraction. Because only lvmtools/lvmlib and device-mapper can
have knowledge about target mapping and libdevmapper only passes requests
from lvmtools to kernel and back. Bump major library and driver version.

Requested by: yamt@
 1.8  05-Jun-2009  haad Parse dm param string in libdevmapper and not in a dm target init function.
Create proplib param dictionary entry in libdevmapper and pass it to dm in
dm_ioctl dict.
Param target is then passed to target init function, where is parse. I like
this aproach much better than passing char **argv and trusting to user input.

I have bumped minor lib/driver version.

XXX. Add more sanity checks in kernel.
 1.7  19-Feb-2009  haad branches: 1.7.2;
Add support for autoloading of device-mapper targets modules. Add
dm_target_autoload function which tries to load target module. Fix two
deadlocks in dm_table_load_ioctl error path(I forgot to call dm_dev_unbusy).
 1.6  14-Jan-2009  haad branches: 1.6.2; 1.6.4; 1.6.6;
Add dm module as dependency and remove module_hold/module_rele calls.
 1.5  02-Jan-2009  haad Properly register dm_target_* modules with module framework.
 1.4  21-Dec-2008  haad Add support for loading dm targets as separate modules. All targets except
linear can be loaded as module. Module is not loaded when there is target
with similar name already. Zero and error targets aresimple examples how
can be all future targets written to support dynamic loading. Target can't
be unloaded until there is at least one user.
 1.3  19-Dec-2008  haad Add infrastructure needed to load device-mapper targets as modules.
Targets wasn't converted yet and at least snapshot target will be converted
in a near future.
 1.2  19-Dec-2008  haad Merge the haad-dm branch to -current. This branch adds LVM functionality to
the base NetBSD system. It uses Linux LVM2 tools and our BSD licensed
device-mapper driver.

The device-mapper driver can be used to create virtual block devices which
maps virtual blocks to real with target mapping called target. Currently
these targets are available a linear, zero, error and a snapshot (this is
work in progress and doesn't work yet).

The lvm2tools adds lvm and dmsetup binary to based system, where the lvm
tool is used to manage and administer whole LVM and the dmestup is used to
communicate iwith device-mapper kernel driver. With these tools also
a libdevmapper library is instaled to the base system.

Building of tools and driver is currently disable and can be enabled with
MKLVM=yes in mk.conf. I will add sets lists and rc.d script soon.

Oked by agc@ and cube@.
 1.1  07-Jul-2008  haad branches: 1.1.2;
Add dmgetdefaultdisklabel to get virtual disklabel for Logical Volume device. Add snapshot targets (snapshot, snapshot-origin), add dm_type to dm_dev structure to identify type of device. e.g. we can have mirrored disk device with snapshot on them and spare disk on them. When driver want to work with snapshot devices, it looks to upcalls list and finds all DM_SNAPSHOT devices.
 1.1.2.9  05-Nov-2008  haad Fix copyright in TNF licenses.
 1.1.2.8  02-Nov-2008  haad Use typedef in all structures in dm driver and use them in source code.
No functional change expected.
 1.1.2.7  11-Sep-2008  haad Add new dm_target_*_deps function which will get all dependiences from
selected target. It is used to get device dependencies during
dm_table_deps_ioctl. Remove dm_dev::pdevs list which was really hard to
manage and wasn't use for anything usefull.
 1.1.2.6  03-Sep-2008  haad Remove unneeded includes.
 1.1.2.5  19-Aug-2008  haad Add $NetBSD$ tag to all dm driver sources.
 1.1.2.4  02-Aug-2008  haad Add status functions for zero, error targets these routines are not needed
here, but I want to be consistent (I already define dm_target_*_init).
 1.1.2.3  22-Jul-2008  haad Change parsing of parameter string. Remove knowledge about pramaer string
from dm_table_load_ioctl and move it to target_init routines. Parameter
string is targets specific and therefore only target routine know how to
parse it correctly. Remove unneeded parameter from dm_target_*_init(argc)
and change dm target routines accordingly.

Simplify dm_table_load_ioctl and move pdev inserting code to target init
funstions.
 1.1.2.2  19-Jul-2008  haad *** empty log message ***
 1.1.2.1  07-Jul-2008  haad Import of device-mapper driver. This driver is BSD rewrite of linux dm driver.
For now only error, linear and zero targets are supported. This driver uses NetBSD
specific ioctl protocola based on proplib.

I was able to create logical volume (with lvm2tools lvcreate utility) with this
version of driver, newfs it and mount it.
 1.6.6.2  23-Jul-2009  jym Sync with HEAD.
 1.6.6.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.6.4.3  03-Mar-2009  skrll Sync with HEAD.
 1.6.4.2  19-Jan-2009  skrll Sync with HEAD.
 1.6.4.1  14-Jan-2009  skrll file dm_target_error.c was added on branch nick-hppapmap on 2009-01-19 13:17:53 +0000
 1.6.2.2  17-Jan-2009  mjf Sync with HEAD.
 1.6.2.1  14-Jan-2009  mjf file dm_target_error.c was added on branch mjf-devfs2 on 2009-01-17 13:28:53 +0000
 1.7.2.5  11-Aug-2010  yamt sync with head.
 1.7.2.4  11-Mar-2010  yamt sync with head
 1.7.2.3  20-Jun-2009  yamt sync with head
 1.7.2.2  04-May-2009  yamt sync with head.
 1.7.2.1  19-Feb-2009  yamt file dm_target_error.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:36 +0000
 1.10.4.1  30-May-2010  rmind sync with head
 1.10.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.12.4.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.28.2.1  25-Jan-2020  ad Sync with head.

RSS XML Feed