summaryrefslogtreecommitdiff
path: root/sys/dev
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/dev
parentc743ad71591a886accf44c9e93c1ff677b45a41f (diff)
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/ld_ataraid.c6
-rw-r--r--sys/dev/ccd.c10
-rw-r--r--sys/dev/cgd.c8
-rw-r--r--sys/dev/dksubr.c6
-rw-r--r--sys/dev/dkwedge/dk.c10
-rw-r--r--sys/dev/drm/drm_drv.c8
-rw-r--r--sys/dev/firmload.c10
-rw-r--r--sys/dev/fss.c12
-rw-r--r--sys/dev/kloader.c6
-rw-r--r--sys/dev/kttcp.c38
-rw-r--r--sys/dev/putter/putter.c44
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c8
-rw-r--r--sys/dev/vnd.c11
13 files changed, 81 insertions, 96 deletions
diff --git a/sys/dev/ata/ld_ataraid.c b/sys/dev/ata/ld_ataraid.c
index 4fc71b7f2c2..51b1828ef25 100644
--- a/sys/dev/ata/ld_ataraid.c
+++ b/sys/dev/ata/ld_ataraid.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ld_ataraid.c,v 1.24 2008/01/02 21:59:45 ad Exp $ */
+/* $NetBSD: ld_ataraid.c,v 1.25 2008/03/21 21:54:59 ad Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.24 2008/01/02 21:59:45 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.25 2008/03/21 21:54:59 ad Exp $");
#include "rnd.h"
@@ -230,7 +230,7 @@ ld_ataraid_attach(struct device *parent, struct device *self,
vp = sc->sc_vnodes[i];
sc->sc_vnodes[i] = NULL;
if (vp != NULL)
- (void) vn_close(vp, FREAD|FWRITE, NOCRED, curlwp);
+ (void) vn_close(vp, FREAD|FWRITE, NOCRED);
}
finish:
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index fad431917eb..74d7c758815 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ccd.c,v 1.127 2008/02/02 10:40:50 hannken Exp $ */
+/* $NetBSD: ccd.c,v 1.128 2008/03/21 21:54:59 ad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999, 2007 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.127 2008/02/02 10:40:50 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.128 2008/03/21 21:54:59 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1101,7 +1101,7 @@ ccdioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
UIO_USERSPACE)) != 0) {
for (j = 0; j < lookedup; ++j)
(void)vn_close(vpp[j], FREAD|FWRITE,
- uc, l);
+ uc);
free(vpp, M_DEVBUF);
free(cpp, M_DEVBUF);
goto out;
@@ -1115,7 +1115,7 @@ ccdioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
if ((error = ccdinit(cs, cpp, vpp, l)) != 0) {
for (j = 0; j < lookedup; ++j)
(void)vn_close(vpp[j], FREAD|FWRITE,
- uc, l);
+ uc);
free(vpp, M_DEVBUF);
free(cpp, M_DEVBUF);
goto out;
@@ -1183,7 +1183,7 @@ ccdioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
cs->sc_cinfo[i].ci_vp);
#endif
(void)vn_close(cs->sc_cinfo[i].ci_vp, FREAD|FWRITE,
- uc, l);
+ uc);
free(cs->sc_cinfo[i].ci_path, M_DEVBUF);
}
diff --git a/sys/dev/cgd.c b/sys/dev/cgd.c
index 2b58692eba6..61717e9655f 100644
--- a/sys/dev/cgd.c
+++ b/sys/dev/cgd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.50 2008/01/04 21:17:46 ad Exp $ */
+/* $NetBSD: cgd.c,v 1.51 2008/03/21 21:54:59 ad Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.50 2008/01/04 21:17:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.51 2008/03/21 21:54:59 ad Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -575,7 +575,7 @@ cgd_ioctl_set(struct cgd_softc *cs, void *data, struct lwp *l)
bail:
free(inbuf, M_TEMP);
- (void)vn_close(vp, FREAD|FWRITE, l->l_cred, l);
+ (void)vn_close(vp, FREAD|FWRITE, l->l_cred);
return ret;
}
@@ -594,7 +594,7 @@ cgd_ioctl_clr(struct cgd_softc *cs, void *data, struct lwp *l)
splx(s);
bufq_free(cs->sc_dksc.sc_bufq);
- (void)vn_close(cs->sc_tvn, FREAD|FWRITE, l->l_cred, l);
+ (void)vn_close(cs->sc_tvn, FREAD|FWRITE, l->l_cred);
cs->sc_cfuncs->cf_destroy(cs->sc_cdata.cf_priv);
free(cs->sc_tpath, M_DEVBUF);
free(cs->sc_data, M_DEVBUF);
diff --git a/sys/dev/dksubr.c b/sys/dev/dksubr.c
index 62a83f0b8b5..2c6939a2089 100644
--- a/sys/dev/dksubr.c
+++ b/sys/dev/dksubr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.34 2008/01/30 15:30:12 ad Exp $ */
+/* $NetBSD: dksubr.c,v 1.35 2008/03/21 21:54:59 ad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.34 2008/01/30 15:30:12 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.35 2008/03/21 21:54:59 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -664,6 +664,6 @@ dk_lookup(const char *path, struct lwp *l, struct vnode **vpp,
return 0;
out:
VOP_UNLOCK(vp, 0);
- (void) vn_close(vp, FREAD | FWRITE, l->l_cred, l);
+ (void) vn_close(vp, FREAD | FWRITE, l->l_cred);
return error;
}
diff --git a/sys/dev/dkwedge/dk.c b/sys/dev/dkwedge/dk.c
index 82ea5330217..9bf1d9b7e3d 100644
--- a/sys/dev/dkwedge/dk.c
+++ b/sys/dev/dkwedge/dk.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dk.c,v 1.34 2008/03/04 13:51:18 cube Exp $ */
+/* $NetBSD: dk.c,v 1.35 2008/03/21 21:54:59 ad Exp $ */
/*-
* Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.34 2008/03/04 13:51:18 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.35 2008/03/21 21:54:59 ad Exp $");
#include "opt_dkwedge.h"
@@ -486,7 +486,7 @@ dkwedge_del(struct dkwedge_info *dkw)
if (sc->sc_parent->dk_rawopens-- == 1) {
KASSERT(sc->sc_parent->dk_rawvp != NULL);
(void) vn_close(sc->sc_parent->dk_rawvp, FREAD | FWRITE,
- NOCRED, curlwp);
+ NOCRED);
sc->sc_parent->dk_rawvp = NULL;
}
sc->sc_dk.dk_openmask = 0;
@@ -834,7 +834,7 @@ dkwedge_discover(struct disk *pdk)
}
}
- error = vn_close(vp, FREAD, NOCRED, curlwp);
+ error = vn_close(vp, FREAD, NOCRED);
if (error) {
aprint_error("%s: unable to close device, error = %d\n",
pdk->dk_name, error);
@@ -979,7 +979,7 @@ dkclose(dev_t dev, int flags, int fmt, struct lwp *l)
if (sc->sc_parent->dk_rawopens-- == 1) {
KASSERT(sc->sc_parent->dk_rawvp != NULL);
error = vn_close(sc->sc_parent->dk_rawvp,
- FREAD | FWRITE, NOCRED, l);
+ FREAD | FWRITE, NOCRED);
sc->sc_parent->dk_rawvp = NULL;
}
}
diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c
index f91d0b3d238..05f78e21ee3 100644
--- a/sys/dev/drm/drm_drv.c
+++ b/sys/dev/drm/drm_drv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_drv.c,v 1.9 2008/03/04 11:52:38 drochner Exp $ */
+/* $NetBSD: drm_drv.c,v 1.10 2008/03/21 21:54:59 ad Exp $ */
/* drm_drv.h -- Generic driver template -*- linux-c -*-
* Created: Thu Nov 23 03:10:50 2000 by gareth@valinux.com
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.9 2008/03/04 11:52:38 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.10 2008/03/21 21:54:59 ad Exp $");
/*
__FBSDID("$FreeBSD: src/sys/dev/drm/drm_drv.c,v 1.6 2006/09/07 23:04:47 anholt Exp $");
*/
@@ -754,12 +754,12 @@ int drm_ioctl(DRM_CDEV kdev, u_long cmd, void *data, int flags,
case SIOCSPGRP:
case TIOCSPGRP:
case FIOSETOWN:
- return fsetown(p->l_proc, &dev->buf_pgid, cmd, data);
+ return fsetown(&dev->buf_pgid, cmd, data);
case SIOCGPGRP:
case TIOCGPGRP:
case FIOGETOWN:
- return fgetown(p->l_proc, dev->buf_pgid, cmd, data);
+ return fgetown(dev->buf_pgid, cmd, data);
}
if (IOCGROUP(cmd) != DRM_IOCTL_BASE) {
diff --git a/sys/dev/firmload.c b/sys/dev/firmload.c
index 0e4f1732e2d..2b55941ab29 100644
--- a/sys/dev/firmload.c
+++ b/sys/dev/firmload.c
@@ -1,4 +1,4 @@
-/* $NetBSD: firmload.c,v 1.9 2007/12/08 19:29:41 pooka Exp $ */
+/* $NetBSD: firmload.c,v 1.10 2008/03/21 21:54:59 ad Exp $ */
/*-
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.9 2007/12/08 19:29:41 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.10 2008/03/21 21:54:59 ad Exp $");
/*
* The firmload API provides an interface for device drivers to access
@@ -269,14 +269,14 @@ firmware_open(const char *drvname, const char *imgname, firmware_handle_t *fhp)
error = VOP_GETATTR(vp, &va, kauth_cred_get());
if (error) {
VOP_UNLOCK(vp, 0);
- (void)vn_close(vp, FREAD, kauth_cred_get(), curlwp);
+ (void)vn_close(vp, FREAD, kauth_cred_get());
firmware_handle_free(fh);
return (error);
}
if (va.va_type != VREG) {
VOP_UNLOCK(vp, 0);
- (void)vn_close(vp, FREAD, kauth_cred_get(), curlwp);
+ (void)vn_close(vp, FREAD, kauth_cred_get());
firmware_handle_free(fh);
return (EINVAL);
}
@@ -302,7 +302,7 @@ firmware_close(firmware_handle_t fh)
{
int error;
- error = vn_close(fh->fh_vp, FREAD, kauth_cred_get(), curlwp);
+ error = vn_close(fh->fh_vp, FREAD, kauth_cred_get());
firmware_handle_free(fh);
return (error);
}
diff --git a/sys/dev/fss.c b/sys/dev/fss.c
index ff44d1d836b..4cac5d47506 100644
--- a/sys/dev/fss.c
+++ b/sys/dev/fss.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fss.c,v 1.43 2008/01/04 21:17:47 ad Exp $ */
+/* $NetBSD: fss.c,v 1.44 2008/03/21 21:54:59 ad Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.43 2008/01/04 21:17:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.44 2008/03/21 21:54:59 ad Exp $");
#include "fss.h"
@@ -769,9 +769,9 @@ bad:
fss_softc_free(sc);
if (sc->sc_bs_vp != NULL) {
if (sc->sc_flags & FSS_PERSISTENT)
- vn_close(sc->sc_bs_vp, FREAD, l->l_cred, l);
+ vn_close(sc->sc_bs_vp, FREAD, l->l_cred);
else
- vn_close(sc->sc_bs_vp, FREAD|FWRITE, l->l_cred, l);
+ vn_close(sc->sc_bs_vp, FREAD|FWRITE, l->l_cred);
}
sc->sc_bs_vp = NULL;
@@ -797,9 +797,9 @@ fss_delete_snapshot(struct fss_softc *sc, struct lwp *l)
fss_softc_free(sc);
if (sc->sc_flags & FSS_PERSISTENT)
- vn_close(sc->sc_bs_vp, FREAD, l->l_cred, l);
+ vn_close(sc->sc_bs_vp, FREAD, l->l_cred);
else
- vn_close(sc->sc_bs_vp, FREAD|FWRITE, l->l_cred, l);
+ vn_close(sc->sc_bs_vp, FREAD|FWRITE, l->l_cred);
sc->sc_bs_vp = NULL;
sc->sc_flags &= ~FSS_PERSISTENT;
diff --git a/sys/dev/kloader.c b/sys/dev/kloader.c
index 6ad5cdbba86..1410d5a7781 100644
--- a/sys/dev/kloader.c
+++ b/sys/dev/kloader.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kloader.c,v 1.15 2007/12/15 00:39:26 perry Exp $ */
+/* $NetBSD: kloader.c,v 1.16 2008/03/21 21:54:59 ad Exp $ */
/*-
* Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.15 2007/12/15 00:39:26 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.16 2008/03/21 21:54:59 ad Exp $");
#include "debug_kloader.h"
@@ -623,7 +623,7 @@ kloader_close()
struct vnode *vp = kloader.vp;
VOP_UNLOCK(vp, 0);
- vn_close(vp, FREAD, l->l_cred, l);
+ vn_close(vp, FREAD, l->l_cred);
}
int
diff --git a/sys/dev/kttcp.c b/sys/dev/kttcp.c
index 62ed87b8a33..10b04586251 100644
--- a/sys/dev/kttcp.c
+++ b/sys/dev/kttcp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kttcp.c,v 1.25 2008/02/06 21:57:54 ad Exp $ */
+/* $NetBSD: kttcp.c,v 1.26 2008/03/21 21:54:59 ad Exp $ */
/*
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kttcp.c,v 1.25 2008/02/06 21:57:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kttcp.c,v 1.26 2008/03/21 21:54:59 ad Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -113,7 +113,7 @@ kttcpioctl(dev_t dev, u_long cmd, void *data, int flag,
static int
kttcp_send(struct lwp *l, struct kttcp_io_args *kio)
{
- struct file *fp;
+ struct socket *so;
int error;
struct timeval t0, t1;
unsigned long long len, done;
@@ -121,24 +121,17 @@ kttcp_send(struct lwp *l, struct kttcp_io_args *kio)
if (kio->kio_totalsize >= KTTCP_MAX_XMIT)
return EINVAL;
- fp = fd_getfile(l->l_proc->p_fd, kio->kio_socket);
- if (fp == NULL)
- return EBADF;
- FILE_USE(fp);
- if (fp->f_type != DTYPE_SOCKET) {
- FILE_UNUSE(fp, l);
- return EFTYPE;
- }
+ if ((error = fd_getsock(kio->kio_socket, &so)) != 0)
+ return error;
len = kio->kio_totalsize;
microtime(&t0);
do {
- error = kttcp_sosend((struct socket *)fp->f_data, len,
- &done, l, 0);
+ error = kttcp_sosend(so, len, &done, l, 0);
len -= done;
} while (error == 0 && len > 0);
- FILE_UNUSE(fp, l);
+ fd_putfile(kio->kio_socket);
microtime(&t1);
if (error != 0)
@@ -153,7 +146,7 @@ kttcp_send(struct lwp *l, struct kttcp_io_args *kio)
static int
kttcp_recv(struct lwp *l, struct kttcp_io_args *kio)
{
- struct file *fp;
+ struct socket *so;
int error;
struct timeval t0, t1;
unsigned long long len, done;
@@ -163,23 +156,16 @@ kttcp_recv(struct lwp *l, struct kttcp_io_args *kio)
if (kio->kio_totalsize > KTTCP_MAX_XMIT)
return EINVAL;
- fp = fd_getfile(l->l_proc->p_fd, kio->kio_socket);
- if (fp == NULL)
- return EBADF;
- FILE_USE(fp);
- if (fp->f_type != DTYPE_SOCKET) {
- FILE_UNUSE(fp, l);
- return EBADF;
- }
+ if ((error = fd_getsock(kio->kio_socket, &so)) != 0)
+ return error;
len = kio->kio_totalsize;
microtime(&t0);
do {
- error = kttcp_soreceive((struct socket *)fp->f_data,
- len, &done, l, NULL);
+ error = kttcp_soreceive(so, len, &done, l, NULL);
len -= done;
} while (error == 0 && len > 0 && done > 0);
- FILE_UNUSE(fp, l);
+ fd_putfile(kio->kio_socket);
microtime(&t1);
if (error == EPIPE)
diff --git a/sys/dev/putter/putter.c b/sys/dev/putter/putter.c
index 7bb53b94796..038cb06e00e 100644
--- a/sys/dev/putter/putter.c
+++ b/sys/dev/putter/putter.c
@@ -1,4 +1,4 @@
-/* $NetBSD: putter.c,v 1.8 2008/03/01 14:16:50 rmind Exp $ */
+/* $NetBSD: putter.c,v 1.9 2008/03/21 21:54:59 ad Exp $ */
/*
* Copyright (c) 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: putter.c,v 1.8 2008/03/01 14:16:50 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: putter.c,v 1.9 2008/03/21 21:54:59 ad Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -163,14 +163,14 @@ putter_destroy()
/*
* fd routines, for cloner
*/
-static int putter_fop_read(struct file *, off_t *, struct uio *,
+static int putter_fop_read(file_t *, off_t *, struct uio *,
kauth_cred_t, int);
-static int putter_fop_write(struct file *, off_t *, struct uio *,
+static int putter_fop_write(file_t *, off_t *, struct uio *,
kauth_cred_t, int);
-static int putter_fop_ioctl(struct file*, u_long, void *, struct lwp *);
-static int putter_fop_poll(struct file *, int, struct lwp *);
-static int putter_fop_close(struct file *, struct lwp *);
-static int putter_fop_kqfilter(struct file *, struct knote *);
+static int putter_fop_ioctl(file_t*, u_long, void *);
+static int putter_fop_poll(file_t *, int);
+static int putter_fop_close(file_t *);
+static int putter_fop_kqfilter(file_t *, struct knote *);
static const struct fileops putter_fileops = {
@@ -185,7 +185,7 @@ static const struct fileops putter_fileops = {
};
static int
-putter_fop_read(struct file *fp, off_t *off, struct uio *uio,
+putter_fop_read(file_t *fp, off_t *off, struct uio *uio,
kauth_cred_t cred, int flags)
{
struct putter_instance *pi = fp->f_data;
@@ -225,7 +225,7 @@ putter_fop_read(struct file *fp, off_t *off, struct uio *uio,
}
static int
-putter_fop_write(struct file *fp, off_t *off, struct uio *uio,
+putter_fop_write(file_t *fp, off_t *off, struct uio *uio,
kauth_cred_t cred, int flags)
{
struct putter_instance *pi = fp->f_data;
@@ -269,7 +269,7 @@ putter_fop_write(struct file *fp, off_t *off, struct uio *uio,
*/
#define PUTTERPOLL_EVSET (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI)
static int
-putter_fop_poll(struct file *fp, int events, struct lwp *l)
+putter_fop_poll(file_t *fp, int events)
{
struct putter_instance *pi = fp->f_data;
int revents;
@@ -287,7 +287,7 @@ putter_fop_poll(struct file *fp, int events, struct lwp *l)
if (pi->pi_pop->pop_waitcount(pi->pi_private))
revents |= PUTTERPOLL_EVSET;
else
- selrecord(l, &pi->pi_sel);
+ selrecord(curlwp, &pi->pi_sel);
return revents;
}
@@ -298,7 +298,7 @@ putter_fop_poll(struct file *fp, int events, struct lwp *l)
* unmounting is a frightfully complex operation to avoid races
*/
static int
-putter_fop_close(struct file *fp, struct lwp *l)
+putter_fop_close(file_t *fp)
{
struct putter_instance *pi = fp->f_data;
int rv;
@@ -357,7 +357,7 @@ putter_fop_close(struct file *fp, struct lwp *l)
}
static int
-putter_fop_ioctl(struct file *fp, u_long cmd, void *data, struct lwp *l)
+putter_fop_ioctl(file_t *fp, u_long cmd, void *data)
{
/*
@@ -405,7 +405,7 @@ static const struct filterops putter_filtops =
{ 1, NULL, filt_putterdetach, filt_putter };
static int
-putter_fop_kqfilter(struct file *fp, struct knote *kn)
+putter_fop_kqfilter(file_t *fp, struct knote *kn)
{
struct putter_instance *pi = fp->f_data;
struct klist *klist;
@@ -450,14 +450,16 @@ int
puttercdopen(dev_t dev, int flags, int fmt, struct lwp *l)
{
struct putter_instance *pi;
- struct file *fp;
+ file_t *fp;
int error, fd, idx;
+ proc_t *p;
+ p = curproc;
pi = kmem_alloc(sizeof(struct putter_instance), KM_SLEEP);
mutex_enter(&pi_mtx);
idx = get_pi_idx(pi);
- pi->pi_pid = l->l_proc->p_pid;
+ pi->pi_pid = p->p_pid;
pi->pi_idx = idx;
pi->pi_curput = NULL;
pi->pi_curres = 0;
@@ -465,7 +467,7 @@ puttercdopen(dev_t dev, int flags, int fmt, struct lwp *l)
selinit(&pi->pi_sel);
mutex_exit(&pi_mtx);
- if ((error = falloc(l, &fp, &fd)) != 0)
+ if ((error = fd_allocfile(&fp, &fd)) != 0)
goto bad1;
if ((error = putter_configure(dev, flags, fmt, fd)) != 0)
@@ -474,14 +476,12 @@ puttercdopen(dev_t dev, int flags, int fmt, struct lwp *l)
DPRINTF(("puttercdopen: registered embryonic pmp for pid: %d\n",
pi->pi_pid));
- error = fdclone(l, fp, fd, FREAD|FWRITE, &putter_fileops, pi);
+ error = fd_clone(fp, fd, FREAD|FWRITE, &putter_fileops, pi);
KASSERT(error = EMOVEFD);
return error;
bad2:
- FILE_UNUSE(fp, l);
- fdremove(l->l_proc->p_fd, fd);
- ffree(fp);
+ fd_abort(p, fp, fd);
bad1:
putter_detach(pi);
kmem_free(pi, sizeof(struct putter_instance));
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 44e077e7733..1009883696a 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,6 +1,6 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.243 2008/01/04 21:18:05 ad Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.244 2008/03/21 21:54:59 ad Exp $ */
/*-
- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -146,7 +146,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.243 2008/01/04 21:18:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.244 2008/03/21 21:54:59 ad Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -2664,7 +2664,7 @@ rf_close_component(RF_Raid_t *raidPtr, struct vnode *vp, int auto_configured)
vput(vp);
} else {
- (void) vn_close(vp, FREAD | FWRITE, curlwp->l_cred, curlwp);
+ (void) vn_close(vp, FREAD | FWRITE, curlwp->l_cred);
}
}
}
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 3551e893fc0..57e5888c955 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,7 +1,7 @@
-/* $NetBSD: vnd.c,v 1.176 2008/03/04 23:03:29 cube Exp $ */
+/* $NetBSD: vnd.c,v 1.177 2008/03/21 21:54:59 ad Exp $ */
/*-
- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -137,7 +137,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.176 2008/03/04 23:03:29 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.177 2008/03/21 21:54:59 ad Exp $");
#if defined(_KERNEL_OPT)
#include "fs_nfs.h"
@@ -1215,7 +1215,7 @@ vndioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
break;
close_and_exit:
- (void) vn_close(nd.ni_vp, fflags, l->l_cred, l);
+ (void) vn_close(nd.ni_vp, fflags, l->l_cred);
unlock_and_exit:
#ifdef VND_COMPRESSION
/* free any allocated memory (for compressed file) */
@@ -1493,7 +1493,6 @@ static void
vndclear(struct vnd_softc *vnd, int myminor)
{
struct vnode *vp = vnd->sc_vp;
- struct lwp *l = curlwp;
int fflags = FREAD;
int bmaj, cmaj, i, mn;
int s;
@@ -1548,7 +1547,7 @@ vndclear(struct vnd_softc *vnd, int myminor)
| VNF_VUNCONF | VNF_COMP);
if (vp == (struct vnode *)0)
panic("vndclear: null vp");
- (void) vn_close(vp, fflags, vnd->sc_cred, l);
+ (void) vn_close(vp, fflags, vnd->sc_cred);
kauth_cred_free(vnd->sc_cred);
vnd->sc_vp = (struct vnode *)0;
vnd->sc_cred = (kauth_cred_t)0;