Date: Mon, 12 Apr 2010 21:13:03 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r206509 - stable/7/lib/libc/db/hash Message-ID: <201004122113.o3CLD3ht042072@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Mon Apr 12 21:13:03 2010 New Revision: 206509 URL: http://svn.freebsd.org/changeset/base/206509 Log: MFC r206178: ibc/db/hash: cap auto-tuned block size Modified: stable/7/lib/libc/db/hash/hash.c stable/7/lib/libc/db/hash/hash.h Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/db/hash/hash.c ============================================================================== --- stable/7/lib/libc/db/hash/hash.c Mon Apr 12 21:12:03 2010 (r206508) +++ stable/7/lib/libc/db/hash/hash.c Mon Apr 12 21:13:03 2010 (r206509) @@ -309,6 +309,8 @@ init_hash(hashp, file, info) if (stat(file, &statbuf)) return (NULL); hashp->BSIZE = statbuf.st_blksize; + if (hashp->BSIZE > MAX_BSIZE) + hashp->BSIZE = MAX_BSIZE; hashp->BSHIFT = __log2(hashp->BSIZE); } Modified: stable/7/lib/libc/db/hash/hash.h ============================================================================== --- stable/7/lib/libc/db/hash/hash.h Mon Apr 12 21:12:03 2010 (r206508) +++ stable/7/lib/libc/db/hash/hash.h Mon Apr 12 21:13:03 2010 (r206509) @@ -118,7 +118,7 @@ typedef struct htab { /* Memory reside /* * Constants */ -#define MAX_BSIZE 65536 /* 2^16 */ +#define MAX_BSIZE 32768 /* 2^15 but should be 65536 */ #define MIN_BUFFERS 6 #define MINHDRSIZE 512 #define DEF_BUFSIZE 65536 /* 64 K */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004122113.o3CLD3ht042072>