From owner-svn-src-all@FreeBSD.ORG Wed May 20 18:42:04 2009 Return-Path: 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 C6DFE106564A; Wed, 20 May 2009 18:42:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B553B8FC0A; Wed, 20 May 2009 18:42:04 +0000 (UTC) (envelope-from jhb@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 n4KIg4hb040231; Wed, 20 May 2009 18:42:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KIg4Na040230; Wed, 20 May 2009 18:42:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905201842.n4KIg4Na040230@svn.freebsd.org> From: John Baldwin Date: Wed, 20 May 2009 18:42:04 +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: r192461 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 20 May 2009 18:42:05 -0000 Author: jhb Date: Wed May 20 18:42:04 2009 New Revision: 192461 URL: http://svn.freebsd.org/changeset/base/192461 Log: Set the umask in a new file descriptor table earlier in fdcopy() to remove two lock operations. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed May 20 18:38:43 2009 (r192460) +++ head/sys/kern/kern_descrip.c Wed May 20 18:42:04 2009 (r192461) @@ -1626,17 +1626,15 @@ fdcopy(struct filedesc *fdp) newfdp->fd_freefile = i; } } + newfdp->fd_cmask = fdp->fd_cmask; FILEDESC_SUNLOCK(fdp); FILEDESC_XLOCK(newfdp); for (i = 0; i <= newfdp->fd_lastfile; ++i) if (newfdp->fd_ofiles[i] != NULL) fdused(newfdp, i); - FILEDESC_XUNLOCK(newfdp); - FILEDESC_SLOCK(fdp); if (newfdp->fd_freefile == -1) newfdp->fd_freefile = i; - newfdp->fd_cmask = fdp->fd_cmask; - FILEDESC_SUNLOCK(fdp); + FILEDESC_XUNLOCK(newfdp); return (newfdp); }