Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Try not to use f_data, use f_{vnode, socket, pipe, mqueue, k...
details: https://anonhg.NetBSD.org/src/rev/747d1956805e
branches: trunk
changeset: 332052:747d1956805e
user: matt <matt%NetBSD.org@localhost>
date: Fri Sep 05 09:20:59 2014 +0000
description:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
diffstat:
sys/compat/common/if_43.c | 6 ++--
sys/compat/common/uipc_syscalls_43.c | 22 +++++++-------
sys/compat/common/vfs_syscalls_12.c | 6 ++--
sys/compat/common/vfs_syscalls_20.c | 6 ++--
sys/compat/common/vfs_syscalls_30.c | 6 ++--
sys/compat/common/vfs_syscalls_43.c | 13 ++++----
sys/compat/common/vfs_syscalls_50.c | 6 ++--
sys/compat/ibcs2/ibcs2_misc.c | 8 ++--
sys/compat/ibcs2/ibcs2_stat.c | 8 ++--
sys/compat/netbsd32/netbsd32_compat_20.c | 6 ++--
sys/compat/netbsd32/netbsd32_compat_50.c | 6 ++--
sys/compat/netbsd32/netbsd32_fs.c | 12 ++++----
sys/compat/osf1/osf1_file.c | 6 ++--
sys/compat/osf1/osf1_mount.c | 6 ++--
sys/compat/ossaudio/ossaudio.c | 10 +++---
sys/compat/sunos/sunos_ioctl.c | 9 +++--
sys/compat/sunos/sunos_misc.c | 8 ++--
sys/compat/sunos32/sunos32_ioctl.c | 10 +++---
sys/compat/sunos32/sunos32_misc.c | 8 ++--
sys/compat/svr4/svr4_fcntl.c | 26 ++++++----------
sys/compat/svr4/svr4_misc.c | 8 ++--
sys/compat/svr4/svr4_net.c | 8 ++--
sys/compat/svr4/svr4_socket.c | 8 ++--
sys/compat/svr4/svr4_stream.c | 6 ++--
sys/compat/svr4_32/svr4_32_fcntl.c | 8 ++--
sys/compat/svr4_32/svr4_32_misc.c | 8 ++--
sys/compat/svr4_32/svr4_32_net.c | 6 ++--
sys/compat/svr4_32/svr4_32_socket.c | 8 ++--
sys/compat/ultrix/ultrix_pathname.c | 6 ++--
sys/kern/exec_script.c | 6 ++--
sys/kern/kern_descrip.c | 14 ++++----
sys/kern/kern_event.c | 24 ++++++++--------
sys/kern/kern_ktrace_vfs.c | 6 ++--
sys/kern/subr_exec_fd.c | 8 ++--
sys/kern/sys_aio.c | 6 ++--
sys/kern/sys_descrip.c | 16 +++++-----
sys/kern/sys_generic.c | 8 ++--
sys/kern/sys_mqueue.c | 14 ++++----
sys/kern/sys_pipe.c | 32 ++++++++++----------
sys/kern/sys_socket.c | 22 +++++++-------
sys/kern/tty_ptm.c | 8 ++--
sys/kern/uipc_domain.c | 8 ++--
sys/kern/uipc_sem.c | 16 +++++-----
sys/kern/uipc_socket.c | 18 ++++++------
sys/kern/uipc_syscalls.c | 18 ++++++------
sys/kern/uipc_usrreq.c | 10 +++---
sys/kern/vfs_syscalls.c | 48 ++++++++++++++++----------------
sys/kern/vfs_vnops.c | 24 ++++++++--------
sys/kern/vfs_xattr.c | 20 ++++++------
sys/net/bpf.c | 20 ++++++------
sys/net/if_gre.c | 6 ++--
sys/net/if_tap.c | 23 +++++++--------
sys/nfs/nfs_syscalls.c | 8 ++--
53 files changed, 316 insertions(+), 321 deletions(-)
diffs (truncated from 2719 to 300 lines):
diff -r be866250d54c -r 747d1956805e sys/compat/common/if_43.c
--- a/sys/compat/common/if_43.c Fri Sep 05 09:17:04 2014 +0000
+++ b/sys/compat/common/if_43.c Fri Sep 05 09:20:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_43.c,v 1.7 2014/07/01 05:49:18 rtr Exp $ */
+/* $NetBSD: if_43.c,v 1.8 2014/09/05 09:21:54 matt Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.7 2014/07/01 05:49:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.8 2014/09/05 09:21:54 matt Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -216,7 +216,7 @@
struct lwp *l)
{
int error;
- struct ifreq *ifr = data;
+ struct ifreq *ifr = (struct ifreq *)data;
struct ifnet *ifp = ifunit(ifr->ifr_name);
struct sockaddr *sa;
diff -r be866250d54c -r 747d1956805e sys/compat/common/uipc_syscalls_43.c
--- a/sys/compat/common/uipc_syscalls_43.c Fri Sep 05 09:17:04 2014 +0000
+++ b/sys/compat/common/uipc_syscalls_43.c Fri Sep 05 09:20:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_syscalls_43.c,v 1.44 2008/11/14 23:10:57 ad Exp $ */
+/* $NetBSD: uipc_syscalls_43.c,v 1.45 2014/09/05 09:21:54 matt Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.44 2008/11/14 23:10:57 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.45 2014/09/05 09:21:54 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -92,7 +92,7 @@
} */
int error;
- if ((error = sys_accept(l, (const void *)uap, retval)) != 0)
+ if ((error = sys_accept(l, (const struct sys_accept_args *)uap, retval)) != 0)
return error;
if (SCARG(uap, name)
@@ -113,7 +113,7 @@
int error;
- if ((error = sys_getpeername(l, (const void *)uap, retval)) != 0)
+ if ((error = sys_getpeername(l, (const struct sys_getpeername_args *)uap, retval)) != 0)
return error;
if ((error = compat_43_sa_put(SCARG(uap, asa))))
@@ -132,7 +132,7 @@
} */
int error;
- if ((error = sys_getsockname(l, (const void *)uap, retval)) != 0)
+ if ((error = sys_getsockname(l, (const struct sys_getsockname_args *)uap, retval)) != 0)
return error;
if ((error = compat_43_sa_put(SCARG(uap, asa))))
@@ -175,7 +175,7 @@
} */
int error;
- if ((error = sys_recvfrom(l, (const void *)uap, retval)))
+ if ((error = sys_recvfrom(l, (const struct sys_recvfrom_args *)uap, retval)))
return (error);
if (SCARG(uap, from) && (error = compat_43_sa_put(SCARG(uap, from))))
@@ -228,7 +228,7 @@
* XXX: maybe there can be more than one chunk of control data?
*/
if (omsg.msg_accrights && control != NULL) {
- struct cmsghdr *cmsg = mtod(control, void *);
+ struct cmsghdr *cmsg = mtod(control, struct cmsghdr *);
if (cmsg->cmsg_level == SOL_SOCKET
&& cmsg->cmsg_type == SCM_RIGHTS
@@ -249,7 +249,7 @@
mtod(from, struct osockaddr *)->sa_family =
mtod(from, struct sockaddr *)->sa_family;
- error = copyout_sockname(omsg.msg_name, &omsg.msg_namelen, 0, from);
+ error = copyout_sockname((struct sockaddr *)omsg.msg_name, &omsg.msg_namelen, 0, from);
if (from != NULL)
m_free(from);
@@ -301,7 +301,7 @@
ctl = m_get(M_WAIT, MT_CONTROL);
ctl->m_len = clen;
- cmsg = mtod(ctl, void *);
+ cmsg = mtod(ctl, struct cmsghdr *);
cmsg->cmsg_len = CMSG_SPACE(accrightslen);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
@@ -348,8 +348,8 @@
if (error != 0)
return (error);
- sa = mtod(nam, void *);
- osa = mtod(nam, void *);
+ sa = mtod(nam, struct sockaddr *);
+ osa = mtod(nam, struct osockaddr *);
sa->sa_family = osa->sa_family;
sa->sa_len = omsg.msg_namelen;
diff -r be866250d54c -r 747d1956805e sys/compat/common/vfs_syscalls_12.c
--- a/sys/compat/common/vfs_syscalls_12.c Fri Sep 05 09:17:04 2014 +0000
+++ b/sys/compat/common/vfs_syscalls_12.c Fri Sep 05 09:20:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $ */
+/* $NetBSD: vfs_syscalls_12.c,v 1.31 2014/09/05 09:21:54 matt Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.31 2014/09/05 09:21:54 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -123,7 +123,7 @@
goto out1;
}
- vp = (struct vnode *)fp->f_data;
+ vp = (struct vnode *)fp->f_vnode;
if (vp->v_type != VDIR) {
error = ENOTDIR;
goto out1;
diff -r be866250d54c -r 747d1956805e sys/compat/common/vfs_syscalls_20.c
--- a/sys/compat/common/vfs_syscalls_20.c Fri Sep 05 09:17:04 2014 +0000
+++ b/sys/compat/common/vfs_syscalls_20.c Fri Sep 05 09:20:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_20.c,v 1.37 2013/11/27 17:24:44 christos Exp $ */
+/* $NetBSD: vfs_syscalls_20.c,v 1.38 2014/09/05 09:21:54 matt Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.37 2013/11/27 17:24:44 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.38 2014/09/05 09:21:54 matt Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -179,7 +179,7 @@
/* fd_getvnode() will use the descriptor for us */
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
return (error);
- mp = ((struct vnode *)fp->f_data)->v_mount;
+ mp = fp->f_vnode->v_mount;
sbuf = malloc(sizeof(*sbuf), M_TEMP, M_WAITOK);
if ((error = dostatvfs(mp, sbuf, l, 0, 1)) != 0)
goto out;
diff -r be866250d54c -r 747d1956805e sys/compat/common/vfs_syscalls_30.c
--- a/sys/compat/common/vfs_syscalls_30.c Fri Sep 05 09:17:04 2014 +0000
+++ b/sys/compat/common/vfs_syscalls_30.c Fri Sep 05 09:20:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_30.c,v 1.33 2010/11/19 06:44:35 dholland Exp $ */
+/* $NetBSD: vfs_syscalls_30.c,v 1.34 2014/09/05 09:21:54 matt Exp $ */
/*-
* Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.33 2010/11/19 06:44:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.34 2014/09/05 09:21:54 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -227,7 +227,7 @@
goto out1;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
if (vp->v_type != VDIR) {
error = EINVAL;
goto out1;
diff -r be866250d54c -r 747d1956805e sys/compat/common/vfs_syscalls_43.c
--- a/sys/compat/common/vfs_syscalls_43.c Fri Sep 05 09:17:04 2014 +0000
+++ b/sys/compat/common/vfs_syscalls_43.c Fri Sep 05 09:20:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_43.c,v 1.56 2014/01/28 01:29:04 christos Exp $ */
+/* $NetBSD: vfs_syscalls_43.c,v 1.57 2014/09/05 09:21:54 matt Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.56 2014/01/28 01:29:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.57 2014/09/05 09:21:54 matt Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -300,7 +300,7 @@
SCARG(&nuap, fd) = SCARG(uap, fd);
SCARG(&nuap, offset) = SCARG(uap, offset);
SCARG(&nuap, whence) = SCARG(uap, whence);
- error = sys_lseek(l, &nuap, (void *)&qret);
+ error = sys_lseek(l, &nuap, (register_t *)&qret);
*(long *)retval = qret;
return (error);
}
@@ -351,7 +351,8 @@
} */
struct dirent *bdp;
struct vnode *vp;
- char *inp, *tbuf; /* Current-format */
+ void *tbuf; /* Current-format */
+ char *inp; /* Current-format */
int len, reclen; /* Current-format */
char *outp; /* Dirent12-format */
int resid, old_reclen = 0; /* Dirent12-format */
@@ -375,7 +376,7 @@
goto out1;
}
- vp = (struct vnode *)fp->f_data;
+ vp = fp->f_vnode;
if (vp->v_type != VDIR) {
error = ENOTDIR;
goto out1;
@@ -414,7 +415,7 @@
if (error)
goto out;
- inp = tbuf;
+ inp = (char *)tbuf;
outp = SCARG(uap, buf);
resid = nbytes;
if ((len = buflen - auio.uio_resid) == 0)
diff -r be866250d54c -r 747d1956805e sys/compat/common/vfs_syscalls_50.c
--- a/sys/compat/common/vfs_syscalls_50.c Fri Sep 05 09:17:04 2014 +0000
+++ b/sys/compat/common/vfs_syscalls_50.c Fri Sep 05 09:20:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_50.c,v 1.17 2012/03/13 18:40:29 elad Exp $ */
+/* $NetBSD: vfs_syscalls_50.c,v 1.18 2014/09/05 09:21:54 matt Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.17 2012/03/13 18:40:29 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.18 2014/09/05 09:21:54 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -244,7 +244,7 @@
/* fd_getvnode() will use the descriptor for us */
if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
return error;
- error = compat_50_do_sys_utimes(l, fp->f_data, NULL, 0,
+ error = compat_50_do_sys_utimes(l, fp->f_vnode, NULL, 0,
SCARG(uap, tptr));
fd_putfile(SCARG(uap, fd));
return error;
diff -r be866250d54c -r 747d1956805e sys/compat/ibcs2/ibcs2_misc.c
--- a/sys/compat/ibcs2/ibcs2_misc.c Fri Sep 05 09:17:04 2014 +0000
+++ b/sys/compat/ibcs2/ibcs2_misc.c Fri Sep 05 09:20:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ibcs2_misc.c,v 1.112 2012/10/02 01:44:27 christos Exp $ */
+/* $NetBSD: ibcs2_misc.c,v 1.113 2014/09/05 09:21:54 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -95,7 +95,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.112 2012/10/02 01:44:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.113 2014/09/05 09:21:54 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
Home |
Main Index |
Thread Index |
Old Index