Teach zdb(8) how to obtain GEOM provider size.

PR:		kern/133134
Reported by:	Philipp Wuensche <cryx-freebsd@h3q.com>
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2009-09-07 14:44:04 +00:00
parent 841bcfea21
commit 544bf7f165

View File

@ -1322,6 +1322,14 @@ dump_label(const char *dev)
exit(1); 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 = statbuf.st_size;
psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t)); psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));