Irmin_lmdb: Add NoReadahead flag to lmdb open

This commit is contained in:
Pierre Chambart 2018-09-12 14:57:54 +02:00
parent 7a8fadb2f6
commit bde9ba771b
No known key found for this signature in database
GPG Key ID: 43680A46F2530FCE

View File

@ -641,7 +641,7 @@ module Make
let { root ; mapsize ; readonly } = config conf in
let root = match root with None -> "irmin.ldb" | Some root -> root in
if not (Sys.file_exists root) then Unix.mkdir root 0o755 ;
let flags = Lmdb.NoTLS :: if readonly then [ Lmdb.RdOnly ] else [] in
let flags = Lmdb.NoRdAhead :: Lmdb.NoTLS :: if readonly then [ Lmdb.RdOnly ] else [] in
let file_flags = if readonly then 0o444 else 0o644 in
match Lmdb.opendir ~mapsize ~flags root file_flags with
| Error err -> Lwt.fail_with (Lmdb.string_of_error err)