summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2003-05-05 08:41:53 +0000
committergrog <grog@FreeBSD.org>2003-05-05 08:41:53 +0000
commit59cfc462ec170f7e591611780a5ea6f223bf52f4 (patch)
tree2bfa83f1214fbf38f266d86e71a7e2aea0e146b8 /sys/dev/vinum
parentd6ece911bbedbb5ea2694ad856ca4e9ec462f42a (diff)
downloadFreeBSD-src-59cfc462ec170f7e591611780a5ea6f223bf52f4.zip
FreeBSD-src-59cfc462ec170f7e591611780a5ea6f223bf52f4.tar.gz
Implement DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls. It appears that
they are now necessary to use newfs(8).
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinumioctl.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/dev/vinum/vinumioctl.c b/sys/dev/vinum/vinumioctl.c
index 911470f..58dce71 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
OpenPOWER on IntegriCloud