From 1f5f1ce072ff94bd81f7c6df33b7055f8304b035 Mon Sep 17 00:00:00 2001 From: sos Date: Tue, 7 Dec 1999 22:25:28 +0000 Subject: Commit the kernel part of our DVD support. Nothing much to say really, its just a number of new ioctl's, the rest is done in userland. --- sys/isofs/cd9660/cd9660_vnops.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'sys/isofs/cd9660') diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index abb4d6b..2f93731 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,7 @@ static int cd9660_setattr __P((struct vop_setattr_args *)); static int cd9660_access __P((struct vop_access_args *)); static int cd9660_getattr __P((struct vop_getattr_args *)); +static int cd9660_ioctl __P((struct vop_ioctl_args *)); static int cd9660_pathconf __P((struct vop_pathconf_args *)); static int cd9660_read __P((struct vop_read_args *)); struct isoreaddir; @@ -255,6 +257,33 @@ cd9660_getattr(ap) } /* + * Vnode op for ioctl. + */ +static int +cd9660_ioctl(ap) + struct vop_ioctl_args /* { + struct vnode *a_vp; + int a_command; + caddr_t a_data; + int a_fflag; + struct ucred *a_cred; + struct proc *a_p; + } */ *ap; +{ + struct vnode *vp = ap->a_vp; + struct iso_node *ip = VTOI(vp); + + switch (ap->a_command) { + + case FIOGETLBA: + *(int *)(ap->a_data) = ip->iso_start; + return 0; + default: + return (ENOTTY); + } +} + +/* * Vnode op for reading. */ static int @@ -857,6 +886,7 @@ static struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { { &vop_cachedlookup_desc, (vop_t *) cd9660_lookup }, { &vop_getattr_desc, (vop_t *) cd9660_getattr }, { &vop_inactive_desc, (vop_t *) cd9660_inactive }, + { &vop_ioctl_desc, (vop_t *) cd9660_ioctl }, { &vop_islocked_desc, (vop_t *) vop_stdislocked }, { &vop_lock_desc, (vop_t *) vop_stdlock }, { &vop_lookup_desc, (vop_t *) vfs_cache_lookup }, -- cgit v1.1