| Age | Commit message (Collapse) | Author |
|
This is part of NetBSD's dm design, but unimplemented
(all handlers return 0) and also unused.
|
|
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
|
|
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
|
|
The # of args is part of target's spec.
Both Linux kernel and DragonFlyBSD test argc on ctr/init.
|
|
Add these two targets to dm.kmod.
These are generally available in Linux and DragonFlyBSD,
so enable them in NetBSD as well.
|
|
|
|
Apparently some targets have nothing to sync, so make it 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)".
|
|
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
|
|
Having debug prints in ->strategy() by default just to tell ->strategy()
is called is overkill.
taken-from: DragonFlyBSD
|
|
This gets rid of the same parser code in each target using strsep(3).
taken-from: DragonFlyBSD
|
|
dm_target_insert() has assertions to ensure targets implement all handlers.
Adding dummy ones at least prevents panic on modload(8).
|
|
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
|
|
Should be "type *name" or "type* name", but not "type * name".
taken-from: DragonFlyBSD
|
|
dm_target_alloc() is supposed to be copying the name argument to its ->name.
taken-from: DragonFlyBSD
|
|
Just let dm core do this instead of having a comment expecting each
target to do the right thing.
taken-from: DragonFlyBSD
|
|
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.
|
|
|
|
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.
|
|
|
|
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@
|
|
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.
|
|
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).
|
|
|
|
|
|
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.
|
|
Targets wasn't converted yet and at least snapshot target will be converted
in a near future.
|
|
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@.
|