git: sys/dev/disk/dm: Don't let targets implement deps [1/2]

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sun Oct 25 07:57:22 PDT 2015


commit 49784e7dc51eeb3484ff250260a9a924e15ca965
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sat Oct 24 18:35:47 2015 +0900

    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.

Summary of changes:
 sys/dev/disk/dm/dm.h                                  |  2 +-
 sys/dev/disk/dm/dm_ioctl.c                            |  4 ++--
 sys/dev/disk/dm/dm_target_error.c                     |  7 +++----
 sys/dev/disk/dm/dm_target_zero.c                      |  7 +++----
 sys/dev/disk/dm/targets/crypt/dm_target_crypt.c       |  7 +++----
 sys/dev/disk/dm/targets/delay/dm_target_delay.c       |  6 +++---
 sys/dev/disk/dm/targets/linear/dm_target_linear.c     |  7 +++----
 sys/dev/disk/dm/targets/mirror/dm_target_mirror.c     |  9 ++++-----
 sys/dev/disk/dm/targets/snapshot/dm_target_snapshot.c | 19 ++++++++-----------
 sys/dev/disk/dm/targets/striped/dm_target_striped.c   |  7 +++----
 10 files changed, 33 insertions(+), 42 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/49784e7dc51eeb3484ff250260a9a924e15ca965


-- 
DragonFly BSD source repository



More information about the Commits mailing list