git: sys/dev/disk/dm: Make target's init() take argc and argv

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sat Oct 31 09:52:25 PDT 2015


commit f28e17b7b695c2cf0f1f315ca413ad708c607657
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Oct 29 02:57:10 2015 +0900

    sys/dev/disk/dm: Make target's init() take argc and argv
    
    dm core shouldn't be passing char *params to targets' init()
    because all targets are basically going to copy-paste a code
    snippet (that strseps params) from the existing targets code
    which is inefficient and should be avoided.
    
    This commit adds dm_table_init() which converts char *params
    to int argc and char **argv, and passes them to init().

Summary of changes:
 sys/dev/disk/dm/dm.h                               |  3 +-
 sys/dev/disk/dm/dm_ioctl.c                         | 44 +++++++++++++++++++-
 sys/dev/disk/dm/dm_target_error.c                  |  2 +-
 sys/dev/disk/dm/dm_target_zero.c                   |  2 +-
 sys/dev/disk/dm/targets/crypt/dm_target_crypt.c    | 47 ++++++++--------------
 sys/dev/disk/dm/targets/delay/dm_target_delay.c    | 23 +++--------
 sys/dev/disk/dm/targets/linear/dm_target_linear.c  | 20 ++-------
 sys/dev/disk/dm/targets/mirror/dm_target_mirror.c  |  4 +-
 .../disk/dm/targets/snapshot/dm_target_snapshot.c  | 28 +++----------
 .../disk/dm/targets/striped/dm_target_striped.c    | 41 ++++++++-----------
 10 files changed, 96 insertions(+), 118 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f28e17b7b695c2cf0f1f315ca413ad708c607657


-- 
DragonFly BSD source repository



More information about the Commits mailing list