git: sys/dev/disk/dm: Remove dm_dev::dev_type

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sat Nov 26 08:06:22 PST 2016


commit 41a6832221b4d2f8b7efa1018285b8ff0f6dd7fe
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sat Nov 26 14:17:43 2016 +0900

    sys/dev/disk/dm: Remove dm_dev::dev_type
    
    This is unused, and also not necessary.
    
    dm core shouldn't need to be aware of target driver type.
    Target dependent actions are handled by target dependent handlers.
    dm targets have oop-like structure, so we don't want/need
    dm core to be able to do things like below.
    
    Also see d471f1f9 and 49784e7d.
    
    switch (dev->dev_type) {
    case DM_LINEAR_DEV:
        do_something_specific_to_linear(); break;
    case DM_STRIPE_DEV:
        do_something_specific_to_striped(); break;
    case ...:
        ...; break;
    }

Summary of changes:
 sys/dev/disk/dm/crypt/dm_target_crypt.c       |  2 +-
 sys/dev/disk/dm/delay/dm_target_delay.c       |  2 +-
 sys/dev/disk/dm/dm.h                          | 17 +----------------
 sys/dev/disk/dm/dm_table.c                    |  3 +--
 sys/dev/disk/dm/dm_target_error.c             |  2 +-
 sys/dev/disk/dm/dm_target_zero.c              |  2 +-
 sys/dev/disk/dm/flakey/dm_target_flakey.c     |  2 +-
 sys/dev/disk/dm/linear/dm_target_linear.c     |  2 +-
 sys/dev/disk/dm/mirror/dm_target_mirror.c     |  2 +-
 sys/dev/disk/dm/snapshot/dm_target_snapshot.c |  4 ++--
 sys/dev/disk/dm/striped/dm_target_striped.c   |  2 +-
 11 files changed, 12 insertions(+), 28 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/41a6832221b4d2f8b7efa1018285b8ff0f6dd7fe


-- 
DragonFly BSD source repository



More information about the Commits mailing list