mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
dbwrap_open: add 'dbwrap_optimize_readonly:* = yes' option
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
a97b588b63
commit
a20c977c7a
@ -81,6 +81,31 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (tdb_flags & TDB_CLEAR_IF_FIRST) {
|
||||
const char *base;
|
||||
bool try_readonly = false;
|
||||
|
||||
base = strrchr_m(name, '/');
|
||||
if (base != NULL) {
|
||||
base += 1;
|
||||
} else {
|
||||
base = name;
|
||||
}
|
||||
|
||||
if (dbwrap_flags & DBWRAP_FLAG_OPTIMIZE_READONLY_ACCESS) {
|
||||
try_readonly = true;
|
||||
}
|
||||
|
||||
try_readonly = lp_parm_bool(-1, "dbwrap_optimize_readonly", "*", try_readonly);
|
||||
try_readonly = lp_parm_bool(-1, "dbwrap_optimize_readonly", base, try_readonly);
|
||||
|
||||
if (try_readonly) {
|
||||
dbwrap_flags |= DBWRAP_FLAG_OPTIMIZE_READONLY_ACCESS;
|
||||
} else {
|
||||
dbwrap_flags &= ~DBWRAP_FLAG_OPTIMIZE_READONLY_ACCESS;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CLUSTER_SUPPORT
|
||||
sockname = lp_ctdbd_socket();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user