svn commit: r219373 - head/sbin/hastctl

Pawel Jakub Dawidek pjd at FreeBSD.org
Mon Mar 7 10:42:29 UTC 2011


Author: pjd
Date: Mon Mar  7 10:42:28 2011
New Revision: 219373
URL: http://svn.freebsd.org/changeset/base/219373

Log:
  Print some of the numbers in human readable form (using %N).
  
  MFC after:	2 weeks

Modified:
  head/sbin/hastctl/hastctl.c

Modified: head/sbin/hastctl/hastctl.c
==============================================================================
--- head/sbin/hastctl/hastctl.c	Mon Mar  7 10:41:12 2011	(r219372)
+++ head/sbin/hastctl/hastctl.c	Mon Mar  7 10:42:28 2011	(r219373)
@@ -213,8 +213,10 @@ dump_one(struct hast_resource *res)
 		return (ret);
 
 	printf("resource: %s\n", res->hr_name);
-	printf("    datasize: %ju\n", (uintmax_t)res->hr_datasize);
-	printf("    extentsize: %d\n", res->hr_extentsize);
+	printf("    datasize: %ju (%NB)\n", (uintmax_t)res->hr_datasize,
+	    (intmax_t)res->hr_datasize);
+	printf("    extentsize: %d (%NB)\n", res->hr_extentsize,
+	    (intmax_t)res->hr_extentsize);
 	printf("    keepdirty: %d\n", res->hr_keepdirty);
 	printf("    localoff: %ju\n", (uintmax_t)res->hr_localoff);
 	printf("    resuid: %ju\n", (uintmax_t)res->hr_resuid);
@@ -321,8 +323,9 @@ control_status(struct nv *nv)
 		    nv_get_string(nv, "provname%u", ii));
 		printf("  localpath: %s\n",
 		    nv_get_string(nv, "localpath%u", ii));
-		printf("  extentsize: %u\n",
-		    (unsigned int)nv_get_uint32(nv, "extentsize%u", ii));
+		printf("  extentsize: %u (%NB)\n",
+		    (unsigned int)nv_get_uint32(nv, "extentsize%u", ii),
+		    (intmax_t)nv_get_uint32(nv, "extentsize%u", ii));
 		printf("  keepdirty: %u\n",
 		    (unsigned int)nv_get_uint32(nv, "keepdirty%u", ii));
 		printf("  remoteaddr: %s\n",
@@ -332,8 +335,9 @@ control_status(struct nv *nv)
 		str = nv_get_string(nv, "status%u", ii);
 		if (str != NULL)
 			printf("  status: %s\n", str);
-		printf("  dirty: %ju bytes\n",
-		    (uintmax_t)nv_get_uint64(nv, "dirty%u", ii));
+		printf("  dirty: %ju (%NB)\n",
+		    (uintmax_t)nv_get_uint64(nv, "dirty%u", ii),
+		    (intmax_t)nv_get_uint64(nv, "dirty%u", ii));
 	}
 	return (ret);
 }


More information about the svn-src-head mailing list