svn commit: r196928 - head/cddl/contrib/opensolaris/cmd/zdb

Pawel Jakub Dawidek pjd at FreeBSD.org
Mon Sep 7 14:44:05 UTC 2009


Author: pjd
Date: Mon Sep  7 14:44:04 2009
New Revision: 196928
URL: http://svn.freebsd.org/changeset/base/196928

Log:
  Teach zdb(8) how to obtain GEOM provider size.
  
  PR:		kern/133134
  Reported by:	Philipp Wuensche <cryx-freebsd at h3q.com>
  MFC after:	3 days

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Mon Sep  7 14:16:50 2009	(r196927)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Mon Sep  7 14:44:04 2009	(r196928)
@@ -1322,6 +1322,14 @@ dump_label(const char *dev)
 		exit(1);
 	}
 
+	if (S_ISCHR(statbuf.st_mode)) {
+		if (ioctl(fd, DIOCGMEDIASIZE, &statbuf.st_size) == -1) {
+			(void) printf("failed to get size of '%s': %s\n", dev,
+			    strerror(errno));
+			exit(1);
+		}
+	}
+
 	psize = statbuf.st_size;
 	psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));
 


More information about the svn-src-all mailing list