From c768fee001685094768c2b024a4afdb2be2cbafe Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Fri, 15 Apr 2011 15:35:14 +0200 Subject: [PATCH 1/1] Further fix previous branch 2-1 merge --- etc/cnid_dbd/cmd_dbd.c | 6 +++--- etc/cnid_dbd/cmd_dbd_scanvol.c | 4 +++- etc/cnid_dbd/db_param.c | 10 ---------- etc/cnid_dbd/db_param.h | 10 ++++++++++ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/etc/cnid_dbd/cmd_dbd.c b/etc/cnid_dbd/cmd_dbd.c index de1803ea..5c29e19c 100644 --- a/etc/cnid_dbd/cmd_dbd.c +++ b/etc/cnid_dbd/cmd_dbd.c @@ -90,9 +90,9 @@ static int exclusive; /* Exclusive volume access */ static struct db_param db_param = { NULL, /* Volume dirpath */ 1, /* bdb logfile autoremove */ - 256 * 1024, /* bdb cachesize (256 MB) */ - 5000, /* maxlocks */ - 5000, /* maxlockobjs */ + 64 * 1024, /* bdb cachesize (64 MB) */ + DEFAULT_MAXLOCKS, /* maxlocks */ + DEFAULT_MAXLOCKOBJS, /* maxlockobjs */ -1, /* not used ... */ -1, "", diff --git a/etc/cnid_dbd/cmd_dbd_scanvol.c b/etc/cnid_dbd/cmd_dbd_scanvol.c index 7666807d..f263329d 100644 --- a/etc/cnid_dbd/cmd_dbd_scanvol.c +++ b/etc/cnid_dbd/cmd_dbd_scanvol.c @@ -1160,7 +1160,9 @@ int cmd_dbd_scanvol(DBD *dbd_ref, struct volinfo *vi, dbd_flags_t flags) const char *tmpdb_path = NULL; /* Set cachesize for in-memory rebuild db */ - db_param.cachesize = 256 * 1024 * 1024; /* 128 MB */ + db_param.cachesize = 128 * 1024; /* 128 MB */ + db_param.maxlocks = DEFAULT_MAXLOCKS; + db_param.maxlockobjs = DEFAULT_MAXLOCKOBJS; /* Make it accessible for all funcs */ dbd = dbd_ref; diff --git a/etc/cnid_dbd/db_param.c b/etc/cnid_dbd/db_param.c index e31e7827..c89f8e5c 100644 --- a/etc/cnid_dbd/db_param.c +++ b/etc/cnid_dbd/db_param.c @@ -25,16 +25,6 @@ #define DB_PARAM_FN "db_param" #define MAXKEYLEN 64 -#define DEFAULT_LOGFILE_AUTOREMOVE 1 -#define DEFAULT_CACHESIZE (8 * 1024) /* KB, so 8 MB */ -#define DEFAULT_MAXLOCKS 5000 -#define DEFAULT_MAXLOCKOBJS 5000 -#define DEFAULT_FLUSH_FREQUENCY 1000 -#define DEFAULT_FLUSH_INTERVAL 1800 -#define DEFAULT_USOCK_FILE "usock" -#define DEFAULT_FD_TABLE_SIZE 512 -#define DEFAULT_IDLE_TIMEOUT (10 * 60) - static struct db_param params; static int parse_err; diff --git a/etc/cnid_dbd/db_param.h b/etc/cnid_dbd/db_param.h index 67ec62e4..f3a4827a 100644 --- a/etc/cnid_dbd/db_param.h +++ b/etc/cnid_dbd/db_param.h @@ -10,6 +10,16 @@ #include #include +#define DEFAULT_LOGFILE_AUTOREMOVE 1 +#define DEFAULT_CACHESIZE (8 * 1024) /* KB, so 8 MB */ +#define DEFAULT_MAXLOCKS 5000 +#define DEFAULT_MAXLOCKOBJS 5000 +#define DEFAULT_FLUSH_FREQUENCY 1000 +#define DEFAULT_FLUSH_INTERVAL 1800 +#define DEFAULT_USOCK_FILE "usock" +#define DEFAULT_FD_TABLE_SIZE 512 +#define DEFAULT_IDLE_TIMEOUT (10 * 60) + struct db_param { char *dir; int logfile_autoremove; -- 2.39.2