From owner-svn-src-head@FreeBSD.ORG Thu Feb 26 19:23:50 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 D44111065835; Thu, 26 Feb 2009 19:23:48 +0000 (UTC) (envelope-from owner-svn-src-all@freebsd.org) Received: from forwards5.yandex.ru (forwards5.yandex.ru [77.88.61.37]) by mx1.freebsd.org (Postfix) with ESMTP id B33A48FC0C; Thu, 26 Feb 2009 19:23:40 +0000 (UTC) (envelope-from owner-svn-src-all@freebsd.org) Received: from mxfront13.yandex.ru (mxfront13.yandex.ru [77.88.47.149]) by forwards5.yandex.ru (Yandex) with ESMTP id 8ED42B7C117; Thu, 26 Feb 2009 22:17:29 +0300 (MSK) Received: from mx2.freebsd.org ([69.147.83.53]:3271 "EHLO mx2.freebsd.org" smtp-auth: TLS-CIPHER: TLS-PEER-CN1: ) by mail.yandex.ru with ESMTP id S7457734AbZBZQdJ for (+ 2 others); Thu, 26 Feb 2009 19:33:09 +0300 X-Yandex-TimeMark: 1235665989 X-Yandex-Spam: 2 X-Yandex-Front: mxfront13 Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 327611A6A13; Thu, 26 Feb 2009 16:33:00 +0000 (UTC) (envelope-from owner-svn-src-all@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 82425106583E; Thu, 26 Feb 2009 16:32:58 +0000 (UTC) (envelope-from owner-svn-src-all@freebsd.org) Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6486E1065734; Thu, 26 Feb 2009 16:32:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37C4C8FC1A; Thu, 26 Feb 2009 16:32:49 +0000 (UTC) (envelope-from ed@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 n1QGWnap032558; Thu, 26 Feb 2009 16:32:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1QGWn06032557; Thu, 26 Feb 2009 16:32:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902261632.n1QGWn06032557@svn.freebsd.org> From: Ed Schouten Date: Thu, 26 Feb 2009 16:32:49 +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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-svn-src-all@freebsd.org Errors-To: owner-svn-src-all@freebsd.org Cc: Subject: svn commit: r189076 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org 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: Thu, 26 Feb 2009 19:24:08 -0000 Author: ed Date: Thu Feb 26 16:32:48 2009 New Revision: 189076 URL: http://svn.freebsd.org/changeset/base/189076 Log: Remove unneeded pointer `ndp'. Inside do_execve(), we have a pointer `ndp', which always points to `&nd'. I can imagine a primitive (non-optimizing) compiler to really reserve space for such a pointer, so just remove the variable and use `&nd' directly. Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Feb 26 15:59:22 2009 (r189075) +++ head/sys/kern/kern_exec.c Thu Feb 26 16:32:48 2009 (r189076) @@ -318,7 +318,7 @@ do_execve(td, args, mac_p) struct mac *mac_p; { struct proc *p = td->td_proc; - struct nameidata nd, *ndp; + struct nameidata nd; struct ucred *newcred = NULL, *oldcred; struct uidinfo *euip; register_t *stack_base; @@ -396,8 +396,7 @@ do_execve(td, args, mac_p) * interpreter if this is an interpreted binary. */ if (args->fname != NULL) { - ndp = &nd; - NDINIT(ndp, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME + NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME | MPSAFE | AUDITVNODE1, UIO_SYSSPACE, args->fname, td); } @@ -405,12 +404,12 @@ do_execve(td, args, mac_p) interpret: if (args->fname != NULL) { - error = namei(ndp); + error = namei(&nd); if (error) goto exec_fail; - vfslocked = NDHASGIANT(ndp); - binvp = ndp->ni_vp; + vfslocked = NDHASGIANT(&nd); + binvp = nd.ni_vp; imgp->vp = binvp; } else { AUDIT_ARG(fd, args->fd); @@ -495,7 +494,7 @@ interpret: imgp->vp->v_vflag &= ~VV_TEXT; /* free name buffer and old vnode */ if (args->fname != NULL) - NDFREE(ndp, NDF_ONLY_PNBUF); + NDFREE(&nd, NDF_ONLY_PNBUF); #ifdef MAC mac_execve_interpreter_enter(binvp, &interpvplabel); #endif @@ -509,7 +508,7 @@ interpret: VFS_UNLOCK_GIANT(vfslocked); vfslocked = 0; /* set new name to that of the interpreter */ - NDINIT(ndp, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME | MPSAFE, + NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME | MPSAFE, UIO_SYSSPACE, imgp->interpreter_name, td); args->fname = imgp->interpreter_name; goto interpret; @@ -588,8 +587,8 @@ interpret: /* name this process - nameiexec(p, ndp) */ if (args->fname) { - len = min(ndp->ni_cnd.cn_namelen,MAXCOMLEN); - bcopy(ndp->ni_cnd.cn_nameptr, p->p_comm, len); + len = min(nd.ni_cnd.cn_namelen,MAXCOMLEN); + bcopy(nd.ni_cnd.cn_nameptr, p->p_comm, len); } else { if (vn_commname(binvp, p->p_comm, MAXCOMLEN + 1) == 0) len = MAXCOMLEN; @@ -851,7 +850,7 @@ exec_fail_dealloc: if (imgp->vp != NULL) { if (args->fname) - NDFREE(ndp, NDF_ONLY_PNBUF); + NDFREE(&nd, NDF_ONLY_PNBUF); if (imgp->opened) VOP_CLOSE(imgp->vp, FREAD, td->td_ucred, td); vput(imgp->vp); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"