git: gpt(8): Refactor and improve "expand" command

Aaron LI aly at crater.dragonflybsd.org
Wed Feb 18 06:32:41 PST 2026


commit f4b4c056f19c3b616a93bf055943a76439103be8
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Sep 1 20:43:46 2025 +0800

    gpt(8): Refactor and improve "expand" command
    
    - Use map_find()+map_add() instead of mkmap() to deal with the secondary
      GPT table.  This allows us to return mkmap() back to an
      internal/static function.
    
    - Fix the expansion of the last partition.  Correctly find the
      last-position position, instead of simply using the last-index one
      (which may not really be the ending one).
    
    - Improve space check to ensure there is free space (i.e., not used by
      any partition) for the secondary GPT table.
    
    - Other minor tweaks and cleanups.
    
    Referred-to: NetBSD's "resizedisk" command

Summary of changes:
 sbin/gpt/expand.c | 211 ++++++++++++++++++++++++++++--------------------------
 sbin/gpt/map.c    |   2 +-
 sbin/gpt/map.h    |   1 -
 3 files changed, 111 insertions(+), 103 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list