mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
r24265: Add the tdb_hashsize:<tdbname> parameter
This makes it possible to set the default hashsize for any tdb. I would like to remove the "open files database hash size" in favor of this one. I'll check that removal in with the next commit, please complain/revert if it's not ok. Volker (This used to be commit e9bd7a63a8d462b1fc3bab99ff843e25bffd156b)
This commit is contained in:
parent
d18b7b1223
commit
8c154674c6
@ -696,6 +696,17 @@ TDB_CONTEXT *tdb_open_log(const char *name, int hash_size, int tdb_flags,
|
||||
log_ctx.log_fn = tdb_log;
|
||||
log_ctx.log_private = NULL;
|
||||
|
||||
if (hash_size == 0) {
|
||||
const char *base = strrchr_m(name, '/');
|
||||
if (base != NULL) {
|
||||
base += 1;
|
||||
}
|
||||
else {
|
||||
base = name;
|
||||
}
|
||||
hash_size = lp_parm_int(-1, "tdb_hashsize", base, 0);
|
||||
}
|
||||
|
||||
tdb = tdb_open_ex(name, hash_size, tdb_flags,
|
||||
open_flags, mode, &log_ctx, NULL);
|
||||
if (!tdb)
|
||||
@ -929,6 +940,17 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (hash_size == 0) {
|
||||
const char *base = strrchr_m(name, '/');
|
||||
if (base != NULL) {
|
||||
base += 1;
|
||||
}
|
||||
else {
|
||||
base = name;
|
||||
}
|
||||
hash_size = lp_parm_int(-1, "tdb_hashsize", base, 0);
|
||||
}
|
||||
|
||||
w->tdb = tdb_open_ex(name, hash_size, tdb_flags,
|
||||
open_flags, mode, &log_ctx, NULL);
|
||||
if (w->tdb == NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user