git: sys/dev/disk/dm: Fix/refactor alloc/free functions [3/6]

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


commit 41d37b860809ad5d2784ab444c4d392c9dd88b0b
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Wed Nov 11 19:02:10 2015 +0900

    sys/dev/disk/dm: Fix/refactor alloc/free functions [3/6]
    
    dm_dev_alloc()/free()
    * Make them static.
    * Make alloc() take name and uuid just like dm_pdev_alloc().
    * Refactoring.
    
    dm_pdev_alloc()/free()
    * Fix memory leak.
    * Rename dm_pdev_rem() to dm_pdev_free().
      A simple kfree function should be xxx_free() but not xxx_rem().
      xxx_rem() isn't necessarily a name used for just kfree() in
      other files, which makes naming very confusing.
    * Refactoring.

Summary of changes:
 sys/dev/disk/dm/dm.h      |  2 --
 sys/dev/disk/dm/dm_dev.c  | 34 +++++++++++++++++++---------------
 sys/dev/disk/dm/dm_pdev.c | 25 +++++++++++++------------
 3 files changed, 32 insertions(+), 29 deletions(-)

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


-- 
DragonFly BSD source repository



More information about the Commits mailing list