From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 01:34:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FFDE5D3; Fri, 21 Mar 2014 01:34:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA39279; Fri, 21 Mar 2014 01:34:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L1YKow033915; Fri, 21 Mar 2014 01:34:20 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L1YKWT033914; Fri, 21 Mar 2014 01:34:20 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403210134.s2L1YKWT033914@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 21 Mar 2014 01:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263460 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 21 Mar 2014 01:34:20 -0000 Author: mjg Date: Fri Mar 21 01:34:19 2014 New Revision: 263460 URL: http://svnweb.freebsd.org/changeset/base/263460 Log: Take filedesc lock only for reading when allocating new fdtable. Code populating the table does this already. MFC after: 1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Mar 21 01:32:25 2014 (r263459) +++ head/sys/kern/kern_descrip.c Fri Mar 21 01:34:19 2014 (r263460) @@ -1808,7 +1808,7 @@ fdinit(struct filedesc *fdp) newfdp = malloc(sizeof *newfdp, M_FILEDESC, M_WAITOK | M_ZERO); FILEDESC_LOCK_INIT(&newfdp->fd_fd); if (fdp != NULL) { - FILEDESC_XLOCK(fdp); + FILEDESC_SLOCK(fdp); newfdp->fd_fd.fd_cdir = fdp->fd_cdir; if (newfdp->fd_fd.fd_cdir) VREF(newfdp->fd_fd.fd_cdir); @@ -1818,7 +1818,7 @@ fdinit(struct filedesc *fdp) newfdp->fd_fd.fd_jdir = fdp->fd_jdir; if (newfdp->fd_fd.fd_jdir) VREF(newfdp->fd_fd.fd_jdir); - FILEDESC_XUNLOCK(fdp); + FILEDESC_SUNLOCK(fdp); } /* Create the file descriptor table. */