Add support of the DIOCGSECTORSIZE & DIOCGMEDIASIZE ioctl's
so that newfs works on dvd-rw/dvd-ram again..
This commit is contained in:
parent
c4f00ad8a2
commit
b8fc895447
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user