From 63deaeffacaed86b9fa2d72fef5077135b886216 Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Mon, 5 May 2003 08:41:53 +0000 Subject: Implement DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls. It appears that they are now necessary to use newfs(8). --- sys/dev/vinum/vinumioctl.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'sys/dev') diff --git a/sys/dev/vinum/vinumioctl.c b/sys/dev/vinum/vinumioctl.c index 911470fa16d9d..58dce713e0cda 100644 --- a/sys/dev/vinum/vinumioctl.c +++ b/sys/dev/vinum/vinumioctl.c @@ -87,6 +87,14 @@ vinumioctl(dev_t dev, sd = &SD[objno]; switch (cmd) { + case DIOCGSECTORSIZE: + *(u_int *) data = sd->sectorsize; + return 0; + + case DIOCGMEDIASIZE: + *(u_int64_t *) data = sd->sectors * sd->sectorsize; + return 0; + /* * We don't have this stuff on hardware, * so just pretend to do it so that @@ -108,6 +116,14 @@ vinumioctl(dev_t dev, plex = &PLEX[objno]; switch (cmd) { + case DIOCGSECTORSIZE: + *(u_int64_t *) data = plex->sectorsize; + return 0; + + case DIOCGMEDIASIZE: + *(u_int64_t *) data = plex->length * plex->sectorsize; + return 0; + /* * We don't have this stuff on hardware, * so just pretend to do it so that @@ -133,6 +149,14 @@ vinumioctl(dev_t dev, return EIO; /* I/O error */ switch (cmd) { + case DIOCGSECTORSIZE: + *(u_int *) data = vol->sectorsize; + return 0; + + case DIOCGMEDIASIZE: + *(u_int64_t *) data = vol->size * vol->sectorsize; + return 0; + /* * We don't have this stuff on hardware, * so just pretend to do it so that -- cgit v1.3