summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_fdio.c
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2008-03-21 21:54:58 +0000
committerad <ad@NetBSD.org>2008-03-21 21:54:58 +0000
commita9ca7a3734751f09c9dc4e1f645cd528fd403e8c (patch)
treeff26aca94a1a611e6be984fcff411406b466507f /sys/compat/linux/common/linux_fdio.c
parentc743ad71591a886accf44c9e93c1ff677b45a41f (diff)
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
Diffstat (limited to 'sys/compat/linux/common/linux_fdio.c')
-rw-r--r--sys/compat/linux/common/linux_fdio.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/compat/linux/common/linux_fdio.c b/sys/compat/linux/common/linux_fdio.c
index 0ab183f8724..bf9b5be0590 100644
--- a/sys/compat/linux/common/linux_fdio.c
+++ b/sys/compat/linux/common/linux_fdio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fdio.c,v 1.12 2007/12/20 23:02:54 dsl Exp $ */
+/* $NetBSD: linux_fdio.c,v 1.13 2008/03/21 21:54:58 ad Exp $ */
/*
* Copyright (c) 2000 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.12 2007/12/20 23:02:54 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fdio.c,v 1.13 2008/03/21 21:54:58 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -67,10 +67,9 @@ int
linux_ioctl_fdio(struct lwp *l, const struct linux_sys_ioctl_args *uap,
register_t *retval)
{
- struct filedesc *fdp;
- struct file *fp;
+ file_t *fp;
int error;
- int (*ioctlf)(struct file *, u_long, void *, struct lwp *);
+ int (*ioctlf)(file_t *, u_long, void *);
u_long com;
struct fdformat_parms fparams;
struct linux_floppy_struct lflop;
@@ -78,12 +77,9 @@ linux_ioctl_fdio(struct lwp *l, const struct linux_sys_ioctl_args *uap,
com = (u_long)SCARG(uap, data);
- fdp = l->l_proc->p_fd;
- if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
+ if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
return (EBADF);
- FILE_USE(fp);
-
com = SCARG(uap, com);
ioctlf = fp->f_ops->fo_ioctl;
@@ -108,7 +104,7 @@ linux_ioctl_fdio(struct lwp *l, const struct linux_sys_ioctl_args *uap,
error = copyout(&ldrive, SCARG(uap, data), sizeof ldrive);
break;
case LINUX_FDGETPRM:
- error = ioctlf(fp, FDIOCGETFORMAT, (void *)&fparams, l);
+ error = ioctlf(fp, FDIOCGETFORMAT, &fparams);
if (error != 0)
break;
lflop.size = fparams.ncyl * fparams.nspt * fparams.ntrk;
@@ -169,7 +165,7 @@ linux_ioctl_fdio(struct lwp *l, const struct linux_sys_ioctl_args *uap,
error = EINVAL;
}
- FILE_UNUSE(fp, l);
+ fd_putfile(SCARG(uap, fd));
return 0;
}