Commit Graph

43 Commits

Author SHA1 Message Date
haad
f26bfe28da 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@
2009-12-01 23:12:09 +00:00
joerg
af76846cf3 Reduce a noise from a debug printf to debug level 2009-10-23 20:41:11 +00:00
joerg
336cbcc88d Don't spam the console with debug messages. 2009-10-16 21:23:08 +00:00
haad
76a0c0e7d2 Fix bug in kmem_alloc/kmem_free of params string. Params string was
allocated with length DM_MAX_PARAMS_SIZE and released with strlen + 1 size.

Disable KM_NOSLEEP allocation because we do not need them here there is
nothing critical in ioctl part of dm driver.

Bug reported by jak@.
2009-09-09 22:38:49 +00:00
yamt
83723a32c5 fix a comment typo. 2009-08-16 11:02:24 +00:00
haad
a1f246d056 Remove unneeded targets from build. Should fix brekage of ALL kernel build
found by cegger@.
2009-06-28 22:05:07 +00:00
jakllsch
f6c1b3e09a Some fixes for dm(4).
- Limit accesses to the size of the volume.
   This fixes a KASSERT in physio_biodone().
 - Change dm_table_size() to return the size of the volume in
   DEV_BSIZE units.  It was reporting it in DEV_BSIZE^2 units.
 - Remove a bit of trailing whitespace.

ok haad
2009-06-27 16:10:25 +00:00
cegger
f978dd86b2 buidfix: change dm_target_snapshot_orig_init() to match prototype. 2009-06-20 09:57:26 +00:00
haad
f5b48500f1 Add support for DIOCGDISKINFO to disk like device drivers. Change
partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.

No objections on tech-userlevel@.
2009-06-05 21:52:31 +00:00
haad
62e994ce96 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.
2009-06-05 19:56:40 +00:00
haad
33e2a4a918 Destroy locks in dm_dev_free, do not allocate struct disk twice. 2009-04-13 18:51:54 +00:00
haad
a650e4b356 Update to reality. 2009-04-13 16:12:27 +00:00
haad
ba7fcfeeb5 Use functions from disk(9) framework. Initialize disk/disklabel during
dm_device_create_ioctl, before calling dmgetdisklabel.
Use disk_busy/disk_unbusy in dmstrategy to display LVM LV's in iostat
output.
2009-04-06 22:58:10 +00:00
haad
57fb98e3bf Fix build on amd64. Patch sent by dieter roelants. 2009-04-06 22:48:26 +00:00
dyoung
b63bf39017 It is only by chance that this gets the prop_array_t definition that it
needs, so explicitly #include <prop/proplib.h>.
2009-03-25 23:35:54 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
agc
15de39d387 Fix tyop in previous. 2009-03-08 02:07:38 +00:00
reinoud
664af01cd8 Actually lmplement striping as LVM target. OK'd by Adam. 2009-03-07 22:17:18 +00:00
haad
50b5b59cc7 Fix lvm lvrename command. There was bug in dm_dev_lookup where
dm_dev_lookup_name was called with device uuid. Remove dm_dev_t:dk_label is
it not used anymore.
2009-03-06 16:17:29 +00:00
haad
5b244085d8 Linear target has only 2 arguments in a params string not 9. 2009-03-01 23:17:39 +00:00
haad
f8faf523ec Change comment and add description of line used to configure mirror device. 2009-03-01 23:16:51 +00:00
haad
f048f56f71 Add initial support for striping target, hardcode maximal number of stripes
to 2 for now. strategy routine must be written, for now only parsing and
support routines are available. This is work in progress code and should be
taken very carefully.
2009-03-01 23:15:56 +00:00
haad
e654dd3da2 Call dm_target_busy only on properly autoloaded module. 2009-02-20 11:14:11 +00:00
haad
9629be83bf Release tables before we drop reference on device, now creating device with
nonexistent target fails and not ends with deadlock.
2009-02-20 11:12:30 +00:00
haad
d624725a46 In NetBSD our target modules are called with prefix dm_target_. Add this
prefix to target module name when loading module, lvm2tools uses linux
target names e.g. zero not dm_target_zero.
2009-02-19 23:20:27 +00:00
haad
17599f37f3 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).
2009-02-19 23:07:32 +00:00
agc
dc733729ad Move back to printing the minor device as a 32-bit entity 2009-01-22 04:56:06 +00:00
haad
d80238dac9 Add struct disk to dm_dev so our LV will beshowed in iostat output. 2009-01-16 11:19:02 +00:00
haad
44e4eeea57 Disable unloading of dm driver when there are any devices defined. This means
that we have to run lvm vgchange -a n before modunload in NetBSD.

We really need to disable module unloading only for mounted devices, I have
to look at vfs_hooks for mount/umount calls and find way how to mark devices
as mounted in dm driver.
2009-01-16 00:46:12 +00:00
haad
2df042407e Add dm module as dependency and remove module_hold/module_rele calls. 2009-01-14 00:56:15 +00:00
haad
a74b9dc067 Use 64bit long minor nuber in dm_dev structure. 2009-01-11 11:54:52 +00:00
haad
ae10a6c772 Fix aprint_debug after christos-time_t merge. 2009-01-11 11:44:23 +00:00
haad
0e718155a1 Return ENOSYS during from dm_target_init routine these tow targets aren't
implemented yet.
2009-01-02 22:33:51 +00:00
haad
2a2e81e0f1 Properly register dm_target_* modules with module framework. 2009-01-02 11:06:17 +00:00
haad
894d2ad3b7 Add stubs for mirror target, too. This target does nothing for now, but lvm
tools support mirror target and trying to create LV with mirrorred backend
caused panic in dm_table_load_ioctl.
2009-01-02 11:03:24 +00:00
haad
2547289caf Add more tasks and add more details about them. 2009-01-02 01:13:49 +00:00
haad
32013fd9f2 Add stripe target functions stubs. Stripe target must be present in dm driver
because without it lvm2tools will not create LVsi and eventualy panic system.

Problem reported by agc@.
2009-01-02 00:42:31 +00:00
haad
9401ff0b03 Remove DM_TABLE_DEPS it is not used in kernel driver and it breaks build
of libdevmapper because it clashes with DM_TABLE_DEPS from dm-ioctl.h.
2008-12-22 02:20:04 +00:00
haad
1016f02c61 Remove done task and add new one. 2008-12-22 02:18:53 +00:00
haad
cca8fb31f9 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.
2008-12-21 00:59:39 +00:00
haad
38805eb14c Fix error path in target_init call. When initializing target fails i have
to release table before I try to destroy it and I haveto unbusy device, too.
2008-12-21 00:53:27 +00:00
haad
78284dcaf1 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.
2008-12-19 16:30:41 +00:00
haad
c9d0c62a0c 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@.
2008-12-19 15:24:03 +00:00