sys/dev/disk/dm: Fix sanity checks for striped target [2/4]
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 31 Oct 2015 10:57:29 +0000 (19:57 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 31 Oct 2015 16:18:22 +0000 (01:18 +0900)
commitb98113ec73748007b944a9b5ea5226d4c6d7224a
treeb2f83e9f98acd12f614b00c0f47440f393944e80
parentbab5d5107c877a0e4956692ff79ab9e65aa440f5
sys/dev/disk/dm: Fix sanity checks for striped target [2/4]

Target specific args for striped is redundant in the sense
that it has an arg for # of stripes other than the args for
actual stripe devices. These two must meet below.

((argc - 2) / 2) == # of stripe devices.

e.g.
--table '0 100 stripe1 3 10 /dev/da3 0 /dev/da4 0 /dev/da5 0'
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8 target args
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 device args
                       ^ # of stripe devices
  ((8 - 2) / 2) = 6/2 = 3
      -> 3 stripe devices (/dev/da[345])
sys/dev/disk/dm/targets/striped/dm_target_striped.c