git: sys/dev/disk/dm: Don't expect destroy() to set config to NULL

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Thu Nov 12 07:09:37 PST 2015


commit be52293a8c9089b5524d68c870e446c94abe5b4c
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Nov 12 20:04:43 2015 +0900

    sys/dev/disk/dm: Don't expect destroy() to set config to NULL
    
    Having a comment like below in dm core that expects programmers
    to code their dm targets in a certain way is not efficient.
    They may not read such a rule written in the source.
    
      /*
       * Remove target specific config data. After successfull
       * call table_en->target_config must be set to NULL.
       */
    
    Just check a return value of destroy() and set config to NULL
    on dm core side since it's also visible to dm core. There is
    nothing targets can/would do with the config pointer other than
    setting it to NULL considering targets have just freed it.

Summary of changes:
 sys/dev/disk/dm/dm_table.c                            | 8 +++-----
 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       | 1 -
 sys/dev/disk/dm/targets/delay/dm_target_delay.c       | 1 -
 sys/dev/disk/dm/targets/linear/dm_target_linear.c     | 2 --
 sys/dev/disk/dm/targets/mirror/dm_target_mirror.c     | 2 --
 sys/dev/disk/dm/targets/snapshot/dm_target_snapshot.c | 4 ----
 sys/dev/disk/dm/targets/striped/dm_target_striped.c   | 8 ++------
 9 files changed, 5 insertions(+), 25 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list