summaryrefslogtreecommitdiff
path: root/libdb/common/util_cache.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-29 08:54:35 -0400
committerMatthew Barnes <mbarnes@redhat.com>2009-09-29 08:54:35 -0400
commit675e07ffa7a8c40aefbe75dee860bd4ba774af8a (patch)
treeaf2f5289cc28293a552cdb1f6ea5fb190c50ed48 /libdb/common/util_cache.c
parentd2da0d5600bfb23e6bcdd3c8359c628c9ea9846b (diff)
downloadevolution-data-server-675e07ffa7a8c40aefbe75dee860bd4ba774af8a.tar.gz
Bug 410164 - Remove local copy of Berkeley DB (libdb)
There's no technical need to embed it in evolution-data-server any longer. Sun can reverse this commit to restore it in their package.
Diffstat (limited to 'libdb/common/util_cache.c')
-rw-r--r--libdb/common/util_cache.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/libdb/common/util_cache.c b/libdb/common/util_cache.c
deleted file mode 100644
index b7954fc7a..000000000
--- a/libdb/common/util_cache.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * See the file LICENSE for redistribution information.
- *
- * Copyright (c) 2000-2002
- * Sleepycat Software. All rights reserved.
- */
-
-#include "db_config.h"
-
-#ifndef lint
-static const char revid[] = "$Id$";
-#endif /* not lint */
-
-#ifndef NO_SYSTEM_INCLUDES
-#include <sys/types.h>
-
-#include <stdlib.h>
-
-#include <string.h>
-#include <unistd.h>
-#endif
-
-#include "db_int.h"
-
-/*
- * __db_util_cache --
- * Compute if we have enough cache.
- *
- * PUBLIC: int __db_util_cache __P((DB_ENV *, DB *, u_int32_t *, int *));
- */
-int
-__db_util_cache(dbenv, dbp, cachep, resizep)
- DB_ENV *dbenv;
- DB *dbp;
- u_int32_t *cachep;
- int *resizep;
-{
- DBTYPE type;
- DB_BTREE_STAT *bsp;
- DB_HASH_STAT *hsp;
- DB_QUEUE_STAT *qsp;
- u_int32_t pgsize;
- int ret;
- void *sp;
-
- /*
- * The current cache size is in cachep. If it's insufficient, set the
- * the memory referenced by resizep to 1 and set cachep to the minimum
- * size needed.
- */
- if ((ret = dbp->get_type(dbp, &type)) != 0) {
- dbenv->err(dbenv, ret, "DB->get_type");
- return (ret);
- }
-
- if ((ret = dbp->stat(dbp, &sp, DB_FAST_STAT)) != 0) {
- dbenv->err(dbenv, ret, "DB->stat");
- return (ret);
- }
-
- switch (type) {
- case DB_QUEUE:
- qsp = (DB_QUEUE_STAT *)sp;
- pgsize = qsp->qs_pagesize;
- break;
- case DB_HASH:
- hsp = (DB_HASH_STAT *)sp;
- pgsize = hsp->hash_pagesize;
- break;
- case DB_BTREE:
- case DB_RECNO:
- bsp = (DB_BTREE_STAT *)sp;
- pgsize = bsp->bt_pagesize;
- break;
- default:
- dbenv->err(dbenv, ret, "unknown database type: %d", type);
- return (EINVAL);
- }
- free(sp);
-
- /*
- * Make sure our current cache is big enough. We want at least
- * DB_MINPAGECACHE pages in the cache.
- */
- if ((*cachep / pgsize) < DB_MINPAGECACHE) {
- *resizep = 1;
- *cachep = pgsize * DB_MINPAGECACHE;
- } else
- *resizep = 0;
-
- return (0);
-}