Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/dev_mkdb Set explicit database layout. Default is ...



details:   https://anonhg.NetBSD.org/src/rev/cf526670bc96
branches:  trunk
changeset: 540472:cf526670bc96
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun Dec 15 18:23:00 2002 +0000

description:
Set explicit database layout.  Default is filesystem block size
and hashdb doesn't work for bucket size >= 65536.
Approved by: Jason R. Thorpe <thorpej%netbsd.org@localhost>

diffstat:

 usr.sbin/dev_mkdb/dev_mkdb.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 65711f38618e -r cf526670bc96 usr.sbin/dev_mkdb/dev_mkdb.c
--- a/usr.sbin/dev_mkdb/dev_mkdb.c      Sun Dec 15 17:48:14 2002 +0000
+++ b/usr.sbin/dev_mkdb/dev_mkdb.c      Sun Dec 15 18:23:00 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dev_mkdb.c,v 1.17 2001/07/15 17:27:32 manu Exp $       */
+/*     $NetBSD: dev_mkdb.c,v 1.18 2002/12/15 18:23:00 hannken Exp $    */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "from: @(#)dev_mkdb.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: dev_mkdb.c,v 1.17 2001/07/15 17:27:32 manu Exp $");
+__RCSID("$NetBSD: dev_mkdb.c,v 1.18 2002/12/15 18:23:00 hannken Exp $");
 #endif
 #endif /* not lint */
 
@@ -66,6 +66,15 @@
 int    main __P((int, char *[]));
 void   usage __P((void));
 
+HASHINFO openinfo = {
+       4096,           /* bsize */
+       128,            /* ffactor */
+       1024,           /* nelem */
+       2048 * 1024,    /* cachesize */
+       NULL,           /* hash() */
+       0               /* lorder */
+};
+
 int
 main(argc, argv)
        int argc;
@@ -145,7 +154,7 @@
                (void)snprintf(q, MAXPATHLEN - (long)(q - dbtmp), 
                            "%ld.tmp", tv.tv_usec);
                db = dbopen(dbtmp, O_CREAT|O_EXCL|O_EXLOCK|O_RDWR|O_TRUNC,
-                   S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, DB_HASH, NULL);
+                   S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, DB_HASH, &openinfo);
        } while (!db && (errno == EEXIST));
        if (db == NULL)
                err(1, "%s", dbtmp);



Home | Main Index | Thread Index | Old Index