]> git.ipfire.org Git - thirdparty/util-linux.git/commit
fdisk: add device topology to the API
authorDavidlohr Bueso <dave@gnu.org>
Sun, 3 Jun 2012 18:15:17 +0000 (20:15 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Jun 2012 08:30:07 +0000 (10:30 +0200)
commite53ced85bf2dc2a9c501c9eef8681c1b2ffad5cf
treee18917c027cae4af05e2e5a4002ea6de7a5d7cf8
parent7db8141571419db9b3c15f8c787e41b8311b3a77
fdisk: add device topology to the API

This patch adds device topology discovery to the internal API. This
functionality is static only to the API and therefore hidden from general fdisk
code. Functionality itself doesn't really change, min_io_size, io_size, logical
and physical sector sizes and alignment offset are added to the fdisk_context
structure and elements are accessed from there. The logical sector size
(sector_size) is now unsigned long instead of unsigned int, this as no effect
otherwise.

A few things to notice:
 - The patch is larger than I wanted but we need to modify function parameters
   across fdisk and its labels to use the topology data from cxt-> instances.
   Hopefully this will be pretty much it regarding this kind of modifications -
   perhaps geometry will need something of the like too.

 - The -b option must override internal discovery.

 - A new helper function has added to verify if the device provides topology
   information, this replaces the 'has_topology' global variable.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
fdisk/fdisk.c
fdisk/fdisk.h
fdisk/fdiskbsdlabel.c
fdisk/fdiskdoslabel.c
fdisk/fdiskdoslabel.h
fdisk/fdisksgilabel.c
fdisk/fdisksgilabel.h
fdisk/fdisksunlabel.c
fdisk/fdisksunlabel.h
fdisk/utils.c