summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_sg.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_sg.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_sg.c')
-rw-r--r--sys/compat/linux/common/linux_sg.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/compat/linux/common/linux_sg.c b/sys/compat/linux/common/linux_sg.c
index f604ab9f915..68cf20e9175 100644
--- a/sys/compat/linux/common/linux_sg.c
+++ b/sys/compat/linux/common/linux_sg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sg.c,v 1.12 2007/12/20 23:02:56 dsl Exp $ */
+/* $NetBSD: linux_sg.c,v 1.13 2008/03/21 21:54:58 ad Exp $ */
/*
* Copyright (c) 2004 Soren S. Jorvang. All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sg.c,v 1.12 2007/12/20 23:02:56 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sg.c,v 1.13 2008/03/21 21:54:58 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -72,19 +72,16 @@ int
linux_ioctl_sg(struct lwp *l, const struct linux_sys_ioctl_args *uap,
register_t *retval)
{
- struct file *fp;
- struct filedesc *fdp;
+ file_t *fp;
u_long com = SCARG(uap, com);
int error = 0;
- int (*ioctlf)(struct file *, u_long, void *, struct lwp *);
+ int (*ioctlf)(file_t *, u_long, void *);
struct linux_sg_io_hdr lreq;
struct scsireq req;
- 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);
ioctlf = fp->f_ops->fo_ioctl;
*retval = 0;
@@ -143,7 +140,7 @@ linux_ioctl_sg(struct lwp *l, const struct linux_sys_ioctl_args *uap,
req.datalen = lreq.dxfer_len;
req.databuf = lreq.dxferp;
- error = ioctlf(fp, SCIOCCOMMAND, (void *)&req, l);
+ error = ioctlf(fp, SCIOCCOMMAND, &req);
if (error) {
DPRINTF(("SCIOCCOMMAND failed %d\n", error));
break;
@@ -212,8 +209,8 @@ linux_ioctl_sg(struct lwp *l, const struct linux_sys_ioctl_args *uap,
break;
}
-done:
- FILE_UNUSE(fp, l);
+ done:
+ fd_putfile(SCARG(uap, fd));
DPRINTF(("Return=%d\n", error));
return error;