Commit Graph

74 Commits

Author SHA1 Message Date
haad
08d72eb06c I have forgot to fix dm_dev_counter here, too. 2010-12-06 09:12:23 +00:00
haad
e52bc34bd3 We don't need 64 bit variable for dm_device coutner, too. 2010-12-06 09:03:40 +00:00
haad
50cad777f0 Add comment about dm_dev minor, and change it to 32bit value we realy not
going to use so much device minor numbers.
2010-12-06 08:54:49 +00:00
dholland
8f6ed30d57 Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
2010-11-19 06:44:33 +00:00
uebayasi
0666f65e61 curlwp needs sys/lwp.h. 2010-11-15 05:52:41 +00:00
haad
1a571ae457 Add old file describing locking schema used in dm driver. 2010-10-23 21:18:54 +00:00
haad
2b4880da46 In rome do as romans do. If I will get EEXIST from devsw_attach don't exit and
continue. This unbreaks usage of libdm in RUMP.
2010-10-09 12:56:06 +00:00
pgoyette
23d5409e7e Update the rest of the kernel to conform to the module subsystem's new
locking protocol.
2010-08-21 13:19:39 +00:00
haad
58b6472739 Add multi device strip support written by Guillermo Amaral and reviewed by me. 2010-05-18 15:10:41 +00:00
haad
fb8751aba4 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.
2010-05-18 15:10:38 +00:00
haad
c8688b58cc Fix typo in comment. 2010-05-18 15:01:17 +00:00
jakllsch
c2ca7b837e Fix build of i386 ALL kernel with patch from Greg A. Woods in PR/43056. 2010-03-26 15:46:04 +00:00
jakllsch
165a0cf70b Rework module/builtin code so it works in both cases.
(Tested recently in the module case, slightly less recently as builtin.)

<haad> [if it works] go for it
2010-03-23 15:09:45 +00:00
haad
0d21743f10 Disable disk_ioctl_switch fo device-mapper control device. 2010-03-12 16:26:26 +00:00
jakllsch
dd483616f8 Use RUN_ONCE(9) again. (Everyone happy now?) 2010-02-27 00:31:57 +00:00
jakllsch
7d0469d4c4 Use correct prototype for dmattach(). 2010-02-26 23:52:43 +00:00
haad
58c910bce8 Fix device-mapper to work in builtin case. This commit fixes
PR: 42799

REwork fix commited by jak@ to be more readable and remove unneeded ifdef _MODULE.
2010-02-25 23:37:39 +00:00
jakllsch
6fc9836341 Be sure to config_cfattach_attach() in dmattach().
Loosely based on patch from Brian Brombacher,
with other inspriation from vnd(4).

This should fix PR kern/42799.

While here, a few prototype, style and namespace pollution-related changes.
2010-02-25 20:48:58 +00:00
pooka
5b81af7179 Fix this for non-module (which, i guess, is only i386/ALL).
XXX: autoconfusion vs. modules is an intolerable mess of stepping
on each others' toes.
2010-01-08 00:27:48 +00:00
haad
293fc00622 Indent files remove unnecessary blank lines, white spaces and KNFize code. 2010-01-04 00:12:22 +00:00
haad
66ff911808 Refactor dmioctl to by cleaner and to copyout dictionary in case when something
went wrong.
2010-01-03 22:55:25 +00:00
haad
c52cab8857 KNF police, remove unnecessary whitespaces and tabulators. Refactor dmioctl
to not use prop_dictionary_copy* functions if NetBSD_DM_IOCTL command was
not called on device. If disk_ioctl returms anything else then ENOTTY exit
from dmioctl.
2010-01-03 22:44:10 +00:00
haad
b9ba4842ce Hook device-mapper to autoconf framework. Add dm_attach, dm_match and dm_detach
routines used by autoconf users. Change dm_dev_remove_ioctl to call dm_detach.

This should be primary used by kernel to disable devices during shutdown of
system with nested disk devices.

Requested by dyoung@.
2010-01-03 22:22:23 +00:00
haad
22c533e1d0 Replace aprint_Verbose with aprint_debug to shutup unnecessary logs. 2010-01-03 12:53:00 +00:00
haad
36fe06980c Add private lock to dm_dev_t used for mutual exclusion for diks(9) api
routines. This change fixes PR kern/42532.
2009-12-29 23:37:47 +00:00
haad
8181298188 Add support for DM_QUERY_INACTIVE_TABLE_FLAG to dm_table_status and dm_table_deps
this flag was introduced to dm->lvm protocol in 4.16.0 version of it. Restore
vrsion check functionality and sent back actual kernel driver version.
2009-12-06 14:33:46 +00:00
haad
676cba4177 Make our driver version equal to linux driver. 2009-12-06 14:31:16 +00:00
haad
79ad9d0df4 Install netbsd-dm.h file to include/dev/dm so it can be used by public. 2009-12-05 11:34:37 +00:00
haad
bd8ee331ed Include only user-kernel communication protocol related information in this header. 2009-12-05 11:30:26 +00:00
haad
ca10901dd8 Remove wrong TODO item, it violates abstraction between kernel-libdevmapper
and lvm tools.
2009-12-05 01:25:12 +00:00
haad
8f50b1a274 Fix bug in dm_table_resume_ioctl where dmv->flags was sent back to libdevmapper
except flags variable. This fixes weird behaviour, when worng links to
devices in /dev/mapper were created after lvrename/lvresize.
2009-12-05 01:21:41 +00:00
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