sys/dev/disk/dm: Don't let targets implement deps [1/2]
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 24 Oct 2015 09:35:47 +0000 (18:35 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 25 Oct 2015 09:20:51 +0000 (18:20 +0900)
commit49784e7dc51eeb3484ff250260a9a924e15ca965
treee04d5012b3db40189eae5159d5607677f9080154
parent2d59555fe73022cdef5562ac2ea746158ca0f15c
sys/dev/disk/dm: Don't let targets implement deps [1/2]

As mentioned in 66fee7cc, each dm target implementing its deps
ioctl handler is inefficient and error prone since each handler
is going to be just a copy pasted code from other target for
its underlying device(s).

The way dm computes device dependencies (i.e. deps handler)
shouldn't be targets specific in the first place. The problem
here is that dm table (struct dm_table_entry) is unable to see
its underlying device(s), but only each target specific data
structure can see them. This commit and next one fix it and
enables dm core to handle dependencies without using targets
specific code.

This commit only changes API format of init handler. It needs
to pass dm table instead of device and void**, for the next
commit.
sys/dev/disk/dm/dm.h
sys/dev/disk/dm/dm_ioctl.c
sys/dev/disk/dm/dm_target_error.c
sys/dev/disk/dm/dm_target_zero.c
sys/dev/disk/dm/targets/crypt/dm_target_crypt.c
sys/dev/disk/dm/targets/delay/dm_target_delay.c
sys/dev/disk/dm/targets/linear/dm_target_linear.c
sys/dev/disk/dm/targets/mirror/dm_target_mirror.c
sys/dev/disk/dm/targets/snapshot/dm_target_snapshot.c
sys/dev/disk/dm/targets/striped/dm_target_striped.c