From owner-svn-src-head@freebsd.org Fri Feb 19 08:42:14 2016 Return-Path: Delivered-To: svn-src-head@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 D6655AAC84E; Fri, 19 Feb 2016 08:42:14 +0000 (UTC) (envelope-from se@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 AA39F1951; Fri, 19 Feb 2016 08:42:14 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1J8gDPH015178; Fri, 19 Feb 2016 08:42:13 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1J8gDOc015177; Fri, 19 Feb 2016 08:42:13 GMT (envelope-from se@FreeBSD.org) Message-Id: <201602190842.u1J8gDOc015177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Fri, 19 Feb 2016 08:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295800 - head/usr.bin/cap_mkdb 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.20 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, 19 Feb 2016 08:42:14 -0000 Author: se Date: Fri Feb 19 08:42:13 2016 New Revision: 295800 URL: https://svnweb.freebsd.org/changeset/base/295800 Log: Remove O_SYNC from the options passed to dbmopen(). The output file is created as a temporary file that is moved over the existing file after completion. Thus there is no need to immediately flush all created db records to the temporary file. This speeds up creation of the termcap db by a factor of 40 on my ZFS based /etc filesytem (from 25 seconds to 0.6 seconds). I have compared multiple output files created with and without O_SYNC and they came out identical each time. Nonetheless it might be best to MFC this change and the similar one for services_mkdb (r295465) at the same time when the changes to hash.c in review D5186 are merged. MFC: 1 week Modified: head/usr.bin/cap_mkdb/cap_mkdb.c Modified: head/usr.bin/cap_mkdb/cap_mkdb.c ============================================================================== --- head/usr.bin/cap_mkdb/cap_mkdb.c Fri Feb 19 08:41:47 2016 (r295799) +++ head/usr.bin/cap_mkdb/cap_mkdb.c Fri Feb 19 08:42:13 2016 (r295800) @@ -119,7 +119,7 @@ main(int argc, char *argv[]) (void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv); if ((capname = strdup(buf)) == NULL) errx(1, "strdup failed"); - if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR | O_SYNC, + if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR, DEFFILEMODE, DB_HASH, &openinfo)) == NULL) err(1, "%s", buf);