aboutsummaryrefslogtreecommitdiff
path: root/sbin/geom/core/geom.c
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2004-05-26 11:08:35 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2004-05-26 11:08:35 +0000
commitaf565b58fabdfdefea4fcbfdaab7971ef659be2b (patch)
tree15c707df968a1f206112aac7b7712e84b540fe3b /sbin/geom/core/geom.c
parent026afdcc05936d94343a6d0ebe407ad81124e059 (diff)
downloadsrc-af565b58fabdfdefea4fcbfdaab7971ef659be2b.tar.gz
src-af565b58fabdfdefea4fcbfdaab7971ef659be2b.zip
Print provider's size in human-readable form as well.
Notes
Notes: svn path=/head/; revision=129745
Diffstat (limited to 'sbin/geom/core/geom.c')
-rw-r--r--sbin/geom/core/geom.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c
index 963b1bc000fb..4a2d1cc9320f 100644
--- a/sbin/geom/core/geom.c
+++ b/sbin/geom/core/geom.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
#include <libgen.h>
+#include <libutil.h>
#include <inttypes.h>
#include <dlfcn.h>
#include <assert.h>
@@ -586,10 +587,13 @@ static void
show_one(struct gprovider *pp)
{
struct gconfig *conf;
+ char buf[5];
printf(" NAME: %s\n", pp->lg_name);
printf(" geom name: %s\n", pp->lg_geom->lg_name);
- printf(" mediasize: %jd\n", (intmax_t)pp->lg_mediasize);
+ humanize_number(buf, sizeof(buf), (int64_t)pp->lg_mediasize, "",
+ HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
+ printf(" mediasize: %jd (%s)\n", (intmax_t)pp->lg_mediasize, buf);
printf(" sectorsize: %u\n", pp->lg_sectorsize);
printf(" mode: %s\n", pp->lg_mode);
LIST_FOREACH(conf, &pp->lg_config, lg_config) {