From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:01:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BC5C106564A; Mon, 15 Jun 2009 19:01:54 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78C458FC16; Mon, 15 Jun 2009 19:01:54 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FJ1svG098406; Mon, 15 Jun 2009 19:01:54 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FJ1s82098399; Mon, 15 Jun 2009 19:01:54 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200906151901.n5FJ1s82098399@svn.freebsd.org> From: Jamie Gritton Date: Mon, 15 Jun 2009 19:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194252 - in head/sys: compat/linprocfs compat/linux kern net netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 19:01:54 -0000 Author: jamie Date: Mon Jun 15 19:01:53 2009 New Revision: 194252 URL: http://svn.freebsd.org/changeset/base/194252 Log: 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) Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_ioctl.c head/sys/kern/kern_sysctl.c head/sys/kern/uipc_socket.c head/sys/net/if_tun.c head/sys/netinet/tcp_subr.c head/sys/sys/sysctl.h Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/compat/linprocfs/linprocfs.c Mon Jun 15 19:01:53 2009 (r194252) @@ -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; Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/compat/linux/linux_ioctl.c Mon Jun 15 19:01:53 2009 (r194252) @@ -2091,9 +2091,9 @@ linux_ifname(struct ifnet *ifp, char *bu */ 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, st 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); /* Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/kern/kern_sysctl.c Mon Jun 15 19:01:53 2009 (r194252) @@ -1599,7 +1599,7 @@ userland_sysctl(struct thread *td, int * sx_xlock(&sysctlmemlock); } else memlocked = 0; - CURVNET_SET(TD_TO_VNET(curthread)); + CURVNET_SET(TD_TO_VNET(td)); for (;;) { req.oldidx = 0; Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/kern/uipc_socket.c Mon Jun 15 19:01:53 2009 (r194252) @@ -359,7 +359,7 @@ socreate(int dom, struct socket **aso, i if (prp->pr_type != type) return (EPROTOTYPE); - so = soalloc(TD_TO_VNET(td)); + so = soalloc(CRED_TO_VNET(cred)); if (so == NULL) return (ENOBUFS); Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/net/if_tun.c Mon Jun 15 19:01:53 2009 (r194252) @@ -226,7 +226,7 @@ tunclone(void *arg, struct ucred *cred, 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) { Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/netinet/tcp_subr.c Mon Jun 15 19:01:53 2009 (r194252) @@ -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_ine 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; Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/sys/sysctl.h Mon Jun 15 19:01:53 2009 (r194252) @@ -456,7 +456,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e 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: \