diff options
author | jamie <jamie@FreeBSD.org> | 2009-06-15 19:01:53 +0000 |
---|---|---|
committer | jamie <jamie@FreeBSD.org> | 2009-06-15 19:01:53 +0000 |
commit | f950eed7d778168cbdc3411fb2604c92e03531b8 (patch) | |
tree | a6d05b7f6dd58090ebf3e1b0556017742e4368b1 /sys | |
parent | 5675a54fb1a409499766ce55a009367c043fdc28 (diff) | |
download | FreeBSD-src-f950eed7d778168cbdc3411fb2604c92e03531b8.zip FreeBSD-src-f950eed7d778168cbdc3411fb2604c92e03531b8.tar.gz |
Get vnets from creds instead of threads where they're available, and from
passed threads instead of curthread.
Reviewed by: zec, julian
Approved by: bz (mentor)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 2 | ||||
-rw-r--r-- | sys/compat/linux/linux_ioctl.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 2 | ||||
-rw-r--r-- | sys/kern/uipc_socket.c | 2 | ||||
-rw-r--r-- | sys/net/if_tun.c | 2 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 7f89e41..37b656b 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1079,7 +1079,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) static int linprocfs_donetdev(PFS_FILL_ARGS) { - INIT_VNET_NET(TD_TO_VNET(curthread)); + INIT_VNET_NET(TD_TO_VNET(td)); char ifname[16]; /* XXX LINUX_IFNAMSIZ */ struct ifnet *ifp; diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 685979e..fc3ce46 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2091,9 +2091,9 @@ linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) */ static struct ifnet * -ifname_linux_to_bsd(const char *lxname, char *bsdname) +ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) { - INIT_VNET_NET(TD_TO_VNET(curthread)); + INIT_VNET_NET(TD_TO_VNET(td)); struct ifnet *ifp; int len, unit; char *ep; @@ -2379,7 +2379,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) printf("%s(): ioctl %d on %.*s\n", __func__, args->cmd & 0xffff, LINUX_IFNAMSIZ, lifname); #endif - ifp = ifname_linux_to_bsd(lifname, ifname); + ifp = ifname_linux_to_bsd(td, lifname, ifname); if (ifp == NULL) return (EINVAL); /* diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index a9c2a33..a9022ce 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1599,7 +1599,7 @@ userland_sysctl(struct thread *td, int *name, u_int namelen, void *old, sx_xlock(&sysctlmemlock); } else memlocked = 0; - CURVNET_SET(TD_TO_VNET(curthread)); + CURVNET_SET(TD_TO_VNET(td)); for (;;) { req.oldidx = 0; diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 71856b3..2abdc2c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -359,7 +359,7 @@ socreate(int dom, struct socket **aso, int type, int proto, if (prp->pr_type != type) return (EPROTOTYPE); - so = soalloc(TD_TO_VNET(td)); + so = soalloc(CRED_TO_VNET(cred)); if (so == NULL) return (ENOBUFS); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 03dd4ab..5d2355a 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -226,7 +226,7 @@ tunclone(void *arg, struct ucred *cred, char *name, int namelen, else append_unit = 0; - CURVNET_SET(TD_TO_VNET(curthread)); + CURVNET_SET(CRED_TO_VNET(cred)); /* find any existing device, or allocate new unit number */ i = clone_create(&tunclones, &tun_cdevsw, &u, dev, 0); if (i) { diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index fc49344..2c9d628 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -131,7 +131,7 @@ static int tcp_inflight_stab; static int sysctl_net_inet_tcp_mss_check(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET(curvnet); + INIT_VNET_INET(TD_TO_VNET(req->td)); int error, new; new = V_tcp_mssdflt; @@ -154,7 +154,7 @@ SYSCTL_V_PROC(V_NET, vnet_inet, _net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, static int sysctl_net_inet_tcp_mss_v6_check(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET(curvnet); + INIT_VNET_INET(TD_TO_VNET(req->td)); int error, new; new = V_tcp_v6mssdflt; diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 10fc0f0..c2c586e 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -456,7 +456,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); break; \ case V_NET: \ cp = (char *) \ - TD_TO_VNET(curthread)->mod_data[oidp->oid_v_mod]; \ + TD_TO_VNET(req->td)->mod_data[oidp->oid_v_mod]; \ arg1 = cp + (size_t) arg1; \ break; \ case V_PROCG: \ |