From: Davidlohr Bueso Date: Sun, 17 Jun 2012 16:10:04 +0000 (+0200) Subject: fdisk: API: add topology debug X-Git-Tag: v2.22-rc1~261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bd9699a74687f2297b7333d09d1bb021e350a73;p=thirdparty%2Futil-linux.git fdisk: API: add topology debug Signed-off-by: Davidlohr Bueso --- diff --git a/fdisk/fdisk.h b/fdisk/fdisk.h index c645b24d55..9d17cdd76b 100644 --- a/fdisk/fdisk.h +++ b/fdisk/fdisk.h @@ -35,6 +35,7 @@ /* fdisk debugging flags/options */ #define FDISK_DEBUG_INIT (1 << 1) #define FDISK_DEBUG_CONTEXT (1 << 2) +#define FDISK_DEBUG_TOPOLOGY (1 << 3) #define FDISK_DEBUG_ALL 0xFFFF # define ON_DBG(m, x) do { \ diff --git a/fdisk/utils.c b/fdisk/utils.c index 5bb4984643..d105d8e42b 100644 --- a/fdisk/utils.c +++ b/fdisk/utils.c @@ -85,6 +85,11 @@ static int __discover_topology(struct fdisk_context *cxt) if (!cxt->phy_sector_size) /* could not discover physical size */ cxt->phy_sector_size = cxt->sector_size; + DBG(TOPOLOGY, dbgprint("topology discovered for %s:\n" + "\tlogical/physical sector sizes: %ld/%ld\n" + "\tfdisk/minimal/optimal io sizes: %ld/%ld/%ld\n", + cxt->dev_path, cxt->sector_size, cxt->phy_sector_size, + cxt->io_size, cxt->optimal_io_size, cxt->min_io_size)); return 0; }