git: sys/dev/disk/dm: Check if target has registered handlers

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Mon Nov 9 04:01:22 PST 2015


commit b4e97860a3474764daa3f436549fce625eaae357
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Mon Nov 9 19:54:55 2015 +0900

    sys/dev/disk/dm: Check if target has registered handlers
    
    Define which handlers are mandatory or optional.
    init(), destroy(), strategy() are (or should be) mandatory.
    Others aren't needed by all targets hence should be optional.
    
    Add sanity checks in dm_target_insert() to make sure targets
    have implemented and registered mandatory handlers.
    
    Cleanup struct dm_target by removing obvious comments and
    adding comments on mandatory/optional handlers.

Summary of changes:
 sys/dev/disk/dm/dm.h                                | 21 +++++++++------------
 sys/dev/disk/dm/dm_target.c                         | 13 +++++++++++++
 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     |  4 ++--
 sys/dev/disk/dm/targets/delay/dm_target_delay.c     |  6 +++---
 sys/dev/disk/dm/targets/linear/dm_target_linear.c   |  4 ++--
 sys/dev/disk/dm/targets/striped/dm_target_striped.c |  6 +++---
 8 files changed, 34 insertions(+), 24 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list