Add support of the DIOCGSECTORSIZE & DIOCGMEDIASIZE ioctl's

so that newfs works on dvd-rw/dvd-ram again..
This commit is contained in:
Søren Schmidt 2003-09-11 15:59:16 +00:00
parent 8278014bce
commit fe78f9d47c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119989
2 changed files with 11 additions and 2 deletions

View File

@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/cdio.h>
#include <sys/cdrio.h>
#include <sys/dvdio.h>
#include <sys/disk.h>
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/ctype.h>
@ -1032,6 +1033,14 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
error = EINVAL;
break;
case DIOCGMEDIASIZE:
*(off_t *)addr = cdp->disk_size * cdp->block_size;
break;
case DIOCGSECTORSIZE:
*(u_int *)addr = cdp->block_size;
break;
default:
error = ENOTTY;
}

View File

@ -318,8 +318,8 @@ struct acd_softc {
struct acd_softc **driver; /* softc's of changer slots */
int slot; /* this instance slot number */
time_t timestamp; /* this instance timestamp */
int disk_size; /* size of current media */
int block_size; /* blocksize currently used */
u_int disk_size; /* size of current media */
u_int block_size; /* blocksize currently used */
struct devstat *stats; /* devstat entry */
dev_t dev; /* device place holders */
#ifndef BURN_BRIDGES