From owner-svn-src-all@freebsd.org Sat Jan 9 17:03:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF18A684DC; Sat, 9 Jan 2016 17:03:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80FB31E31; Sat, 9 Jan 2016 17:03:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H3rYN051266; Sat, 9 Jan 2016 17:03:53 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H3rgA051265; Sat, 9 Jan 2016 17:03:53 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091703.u09H3rgA051265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293559 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:03:54 -0000 Author: dchagin Date: Sat Jan 9 17:03:53 2016 New Revision: 293559 URL: https://svnweb.freebsd.org/changeset/base/293559 Log: MFC r283455: Use local struct proc * varable instead of dereferencing td->td_proc. Modified: stable/10/sys/compat/linux/linux_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:02:35 2016 (r293558) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:03:53 2016 (r293559) @@ -85,8 +85,11 @@ linux_proc_init(struct thread *td, struc struct linux_emuldata *em; struct linux_pemuldata *pem; struct epoll_emuldata *emd; + struct proc *p; if (newtd != NULL) { + p = newtd->td_proc; + /* non-exec call */ em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO); if (flags & LINUX_CLONE_THREAD) { @@ -95,26 +98,26 @@ linux_proc_init(struct thread *td, struc em->em_tid = newtd->td_tid; } else { - LINUX_CTR1(proc_init, "fork newtd(%d)", - newtd->td_proc->p_pid); + LINUX_CTR1(proc_init, "fork newtd(%d)", p->p_pid); - em->em_tid = newtd->td_proc->p_pid; + em->em_tid = p->p_pid; pem = malloc(sizeof(*pem), M_LINUX, M_WAITOK | M_ZERO); sx_init(&pem->pem_sx, "lpemlk"); - newtd->td_proc->p_emuldata = pem; + p->p_emuldata = pem; } newtd->td_emuldata = em; } else { + p = td->td_proc; + /* exec */ - LINUX_CTR1(proc_init, "exec newtd(%d)", - td->td_proc->p_pid); + LINUX_CTR1(proc_init, "exec newtd(%d)", p->p_pid); /* lookup the old one */ em = em_find(td); KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n")); - em->em_tid = td->td_proc->p_pid; + em->em_tid = p->p_pid; em->flags = 0; em->pdeath_signal = 0; em->robust_futexes = NULL; @@ -122,7 +125,7 @@ linux_proc_init(struct thread *td, struc em->child_set_tid = NULL; /* epoll should be destroyed in a case of exec. */ - pem = pem_find(td->td_proc); + pem = pem_find(p); KASSERT(pem != NULL, ("proc_exit: proc emuldata not found.\n")); if (pem->epoll != NULL) {