summaryrefslogtreecommitdiff
path: root/sys/isofs/cd9660
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-11-13 03:48:10 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-11-13 03:48:10 +0000
commitaccfa7a6a7976a8bef491294a38f6f13530a79a1 (patch)
treee64b5044f8a773520f6ea7f073ed6558b79b0a7a /sys/isofs/cd9660
parent22caac98029983a7e7cbaf6f346cf4545bc94a01 (diff)
FIBMAP ioctl from Linux, only usable on ISO 9660 FS. Note that the lba
returned is in 512-byte sectors, so if you're going to use it for things like DVD, you need to divide the result by 4 (for 2048-byte sectors). OK deraadt@
Diffstat (limited to 'sys/isofs/cd9660')
-rw-r--r--sys/isofs/cd9660/cd9660_vnops.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c
index b634f9ced9c..86fb0318fb5 100644
--- a/sys/isofs/cd9660/cd9660_vnops.c
+++ b/sys/isofs/cd9660/cd9660_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vnops.c,v 1.11 1999/07/01 02:20:22 d Exp $ */
+/* $OpenBSD: cd9660_vnops.c,v 1.12 1999/11/13 03:48:09 angelos Exp $ */
/* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */
/*-
@@ -55,6 +55,9 @@
#include <sys/vnode.h>
#include <sys/malloc.h>
#include <sys/dirent.h>
+#include <sys/ioctl.h>
+#include <sys/ioccom.h>
+#include <sys/cdio.h>
#include <miscfs/fifofs/fifo.h>
#include <miscfs/specfs/specdev.h>
@@ -375,8 +378,24 @@ int
cd9660_ioctl(v)
void *v;
{
- printf("You did ioctl for isofs !!\n");
- return (ENOTTY);
+ struct vop_ioctl_args /* {
+ struct vnode *a_vp;
+ u_long a_command;
+ caddr_t a_data;
+ int a_fflag;
+ struct ucred *a_cred;
+ struct proc *a_p;
+ } */ *ap = v;
+ daddr_t *block;
+
+ switch (ap->a_command) {
+ case FIBMAP:
+ block = (daddr_t *)ap->a_data;
+
+ return (VOP_BMAP(ap->a_vp, *block, NULL, block, 0));
+ default:
+ return (ENOTTY);
+ }
}
/* ARGSUSED */