From c12d886224819ac78ae1335ceddcafaaad49d393 Mon Sep 17 00:00:00 2001 From: Jan Doms Date: Wed, 10 May 2017 22:26:16 +0200 Subject: [PATCH 1/4] robustify stress2 --- setup/setup.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup/setup.ml b/setup/setup.ml index 62968846..8aec5a1c 100644 --- a/setup/setup.ml +++ b/setup/setup.ml @@ -3061,12 +3061,19 @@ module Test = struct let proxy = t_global.proxy in let rec inner = function - | 1_000 -> () + | 100_000 -> () | n -> let namespace = Printf.sprintf "ns_%i" n in let objname = "obj" in proxy # create_namespace namespace; - proxy # upload_object namespace cfg_global.alba_bin objname; + let () = + try + proxy # upload_object namespace cfg_global.alba_bin objname + with exn -> + print_endline (Printexc.to_string exn); + Unix.sleep 3; + proxy # upload_object namespace cfg_global.alba_bin objname + in proxy # download_object namespace objname "/tmp/427.obj"; proxy # delete_namespace namespace; inner (n + 1) From 26a3e7525efdecb1872bcc4637e911ce240dc436 Mon Sep 17 00:00:00 2001 From: Jan Doms Date: Thu, 11 May 2017 11:14:29 +0200 Subject: [PATCH 2/4] tail recursive List.map --- ocaml/src/tools/prelude.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ocaml/src/tools/prelude.ml b/ocaml/src/tools/prelude.ml index fe1c8423..b05b9d6a 100644 --- a/ocaml/src/tools/prelude.ml +++ b/ocaml/src/tools/prelude.ml @@ -136,6 +136,10 @@ end module List = struct include List + (* include tail recursive variants *) + let map f l = Core.List.map ~f l + let mapi f l = Core.List.mapi ~f l + let any = function | [] -> false | _ -> true From 1fb148d606b98999db925247cdb128551c8e6e21 Mon Sep 17 00:00:00 2001 From: Jan Doms Date: Thu, 11 May 2017 14:32:16 +0200 Subject: [PATCH 3/4] ensure Prelude is opened from all files --- Makefile | 4 ++-- jenkins/run2.sh | 2 ++ ocaml/src/alba.ml | 2 +- ocaml/src/alba_arakoon.ml | 2 +- ocaml/src/alba_arakoon_deser.ml | 2 +- ocaml/src/alba_base_client.ml | 2 +- ocaml/src/alba_based_osd.ml | 2 +- ocaml/src/alba_bench.ml | 2 +- ocaml/src/alba_client.ml | 2 +- ocaml/src/alba_client2.ml | 2 ++ ocaml/src/alba_client_common.ml | 2 +- ocaml/src/alba_client_download.ml | 2 +- ocaml/src/alba_client_download_slices.ml | 2 +- ocaml/src/alba_client_errors.ml | 2 ++ ocaml/src/alba_client_message_delivery.ml | 2 +- .../src/alba_client_message_delivery_base.ml | 2 +- ocaml/src/alba_client_namespace.ml | 1 + ocaml/src/alba_client_osd.ml | 2 +- ocaml/src/alba_client_preset_cache.ml | 2 +- ocaml/src/alba_client_sequence.ml | 2 +- ocaml/src/alba_client_upload.ml | 2 +- ocaml/src/alba_eviction.ml | 2 +- ocaml/src/alba_json.ml | 2 +- ocaml/src/alba_osd.ml | 2 +- ocaml/src/alba_osd_test.ml | 2 +- ocaml/src/alba_statistics.ml | 2 ++ ocaml/src/alba_test.ml | 2 +- ocaml/src/albamgr_access.ml | 1 + ocaml/src/albamgr_client.ml | 2 +- ocaml/src/albamgr_plugin.ml | 2 +- ocaml/src/albamgr_protocol.ml | 2 +- ocaml/src/albamgr_protocol_test.ml | 1 + ocaml/src/albamgr_test.ml | 2 +- ocaml/src/arith64.ml | 2 ++ ocaml/src/asd_bench.ml | 2 +- ocaml/src/asd_client.ml | 2 +- ocaml/src/asd_config.ml | 2 ++ ocaml/src/asd_io_scheduler.ml | 2 +- ocaml/src/asd_protocol.ml | 2 +- ocaml/src/asd_protocol_test.ml | 2 ++ ocaml/src/asd_server.ml | 2 +- ocaml/src/asd_statistics.ml | 2 ++ ocaml/src/asd_test.ml | 2 +- ocaml/src/automatic_repair.ml | 2 +- ocaml/src/capabilities.ml | 2 +- ocaml/src/choose.ml | 2 ++ ocaml/src/choose_test.ml | 2 +- ocaml/src/cli_asd.ml | 2 +- ocaml/src/cli_bench.ml | 2 +- ocaml/src/cli_bench_common.ml | 1 + ocaml/src/cli_common.ml | 3 +-- ocaml/src/cli_maintenance.ml | 3 +-- ocaml/src/cli_messages.ml | 2 +- ocaml/src/cli_mgr.ml | 2 +- ocaml/src/cli_nsm_host.ml | 2 +- ocaml/src/cli_osd.ml | 2 +- ocaml/src/cli_preset.ml | 2 +- ocaml/src/cli_proxy.ml | 2 +- ocaml/src/discovery.ml | 2 +- ocaml/src/disk_failure_tests.ml | 2 +- ocaml/src/disk_safety.ml | 2 +- ocaml/src/disk_safety_test.ml | 2 +- ocaml/src/encrypt_info_helper.ml | 2 +- ocaml/src/erasure.ml | 2 +- ocaml/src/erasure_test.ml | 2 +- ocaml/src/experiments/discovery_demo.ml | 2 ++ ocaml/src/fragment_cache.ml | 2 +- ocaml/src/fragment_cache_alba.ml | 2 +- ocaml/src/fragment_cache_config.ml | 2 +- ocaml/src/fragment_cache_config_test.ml | 1 + ocaml/src/fragment_cache_fs.ml | 2 +- ocaml/src/fragment_cache_keys.ml | 2 +- ocaml/src/fragment_cache_test.ml | 3 +-- ocaml/src/fragment_helper.ml | 2 +- ocaml/src/fragment_helper_test.ml | 2 +- ocaml/src/fragment_size_helper_test.ml | 1 + ocaml/src/fsutil_demo.ml | 1 + ocaml/src/generic_bench.ml | 1 + ocaml/src/isa_l.ml | 1 + ocaml/src/jerasure.ml | 1 + ocaml/src/key_value_store.ml | 2 +- ocaml/src/kinetic_client.ml | 2 +- ocaml/src/kinetic_client_test.ml | 2 +- ocaml/src/log_plugin.ml | 2 +- ocaml/src/maintenance.ml | 2 +- ocaml/src/maintenance_common.ml | 1 + ocaml/src/maintenance_config.ml | 2 +- ocaml/src/maintenance_coordination.ml | 2 +- ocaml/src/maintenance_coordination_test.ml | 1 + ocaml/src/maintenance_helper.ml | 2 +- ocaml/src/maintenance_test.ml | 2 +- ocaml/src/manifest_cache.ml | 2 +- ocaml/src/manifest_deser.ml | 19 +++++++++++++++++++ ocaml/src/mem_key_value_store.ml | 2 +- ocaml/src/mem_stats.ml | 1 + ocaml/src/model/alba_compression.ml | 2 +- ocaml/src/model/checksum.ml | 2 +- ocaml/src/model/checksum_deser.ml | 1 + ocaml/src/model/consistency.ml | 2 +- ocaml/src/model/encryption.ml | 2 +- ocaml/src/model/encryption_test.ml | 2 ++ ocaml/src/model/fragment.ml | 2 +- ocaml/src/model/fragment_size_helper.ml | 2 ++ ocaml/src/model/fragment_update.ml | 2 +- ocaml/src/model/layout.ml | 2 +- ocaml/src/model/policy.ml | 2 +- ocaml/src/model/policy_test.ml | 1 + ocaml/src/model/preset.ml | 2 +- ocaml/src/nsm_client.ml | 2 +- ocaml/src/nsm_host_access.ml | 2 +- ocaml/src/nsm_host_client.ml | 2 +- ocaml/src/nsm_host_plugin.ml | 2 +- ocaml/src/nsm_host_protocol.ml | 2 +- ocaml/src/nsm_model.ml | 2 +- ocaml/src/nsm_model_test.ml | 1 + ocaml/src/nsm_protocol.ml | 2 +- ocaml/src/nsm_protocol_test.ml | 1 + ocaml/src/osd.ml | 2 +- ocaml/src/osd_access.ml | 2 +- ocaml/src/osd_access_type.ml | 2 +- ocaml/src/osd_bench.ml | 2 +- ocaml/src/osd_deser.ml | 2 +- ocaml/src/osd_keys.ml | 2 +- ocaml/src/osd_kvs_test.ml | 2 +- ocaml/src/osd_state.ml | 2 +- ocaml/src/other/posix.ml | 2 ++ ocaml/src/other/posix_test.ml | 1 + ocaml/src/plugin_extra.ml | 2 +- ocaml/src/proxy_bench.ml | 2 +- ocaml/src/proxy_client.ml | 2 +- ocaml/src/proxy_osd.ml | 2 +- ocaml/src/proxy_osd_test.ml | 1 + ocaml/src/proxy_protocol.ml | 2 +- ocaml/src/proxy_server.ml | 2 +- ocaml/src/proxy_test.ml | 1 + ocaml/src/range_query_args.ml | 2 ++ ocaml/src/range_query_args2.ml | 2 ++ ocaml/src/read_preference_test.ml | 2 +- ocaml/src/rebalancing_helper.ml | 4 ++-- ocaml/src/rebalancing_helper_test.ml | 2 ++ ocaml/src/recover_nsm_host.ml | 2 +- ocaml/src/recovery_info.ml | 2 +- ocaml/src/remotes.ml | 2 +- ocaml/src/repair.ml | 2 +- ocaml/src/rocks_store.ml | 2 +- ocaml/src/sync_bench.ml | 2 +- ocaml/src/test.ml | 1 + ocaml/src/tools/alba_crc32c.ml | 2 ++ ocaml/src/tools/alba_crc32c_test.ml | 2 +- ocaml/src/tools/alba_interval.ml | 2 +- ocaml/src/tools/alba_llio.ml | 2 ++ ocaml/src/tools/alba_partial_read.ml | 2 ++ ocaml/src/tools/alba_wrappers.ml | 2 ++ ocaml/src/tools/bigstring_slice.ml | 1 + ocaml/src/tools/buffer_pool.ml | 2 ++ ocaml/src/tools/buffer_pool_test.ml | 1 + ocaml/src/tools/bytes_descr.ml | 2 +- ocaml/src/tools/cache.ml | 2 ++ ocaml/src/tools/cache_test.ml | 1 + ocaml/src/tools/compressors.ml | 2 +- ocaml/src/tools/compressors_test.ml | 1 + ocaml/src/tools/ctypes_helper.ml | 2 +- ocaml/src/tools/deser.ml | 2 +- ocaml/src/tools/fsutil.ml | 1 + ocaml/src/tools/gcrypt.ml | 2 +- ocaml/src/tools/gcrypt_test.ml | 2 +- ocaml/src/tools/hashes.ml | 2 +- ocaml/src/tools/llio2.ml | 2 +- ocaml/src/tools/lwt_extra2.ml | 1 + ocaml/src/tools/lwt_pool2.ml | 2 +- ocaml/src/tools/memcmp.ml | 1 + ocaml/src/tools/memcmp_test.ml | 1 + ocaml/src/tools/net_fd.ml | 2 +- ocaml/src/tools/networking2.ml | 2 +- ocaml/src/tools/oUnit_XML.ml | 1 + ocaml/src/tools/object_reader.ml | 1 + ocaml/src/tools/object_reader2.ml | 1 + ocaml/src/tools/prelude_test.ml | 2 +- ocaml/src/tools/slice.ml | 2 +- ocaml/src/tools/stat.ml | 2 ++ ocaml/src/tools/stat_deser.ml | 1 + ocaml/src/tools/statistics_collection.ml | 2 ++ .../src/tools/statistics_collection_deser.ml | 1 + ocaml/src/tools/syncfs.ml | 1 + ocaml/src/tools/tcp_keepalive2.ml | 2 ++ ocaml/src/tools/test_extra.ml | 2 ++ ocaml/src/tools/tls.ml | 2 ++ ocaml/src/tools/weak_pool.ml | 2 ++ ocaml/src/verify.ml | 2 +- 189 files changed, 237 insertions(+), 130 deletions(-) diff --git a/Makefile b/Makefile index 3e1c035e..3d8716a7 100644 --- a/Makefile +++ b/Makefile @@ -31,11 +31,11 @@ build-cmxs: build-alba build-nsm-plugin: build-cmxs cd ocaml && ocamlfind ocamlopt \ + _build/src/tools/prelude.cmx \ _build/alba_version.cmx \ _build/src/range_query_args.cmx \ _build/src/tools/lwt_bytes2.cmx \ _build/src/tools/lwt_extra2.cmx \ - _build/src/tools/prelude.cmx \ _build/src/tools/deser.cmx \ _build/src/tools/cache.cmx \ _build/src/tools/weak_pool.cmx \ @@ -73,10 +73,10 @@ build-nsm-plugin: build-cmxs build-mgr-plugin: build-alba cd ocaml && ocamlfind ocamlopt \ + _build/src/tools/prelude.cmx \ _build/alba_version.cmx \ _build/src/tools/lwt_bytes2.cmx \ _build/src/tools/lwt_extra2.cmx \ - _build/src/tools/prelude.cmx \ _build/src/range_query_args.cmx \ _build/src/tools/deser.cmx \ _build/src/tools/cache.cmx \ diff --git a/jenkins/run2.sh b/jenkins/run2.sh index 852f4f66..13cdb3b4 100755 --- a/jenkins/run2.sh +++ b/jenkins/run2.sh @@ -9,6 +9,8 @@ export DRIVER=./setup/setup.native export ARAKOON_BIN=$(which arakoon) +echo "ensure that all files open! Prelude" +find ocaml/src -name '*.ml' | while read f; do grep -q 'open! Prelude' $f || [ $f == "ocaml/src/tools/prelude.ml" ] || { echo $f && exit 1; }; done if [ -t 1 ] || [[ ${1-bash} == "test_integrate_"* ]] then true; diff --git a/ocaml/src/alba.ml b/ocaml/src/alba.ml index 871c5f1e..40a677bc 100644 --- a/ocaml/src/alba.ml +++ b/ocaml/src/alba.ml @@ -18,7 +18,7 @@ but WITHOUT ANY WARRANTY of any kind. open Cmdliner open Lwt.Infix -open Prelude +open! Prelude open Cli_common let () = diff --git a/ocaml/src/alba_arakoon.ml b/ocaml/src/alba_arakoon.ml index 1233931b..bba722e0 100644 --- a/ocaml/src/alba_arakoon.ml +++ b/ocaml/src/alba_arakoon.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Arakoon_client_config module Config = diff --git a/ocaml/src/alba_arakoon_deser.ml b/ocaml/src/alba_arakoon_deser.ml index f0d48441..2ed78d62 100644 --- a/ocaml/src/alba_arakoon_deser.ml +++ b/ocaml/src/alba_arakoon_deser.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Alba_arakoon module Config = diff --git a/ocaml/src/alba_base_client.ml b/ocaml/src/alba_base_client.ml index f53017bc..d360e9bb 100644 --- a/ocaml/src/alba_base_client.ml +++ b/ocaml/src/alba_base_client.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Checksum open Lwt_bytes2 diff --git a/ocaml/src/alba_based_osd.ml b/ocaml/src/alba_based_osd.ml index 869ffe05..5a879f77 100644 --- a/ocaml/src/alba_based_osd.ml +++ b/ocaml/src/alba_based_osd.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude let to_namespace_name prefix = function | 0 -> fun namespace_id -> diff --git a/ocaml/src/alba_bench.ml b/ocaml/src/alba_bench.ml index 247256f5..af6a7074 100644 --- a/ocaml/src/alba_bench.ml +++ b/ocaml/src/alba_bench.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Generic_bench diff --git a/ocaml/src/alba_client.ml b/ocaml/src/alba_client.ml index d992ad9f..6ef228df 100644 --- a/ocaml/src/alba_client.ml +++ b/ocaml/src/alba_client.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Fragment_cache open Alba_statistics open Alba_client_errors diff --git a/ocaml/src/alba_client2.ml b/ocaml/src/alba_client2.ml index 3b10f5b7..1d3df4c3 100644 --- a/ocaml/src/alba_client2.ml +++ b/ocaml/src/alba_client2.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + let make_client albamgr_client_cfg ?fragment_cache ?manifest_cache_size diff --git a/ocaml/src/alba_client_common.ml b/ocaml/src/alba_client_common.ml index e820015b..e7adff01 100644 --- a/ocaml/src/alba_client_common.ml +++ b/ocaml/src/alba_client_common.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Alba_client_errors let get_best_policy policies osds_info_cache = diff --git a/ocaml/src/alba_client_download.ml b/ocaml/src/alba_client_download.ml index 6fdf1c0c..c1f04be1 100644 --- a/ocaml/src/alba_client_download.ml +++ b/ocaml/src/alba_client_download.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt_bytes2 open Slice open Alba_statistics diff --git a/ocaml/src/alba_client_download_slices.ml b/ocaml/src/alba_client_download_slices.ml index e4cf1de1..879fd6fb 100644 --- a/ocaml/src/alba_client_download_slices.ml +++ b/ocaml/src/alba_client_download_slices.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Alba_interval open Alba_client_errors open Slice diff --git a/ocaml/src/alba_client_errors.ml b/ocaml/src/alba_client_errors.ml index e18be816..94fdd705 100644 --- a/ocaml/src/alba_client_errors.ml +++ b/ocaml/src/alba_client_errors.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + module Error = struct type t = | ChecksumMismatch diff --git a/ocaml/src/alba_client_message_delivery.ml b/ocaml/src/alba_client_message_delivery.ml index c36dabe3..d7a86122 100644 --- a/ocaml/src/alba_client_message_delivery.ml +++ b/ocaml/src/alba_client_message_delivery.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Checksum open Lwt.Infix diff --git a/ocaml/src/alba_client_message_delivery_base.ml b/ocaml/src/alba_client_message_delivery_base.ml index a1d2eed7..0cc5eadd 100644 --- a/ocaml/src/alba_client_message_delivery_base.ml +++ b/ocaml/src/alba_client_message_delivery_base.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix let deliver_messages : diff --git a/ocaml/src/alba_client_namespace.ml b/ocaml/src/alba_client_namespace.ml index 83c952bc..d2e31578 100644 --- a/ocaml/src/alba_client_namespace.ml +++ b/ocaml/src/alba_client_namespace.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt.Infix let create_namespace diff --git a/ocaml/src/alba_client_osd.ml b/ocaml/src/alba_client_osd.ml index c446564e..eccfd0d2 100644 --- a/ocaml/src/alba_client_osd.ml +++ b/ocaml/src/alba_client_osd.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Checksum open Lwt.Infix diff --git a/ocaml/src/alba_client_preset_cache.ml b/ocaml/src/alba_client_preset_cache.ml index 45d06183..5ee0b0ae 100644 --- a/ocaml/src/alba_client_preset_cache.ml +++ b/ocaml/src/alba_client_preset_cache.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix let _propagate_preset diff --git a/ocaml/src/alba_client_sequence.ml b/ocaml/src/alba_client_sequence.ml index a7695323..3f6872f0 100644 --- a/ocaml/src/alba_client_sequence.ml +++ b/ocaml/src/alba_client_sequence.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Checksum open Lwt.Infix diff --git a/ocaml/src/alba_client_upload.ml b/ocaml/src/alba_client_upload.ml index c13b7148..58c929b1 100644 --- a/ocaml/src/alba_client_upload.ml +++ b/ocaml/src/alba_client_upload.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt_bytes2 open Recovery_info diff --git a/ocaml/src/alba_eviction.ml b/ocaml/src/alba_eviction.ml index 31a9f188..8a310fda 100644 --- a/ocaml/src/alba_eviction.ml +++ b/ocaml/src/alba_eviction.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix let do_random_eviction diff --git a/ocaml/src/alba_json.ml b/ocaml/src/alba_json.ml index 0fdd1ab0..5e9ee146 100644 --- a/ocaml/src/alba_json.ml +++ b/ocaml/src/alba_json.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Encryption open Albamgr_protocol.Protocol diff --git a/ocaml/src/alba_osd.ml b/ocaml/src/alba_osd.ml index 1faf9f9f..2639a72a 100644 --- a/ocaml/src/alba_osd.ml +++ b/ocaml/src/alba_osd.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Alba_based_osd open Lwt.Infix diff --git a/ocaml/src/alba_osd_test.ml b/ocaml/src/alba_osd_test.ml index b471d463..01f10e7f 100644 --- a/ocaml/src/alba_osd_test.ml +++ b/ocaml/src/alba_osd_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix let test_with_kvs_client diff --git a/ocaml/src/alba_statistics.ml b/ocaml/src/alba_statistics.ml index 16e2a0d0..9bcc9ed3 100644 --- a/ocaml/src/alba_statistics.ml +++ b/ocaml/src/alba_statistics.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + module Statistics = struct let section = Lwt_log.Section.make "statistics" diff --git a/ocaml/src/alba_test.ml b/ocaml/src/alba_test.ml index dc39eaab..340d0894 100644 --- a/ocaml/src/alba_test.ml +++ b/ocaml/src/alba_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Encryption open Lwt.Infix diff --git a/ocaml/src/albamgr_access.ml b/ocaml/src/albamgr_access.ml index 24bbfbac..e4c79f84 100644 --- a/ocaml/src/albamgr_access.ml +++ b/ocaml/src/albamgr_access.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Remotes class basic_mgr_pooled (albamgr_pool : Pool.Albamgr.t) = diff --git a/ocaml/src/albamgr_client.ml b/ocaml/src/albamgr_client.ml index dd8fa3cc..eb217b7d 100644 --- a/ocaml/src/albamgr_client.ml +++ b/ocaml/src/albamgr_client.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Albamgr_protocol open Protocol diff --git a/ocaml/src/albamgr_plugin.ml b/ocaml/src/albamgr_plugin.ml index c44aae85..d3520d61 100644 --- a/ocaml/src/albamgr_plugin.ml +++ b/ocaml/src/albamgr_plugin.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Registry open Lwt.Infix open Albamgr_protocol diff --git a/ocaml/src/albamgr_protocol.ml b/ocaml/src/albamgr_protocol.ml index a5ada05c..7840eabb 100644 --- a/ocaml/src/albamgr_protocol.ml +++ b/ocaml/src/albamgr_protocol.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Statistics_collection module Protocol = struct diff --git a/ocaml/src/albamgr_protocol_test.ml b/ocaml/src/albamgr_protocol_test.ml index 84d60f8b..aef30065 100644 --- a/ocaml/src/albamgr_protocol_test.ml +++ b/ocaml/src/albamgr_protocol_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Albamgr_protocol let make_info () = diff --git a/ocaml/src/albamgr_test.ml b/ocaml/src/albamgr_test.ml index fe390457..b8d8efc1 100644 --- a/ocaml/src/albamgr_test.ml +++ b/ocaml/src/albamgr_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Albamgr_protocol.Protocol diff --git a/ocaml/src/arith64.ml b/ocaml/src/arith64.ml index 31b61a31..84a1bbba 100644 --- a/ocaml/src/arith64.ml +++ b/ocaml/src/arith64.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + type operation = | PLUS_EQ diff --git a/ocaml/src/asd_bench.ml b/ocaml/src/asd_bench.ml index 3beace4c..18ec02fd 100644 --- a/ocaml/src/asd_bench.ml +++ b/ocaml/src/asd_bench.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt_bytes2 open Lwt.Infix open Cmdliner diff --git a/ocaml/src/asd_client.ml b/ocaml/src/asd_client.ml index 8523f183..7568bb69 100644 --- a/ocaml/src/asd_client.ml +++ b/ocaml/src/asd_client.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Slice open Lwt_bytes2 diff --git a/ocaml/src/asd_config.ml b/ocaml/src/asd_config.ml index f3b8a8c0..4b82c577 100644 --- a/ocaml/src/asd_config.ml +++ b/ocaml/src/asd_config.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + module Config = struct type tls = { cert: string; diff --git a/ocaml/src/asd_io_scheduler.ml b/ocaml/src/asd_io_scheduler.ml index 66e06395..422ee690 100644 --- a/ocaml/src/asd_io_scheduler.ml +++ b/ocaml/src/asd_io_scheduler.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt_buffer open Lwt.Infix diff --git a/ocaml/src/asd_protocol.ml b/ocaml/src/asd_protocol.ml index 10307714..82548305 100644 --- a/ocaml/src/asd_protocol.ml +++ b/ocaml/src/asd_protocol.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Checksum open Asd_statistics diff --git a/ocaml/src/asd_protocol_test.ml b/ocaml/src/asd_protocol_test.ml index 816d1d2e..5afcdd15 100644 --- a/ocaml/src/asd_protocol_test.ml +++ b/ocaml/src/asd_protocol_test.ml @@ -16,8 +16,10 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Asd_protocol open Protocol + let roundtrip test_ctx = let k = "the_key" in let v = "the_value" in diff --git a/ocaml/src/asd_server.ml b/ocaml/src/asd_server.ml index 17745bf4..8f67586a 100644 --- a/ocaml/src/asd_server.ml +++ b/ocaml/src/asd_server.ml @@ -17,7 +17,7 @@ but WITHOUT ANY WARRANTY of any kind. *) open Lwt.Infix -open Prelude +open! Prelude open Rocks_store open Asd_protocol open Slice diff --git a/ocaml/src/asd_statistics.ml b/ocaml/src/asd_statistics.ml index 4f363d01..943139ce 100644 --- a/ocaml/src/asd_statistics.ml +++ b/ocaml/src/asd_statistics.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + module AsdStatistics = struct module G = Statistics_collection.Generic type t = G.t diff --git a/ocaml/src/asd_test.ml b/ocaml/src/asd_test.ml index 8566105b..c3f99bb1 100644 --- a/ocaml/src/asd_test.ml +++ b/ocaml/src/asd_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Osd open Lwt.Infix open Slice diff --git a/ocaml/src/automatic_repair.ml b/ocaml/src/automatic_repair.ml index cf0cf581..9cc1e46c 100644 --- a/ocaml/src/automatic_repair.ml +++ b/ocaml/src/automatic_repair.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt.Infix diff --git a/ocaml/src/capabilities.ml b/ocaml/src/capabilities.ml index ce595394..59f7f52e 100644 --- a/ocaml/src/capabilities.ml +++ b/ocaml/src/capabilities.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module OsdCapabilities = struct type capability = diff --git a/ocaml/src/choose.ml b/ocaml/src/choose.ml index 4beaefe8..7e14b6f3 100644 --- a/ocaml/src/choose.ml +++ b/ocaml/src/choose.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + exception EmptyChoose module Inner = struct diff --git a/ocaml/src/choose_test.ml b/ocaml/src/choose_test.ml index 9b9b8f17..96d35dd5 100644 --- a/ocaml/src/choose_test.ml +++ b/ocaml/src/choose_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Albamgr_protocol.Protocol type r_t = int * ((Osd.id * Nsm_model.OsdInfo.t ) list) diff --git a/ocaml/src/cli_asd.ml b/ocaml/src/cli_asd.ml index 19589c09..9f87eaea 100644 --- a/ocaml/src/cli_asd.ml +++ b/ocaml/src/cli_asd.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Cmdliner open Lwt.Infix open Cli_common diff --git a/ocaml/src/cli_bench.ml b/ocaml/src/cli_bench.ml index 7a8345fd..1f74ca26 100644 --- a/ocaml/src/cli_bench.ml +++ b/ocaml/src/cli_bench.ml @@ -19,7 +19,7 @@ but WITHOUT ANY WARRANTY of any kind. open Cmdliner open Cli_common open Cli_bench_common -open Prelude +open! Prelude let slice_size default = diff --git a/ocaml/src/cli_bench_common.ml b/ocaml/src/cli_bench_common.ml index 16a6451b..fa8fed76 100644 --- a/ocaml/src/cli_bench_common.ml +++ b/ocaml/src/cli_bench_common.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Cmdliner diff --git a/ocaml/src/cli_common.ml b/ocaml/src/cli_common.ml index 59c8cfdd..6089d76a 100644 --- a/ocaml/src/cli_common.ml +++ b/ocaml/src/cli_common.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Cmdliner open Lwt.Infix @@ -202,7 +202,6 @@ let lwt_server ~log_sinks ~subcomponent t : unit = end let url_converter :Prelude.Url.t Arg.converter = - let open Prelude in let url_parser s = try `Ok (Url.make s) diff --git a/ocaml/src/cli_maintenance.ml b/ocaml/src/cli_maintenance.ml index 625acb30..62ebad60 100644 --- a/ocaml/src/cli_maintenance.ml +++ b/ocaml/src/cli_maintenance.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Cmdliner open Lwt.Infix open Cli_common @@ -43,7 +43,6 @@ module Config = struct } [@@deriving yojson, show] let abm_cfg_url_from_cfg (t:t) : Prelude.Url.t = - let open Prelude in match t.albamgr_cfg_file, t.albamgr_cfg_url with | None, Some url_s -> Url.make url_s | Some file, None -> Url.File file diff --git a/ocaml/src/cli_messages.ml b/ocaml/src/cli_messages.ml index cdc0f4d0..bbbabc91 100644 --- a/ocaml/src/cli_messages.ml +++ b/ocaml/src/cli_messages.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Cli_common open Lwt.Infix open Cmdliner diff --git a/ocaml/src/cli_mgr.ml b/ocaml/src/cli_mgr.ml index b8e7132e..7b07958b 100644 --- a/ocaml/src/cli_mgr.ml +++ b/ocaml/src/cli_mgr.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Cli_common open Cmdliner diff --git a/ocaml/src/cli_nsm_host.ml b/ocaml/src/cli_nsm_host.ml index 2f9c08f8..56be8659 100644 --- a/ocaml/src/cli_nsm_host.ml +++ b/ocaml/src/cli_nsm_host.ml @@ -19,7 +19,7 @@ but WITHOUT ANY WARRANTY of any kind. open Cli_common open Cmdliner open Lwt.Infix -open Prelude +open! Prelude let nsm_host_statistics (cfg_url:Url.t) tls_config clear nsm_host verbose = let t () = diff --git a/ocaml/src/cli_osd.ml b/ocaml/src/cli_osd.ml index d37407a6..6809e431 100644 --- a/ocaml/src/cli_osd.ml +++ b/ocaml/src/cli_osd.ml @@ -18,7 +18,7 @@ but WITHOUT ANY WARRANTY of any kind. open Cmdliner open Lwt.Infix -open Prelude +open! Prelude open Slice open Cli_common diff --git a/ocaml/src/cli_preset.ml b/ocaml/src/cli_preset.ml index a7200bbc..8bf0cba6 100644 --- a/ocaml/src/cli_preset.ml +++ b/ocaml/src/cli_preset.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Cmdliner open Cli_common diff --git a/ocaml/src/cli_proxy.ml b/ocaml/src/cli_proxy.ml index 7e47e012..990cd2f4 100644 --- a/ocaml/src/cli_proxy.ml +++ b/ocaml/src/cli_proxy.ml @@ -19,7 +19,7 @@ but WITHOUT ANY WARRANTY of any kind. open Lwt.Infix open Cmdliner open Cli_common -open Prelude +open! Prelude module Config = struct type t = { diff --git a/ocaml/src/discovery.ml b/ocaml/src/discovery.ml index 8ab9af3e..1d0d7713 100644 --- a/ocaml/src/discovery.ml +++ b/ocaml/src/discovery.ml @@ -17,7 +17,7 @@ but WITHOUT ANY WARRANTY of any kind. *) open Ctypes -open Prelude +open! Prelude let _setsockopt = (* diff --git a/ocaml/src/disk_failure_tests.ml b/ocaml/src/disk_failure_tests.ml index 051e16f3..03295095 100644 --- a/ocaml/src/disk_failure_tests.ml +++ b/ocaml/src/disk_failure_tests.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Nsm_model open Lwt.Infix open OUnit diff --git a/ocaml/src/disk_safety.ml b/ocaml/src/disk_safety.ml index ad4c3d45..8412eae0 100644 --- a/ocaml/src/disk_safety.ml +++ b/ocaml/src/disk_safety.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix type bucket_safety = { diff --git a/ocaml/src/disk_safety_test.ml b/ocaml/src/disk_safety_test.ml index bfb6ae73..ef3675f7 100644 --- a/ocaml/src/disk_safety_test.ml +++ b/ocaml/src/disk_safety_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix let test_safety () = diff --git a/ocaml/src/encrypt_info_helper.ml b/ocaml/src/encrypt_info_helper.ml index 01b60dbc..563dad79 100644 --- a/ocaml/src/encrypt_info_helper.ml +++ b/ocaml/src/encrypt_info_helper.ml @@ -19,7 +19,7 @@ but WITHOUT ANY WARRANTY of any kind. (* This module exists so no ctypes stuff is used * inside the arakoon plugins. *) -open Prelude +open! Prelude let get_id_for_key key = let id = diff --git a/ocaml/src/erasure.ml b/ocaml/src/erasure.ml index 39e1c1d0..697a93b0 100644 --- a/ocaml/src/erasure.ml +++ b/ocaml/src/erasure.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Ctypes open Lwt.Infix diff --git a/ocaml/src/erasure_test.ml b/ocaml/src/erasure_test.ml index 13c15a06..f519b86d 100644 --- a/ocaml/src/erasure_test.ml +++ b/ocaml/src/erasure_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Ctypes_helper open Lwt_bytes2 diff --git a/ocaml/src/experiments/discovery_demo.ml b/ocaml/src/experiments/discovery_demo.ml index e4b36a33..ca38740a 100644 --- a/ocaml/src/experiments/discovery_demo.ml +++ b/ocaml/src/experiments/discovery_demo.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + let () = let open Discovery in let seen = function diff --git a/ocaml/src/fragment_cache.ml b/ocaml/src/fragment_cache.ml index 4ea57e98..9d5cc975 100644 --- a/ocaml/src/fragment_cache.ml +++ b/ocaml/src/fragment_cache.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Lwt_bytes2 diff --git a/ocaml/src/fragment_cache_alba.ml b/ocaml/src/fragment_cache_alba.ml index a777ffc0..c8f4ae33 100644 --- a/ocaml/src/fragment_cache_alba.ml +++ b/ocaml/src/fragment_cache_alba.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix type alba_fragment_cache_bucket_strategy = diff --git a/ocaml/src/fragment_cache_config.ml b/ocaml/src/fragment_cache_config.ml index 5a0aba64..76edc257 100644 --- a/ocaml/src/fragment_cache_config.ml +++ b/ocaml/src/fragment_cache_config.ml @@ -17,7 +17,7 @@ but WITHOUT ANY WARRANTY of any kind. *) open Lwt.Infix -open Prelude +open! Prelude let default_rocksdb_max_open_files = 256 let default_connection_pool_size = 10 diff --git a/ocaml/src/fragment_cache_config_test.ml b/ocaml/src/fragment_cache_config_test.ml index fa24cf5d..55a011c7 100644 --- a/ocaml/src/fragment_cache_config_test.ml +++ b/ocaml/src/fragment_cache_config_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt.Infix open Fragment_cache_config diff --git a/ocaml/src/fragment_cache_fs.ml b/ocaml/src/fragment_cache_fs.ml index 50e220e3..42dcd8aa 100644 --- a/ocaml/src/fragment_cache_fs.ml +++ b/ocaml/src/fragment_cache_fs.ml @@ -15,7 +15,7 @@ in the file of the Open vStorage OSE distribution. Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Unix open Lwt.Infix open Rocks_store diff --git a/ocaml/src/fragment_cache_keys.ml b/ocaml/src/fragment_cache_keys.ml index 28a09123..18963b0f 100644 --- a/ocaml/src/fragment_cache_keys.ml +++ b/ocaml/src/fragment_cache_keys.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude let make_key ~object_id ~chunk_id ~fragment_id = serialize diff --git a/ocaml/src/fragment_cache_test.ml b/ocaml/src/fragment_cache_test.ml index 47076b4e..d9d1e306 100644 --- a/ocaml/src/fragment_cache_test.ml +++ b/ocaml/src/fragment_cache_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Fragment_cache open Lwt.Infix open Lwt_bytes2 @@ -381,7 +381,6 @@ let test_x_cache () = (fun c -> let () = c # set_delay_after_add (Some 0.5) in let () = c # set_delay_after_lookup (Some 0.5) in - let open Prelude in let x = new Fragment_cache.x_cache (c:> cache) in let n = 20 in let item_range = Int.range 1 (n+1) in diff --git a/ocaml/src/fragment_helper.ml b/ocaml/src/fragment_helper.ml index fea42d7f..79af1905 100644 --- a/ocaml/src/fragment_helper.ml +++ b/ocaml/src/fragment_helper.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt_bytes2 open Nsm_model diff --git a/ocaml/src/fragment_helper_test.ml b/ocaml/src/fragment_helper_test.ml index d284cf90..44db9a48 100644 --- a/ocaml/src/fragment_helper_test.ml +++ b/ocaml/src/fragment_helper_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Fragment_helper open Lwt_bytes2 open Lwt.Infix diff --git a/ocaml/src/fragment_size_helper_test.ml b/ocaml/src/fragment_size_helper_test.ml index a76dec51..91ac9c3e 100644 --- a/ocaml/src/fragment_size_helper_test.ml +++ b/ocaml/src/fragment_size_helper_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Fragment_size_helper let test_determine_chunk_size () = diff --git a/ocaml/src/fsutil_demo.ml b/ocaml/src/fsutil_demo.ml index 0f83060a..c7bfda88 100644 --- a/ocaml/src/fsutil_demo.ml +++ b/ocaml/src/fsutil_demo.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Ctypes open Static diff --git a/ocaml/src/generic_bench.ml b/ocaml/src/generic_bench.ml index 42bbb381..6667d972 100644 --- a/ocaml/src/generic_bench.ml +++ b/ocaml/src/generic_bench.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt.Infix let report oc name (n, d,speed, latency, min_d, max_d) = diff --git a/ocaml/src/isa_l.ml b/ocaml/src/isa_l.ml index 8e166674..c028abe8 100644 --- a/ocaml/src/isa_l.ml +++ b/ocaml/src/isa_l.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Ctypes open Foreign open Ctypes_helper diff --git a/ocaml/src/jerasure.ml b/ocaml/src/jerasure.ml index 4bf9508a..d1c0b59b 100644 --- a/ocaml/src/jerasure.ml +++ b/ocaml/src/jerasure.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Ctypes open Foreign diff --git a/ocaml/src/key_value_store.ml b/ocaml/src/key_value_store.ml index 0080861b..c0a25659 100644 --- a/ocaml/src/key_value_store.ml +++ b/ocaml/src/key_value_store.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module type S = sig type t diff --git a/ocaml/src/kinetic_client.ml b/ocaml/src/kinetic_client.ml index 4cb9154d..23faf76e 100644 --- a/ocaml/src/kinetic_client.ml +++ b/ocaml/src/kinetic_client.ml @@ -19,7 +19,7 @@ but WITHOUT ANY WARRANTY of any kind. open Osd open Lwt open Kinetic -open Prelude +open! Prelude open Slice let slice2s x_s = Slice.get_string_unsafe x_s diff --git a/ocaml/src/kinetic_client_test.ml b/ocaml/src/kinetic_client_test.ml index cb21d38a..669058c1 100644 --- a/ocaml/src/kinetic_client_test.ml +++ b/ocaml/src/kinetic_client_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Slice open Kinetic_client diff --git a/ocaml/src/log_plugin.ml b/ocaml/src/log_plugin.ml index f579d9a2..2c3e7e73 100644 --- a/ocaml/src/log_plugin.ml +++ b/ocaml/src/log_plugin.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude let user_function (user_db : Registry.user_db) (value_o : string option) diff --git a/ocaml/src/maintenance.ml b/ocaml/src/maintenance.ml index a7da0ae8..9f8f1f46 100644 --- a/ocaml/src/maintenance.ml +++ b/ocaml/src/maintenance.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Recovery_info open Lwt.Infix diff --git a/ocaml/src/maintenance_common.ml b/ocaml/src/maintenance_common.ml index eda10e12..af259729 100644 --- a/ocaml/src/maintenance_common.ml +++ b/ocaml/src/maintenance_common.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt.Infix let maintenance_for_all_x diff --git a/ocaml/src/maintenance_config.ml b/ocaml/src/maintenance_config.ml index a193c8ae..afdeffe0 100644 --- a/ocaml/src/maintenance_config.ml +++ b/ocaml/src/maintenance_config.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude type redis_lru_cache_eviction = { host : string; diff --git a/ocaml/src/maintenance_coordination.ml b/ocaml/src/maintenance_coordination.ml index d1b252ae..f9fae3ab 100644 --- a/ocaml/src/maintenance_coordination.ml +++ b/ocaml/src/maintenance_coordination.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix type state = diff --git a/ocaml/src/maintenance_coordination_test.ml b/ocaml/src/maintenance_coordination_test.ml index 3eaeae99..1545b2ef 100644 --- a/ocaml/src/maintenance_coordination_test.ml +++ b/ocaml/src/maintenance_coordination_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Maintenance_coordination open Lwt.Infix diff --git a/ocaml/src/maintenance_helper.ml b/ocaml/src/maintenance_helper.ml index 43c0e909..c3de72bb 100644 --- a/ocaml/src/maintenance_helper.ml +++ b/ocaml/src/maintenance_helper.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Nsm_model open Recovery_info open Lwt.Infix diff --git a/ocaml/src/maintenance_test.ml b/ocaml/src/maintenance_test.ml index d082fa22..3b82fd04 100644 --- a/ocaml/src/maintenance_test.ml +++ b/ocaml/src/maintenance_test.ml @@ -17,7 +17,7 @@ but WITHOUT ANY WARRANTY of any kind. *) open Lwt.Infix -open Prelude +open! Prelude let test_with_alba_client = Alba_test.test_with_alba_client let with_maintenance_client = Alba_test.with_maintenance_client diff --git a/ocaml/src/manifest_cache.ml b/ocaml/src/manifest_cache.ml index 5540f5ce..7c64092b 100644 --- a/ocaml/src/manifest_cache.ml +++ b/ocaml/src/manifest_cache.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Cache diff --git a/ocaml/src/manifest_deser.ml b/ocaml/src/manifest_deser.ml index a2c6b3ae..50497b58 100644 --- a/ocaml/src/manifest_deser.ml +++ b/ocaml/src/manifest_deser.ml @@ -1,3 +1,22 @@ +(* +Copyright (C) 2017 iNuron NV + +This file is part of Open vStorage Open Source Edition (OSE), as available from + + + http://www.openvstorage.org and + http://www.openvstorage.com. + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU Affero General Public License v3 (GNU AGPLv3) +as published by the Free Software Foundation, in version 3 as it comes +in the file of the Open vStorage OSE distribution. + +Open vStorage is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY of any kind. +*) + +open! Prelude open Nsm_model let deser ~ser_version = diff --git a/ocaml/src/mem_key_value_store.ml b/ocaml/src/mem_key_value_store.ml index 0e51d18b..0e4763bf 100644 --- a/ocaml/src/mem_key_value_store.ml +++ b/ocaml/src/mem_key_value_store.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Key_value_store module Mem_key_value_store_ = struct diff --git a/ocaml/src/mem_stats.ml b/ocaml/src/mem_stats.ml index 494bbdde..910b7135 100644 --- a/ocaml/src/mem_stats.ml +++ b/ocaml/src/mem_stats.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt.Infix let reporting_t ~section ?(f=Lwt.return) () = diff --git a/ocaml/src/model/alba_compression.ml b/ocaml/src/model/alba_compression.ml index 4cfa920b..47bf2a3d 100644 --- a/ocaml/src/model/alba_compression.ml +++ b/ocaml/src/model/alba_compression.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module Compression = struct type t = diff --git a/ocaml/src/model/checksum.ml b/ocaml/src/model/checksum.ml index ca25355b..d785a9a7 100644 --- a/ocaml/src/model/checksum.ml +++ b/ocaml/src/model/checksum.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module Checksum = struct module Algo = struct diff --git a/ocaml/src/model/checksum_deser.ml b/ocaml/src/model/checksum_deser.ml index b949f472..2323283f 100644 --- a/ocaml/src/model/checksum_deser.ml +++ b/ocaml/src/model/checksum_deser.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Checksum.Checksum let to_buffer' buf = diff --git a/ocaml/src/model/consistency.ml b/ocaml/src/model/consistency.ml index e94111e1..7da84954 100644 --- a/ocaml/src/model/consistency.ml +++ b/ocaml/src/model/consistency.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Arakoon_client type t = consistency = diff --git a/ocaml/src/model/encryption.ml b/ocaml/src/model/encryption.ml index fd94468e..c05ed5be 100644 --- a/ocaml/src/model/encryption.ml +++ b/ocaml/src/model/encryption.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module Encryption = struct diff --git a/ocaml/src/model/encryption_test.ml b/ocaml/src/model/encryption_test.ml index 7be75e80..db91f635 100644 --- a/ocaml/src/model/encryption_test.ml +++ b/ocaml/src/model/encryption_test.ml @@ -15,6 +15,8 @@ in the file of the Open vStorage OSE distribution. Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) + +open! Prelude open OUnit open Encryption diff --git a/ocaml/src/model/fragment.ml b/ocaml/src/model/fragment.ml index be60f7a7..82457e79 100644 --- a/ocaml/src/model/fragment.ml +++ b/ocaml/src/model/fragment.ml @@ -36,7 +36,7 @@ module Fnr = struct Prelude.maybe_from_buffer from_buffer None buf end -open Prelude +open! Prelude module Fragment = struct diff --git a/ocaml/src/model/fragment_size_helper.ml b/ocaml/src/model/fragment_size_helper.ml index 5bf86b1b..b3a1ddf6 100644 --- a/ocaml/src/model/fragment_size_helper.ml +++ b/ocaml/src/model/fragment_size_helper.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + (* this should be at least sizeof(long) according to the jerasure documentation *) let fragment_multiple = 16 diff --git a/ocaml/src/model/fragment_update.ml b/ocaml/src/model/fragment_update.ml index 84f53a3a..48624e23 100644 --- a/ocaml/src/model/fragment_update.ml +++ b/ocaml/src/model/fragment_update.ml @@ -19,7 +19,7 @@ but WITHOUT ANY WARRANTY of any kind. open Fragment open Preset open Checksum -open Prelude +open! Prelude module FragmentUpdate = struct diff --git a/ocaml/src/model/layout.ml b/ocaml/src/model/layout.ml index 4e82582f..5ff8e72a 100644 --- a/ocaml/src/model/layout.ml +++ b/ocaml/src/model/layout.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module Layout = struct type 'a t = 'a list list [@@deriving show, yojson] diff --git a/ocaml/src/model/policy.ml b/ocaml/src/model/policy.ml index 82503167..e7dce718 100644 --- a/ocaml/src/model/policy.ml +++ b/ocaml/src/model/policy.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude type k = int [@@deriving show, yojson] type m = int [@@deriving show, yojson] diff --git a/ocaml/src/model/policy_test.ml b/ocaml/src/model/policy_test.ml index 985e8acd..098347b6 100644 --- a/ocaml/src/model/policy_test.ml +++ b/ocaml/src/model/policy_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Policy let test_required_osds_per_node () = diff --git a/ocaml/src/model/preset.ml b/ocaml/src/model/preset.ml index e226d953..be42347d 100644 --- a/ocaml/src/model/preset.ml +++ b/ocaml/src/model/preset.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude type k = Policy.k [@@deriving show, yojson] type m = Policy.m [@@deriving show, yojson] diff --git a/ocaml/src/nsm_client.ml b/ocaml/src/nsm_client.ml index f91ace44..dbcecb21 100644 --- a/ocaml/src/nsm_client.ml +++ b/ocaml/src/nsm_client.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Nsm_protocol open Protocol open Lwt.Infix diff --git a/ocaml/src/nsm_host_access.ml b/ocaml/src/nsm_host_access.ml index e447234a..9010debb 100644 --- a/ocaml/src/nsm_host_access.ml +++ b/ocaml/src/nsm_host_access.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Remotes open Lwt.Infix diff --git a/ocaml/src/nsm_host_client.ml b/ocaml/src/nsm_host_client.ml index c7a98f5a..dbe1188c 100644 --- a/ocaml/src/nsm_host_client.ml +++ b/ocaml/src/nsm_host_client.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Nsm_host_protocol open Protocol diff --git a/ocaml/src/nsm_host_plugin.ml b/ocaml/src/nsm_host_plugin.ml index 3140d1eb..7d9c2f39 100644 --- a/ocaml/src/nsm_host_plugin.ml +++ b/ocaml/src/nsm_host_plugin.ml @@ -18,7 +18,7 @@ but WITHOUT ANY WARRANTY of any kind. open Lwt.Infix open Registry -open Prelude +open! Prelude module Arakoon_update = Update open Nsm_model open Plugin_extra diff --git a/ocaml/src/nsm_host_protocol.ml b/ocaml/src/nsm_host_protocol.ml index 56775ea3..2eaeceb8 100644 --- a/ocaml/src/nsm_host_protocol.ml +++ b/ocaml/src/nsm_host_protocol.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module Protocol = struct diff --git a/ocaml/src/nsm_model.ml b/ocaml/src/nsm_model.ml index 622ca104..7cc7de00 100644 --- a/ocaml/src/nsm_model.ml +++ b/ocaml/src/nsm_model.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Key_value_store type object_name = string [@@deriving show] diff --git a/ocaml/src/nsm_model_test.ml b/ocaml/src/nsm_model_test.ml index 60dc5f4f..bcb9c788 100644 --- a/ocaml/src/nsm_model_test.ml +++ b/ocaml/src/nsm_model_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Nsm_model open Key_value_store open Mem_key_value_store diff --git a/ocaml/src/nsm_protocol.ml b/ocaml/src/nsm_protocol.ml index ad0f7cd7..7cde61cc 100644 --- a/ocaml/src/nsm_protocol.ml +++ b/ocaml/src/nsm_protocol.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Nsm_model module Session = struct diff --git a/ocaml/src/nsm_protocol_test.ml b/ocaml/src/nsm_protocol_test.ml index a8cb3fff..ccb089f7 100644 --- a/ocaml/src/nsm_protocol_test.ml +++ b/ocaml/src/nsm_protocol_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt.Infix open OUnit diff --git a/ocaml/src/osd.ml b/ocaml/src/osd.ml index 9af0098a..9b533227 100644 --- a/ocaml/src/osd.ml +++ b/ocaml/src/osd.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice type key = Asd_protocol.key [@@deriving show] diff --git a/ocaml/src/osd_access.ml b/ocaml/src/osd_access.ml index be56b42e..c029cfab 100644 --- a/ocaml/src/osd_access.ml +++ b/ocaml/src/osd_access.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt.Infix open Nsm_model diff --git a/ocaml/src/osd_access_type.ml b/ocaml/src/osd_access_type.ml index 1aac693e..58dbc03d 100644 --- a/ocaml/src/osd_access_type.ml +++ b/ocaml/src/osd_access_type.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude let large_value = lazy (String.make (512*1024) 'a') diff --git a/ocaml/src/osd_bench.ml b/ocaml/src/osd_bench.ml index 27b4855b..7805cda4 100644 --- a/ocaml/src/osd_bench.ml +++ b/ocaml/src/osd_bench.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Asd_protocol open Lwt.Infix open Generic_bench diff --git a/ocaml/src/osd_deser.ml b/ocaml/src/osd_deser.ml index c370f4a1..73378dcf 100644 --- a/ocaml/src/osd_deser.ml +++ b/ocaml/src/osd_deser.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module OsdInfo = struct diff --git a/ocaml/src/osd_keys.ml b/ocaml/src/osd_keys.ml index 0c5f9eb7..2f262217 100644 --- a/ocaml/src/osd_keys.ml +++ b/ocaml/src/osd_keys.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude let test_key = "test" let bench_prefix = "@" diff --git a/ocaml/src/osd_kvs_test.ml b/ocaml/src/osd_kvs_test.ml index bb758f4b..233e2c0b 100644 --- a/ocaml/src/osd_kvs_test.ml +++ b/ocaml/src/osd_kvs_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Osd open Lwt_bytes2 diff --git a/ocaml/src/osd_state.ml b/ocaml/src/osd_state.ml index a4d63031..6333bd8c 100644 --- a/ocaml/src/osd_state.ml +++ b/ocaml/src/osd_state.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude type t = { mutable disqualified : bool; diff --git a/ocaml/src/other/posix.ml b/ocaml/src/other/posix.ml index a88ba6e7..f4cc467f 100644 --- a/ocaml/src/other/posix.ml +++ b/ocaml/src/other/posix.ml @@ -17,6 +17,8 @@ * along with Baardskeerder. If not, see . *) +open! Prelude + (* we (OVS) only took what we needed and adapted the signatures a bit *) (* posix_fadvise *) diff --git a/ocaml/src/other/posix_test.ml b/ocaml/src/other/posix_test.ml index 7f49bff2..6df6220b 100644 --- a/ocaml/src/other/posix_test.ml +++ b/ocaml/src/other/posix_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open OUnit open Lwt.Infix diff --git a/ocaml/src/plugin_extra.ml b/ocaml/src/plugin_extra.ml index ea79eae0..93b94584 100644 --- a/ocaml/src/plugin_extra.ml +++ b/ocaml/src/plugin_extra.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Registry module type ReadUserDb = sig diff --git a/ocaml/src/proxy_bench.ml b/ocaml/src/proxy_bench.ml index 105b3ae1..9c2d9003 100644 --- a/ocaml/src/proxy_bench.ml +++ b/ocaml/src/proxy_bench.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Generic_bench diff --git a/ocaml/src/proxy_client.ml b/ocaml/src/proxy_client.ml index 246da222..d0617422 100644 --- a/ocaml/src/proxy_client.ml +++ b/ocaml/src/proxy_client.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix open Proxy_protocol open Protocol diff --git a/ocaml/src/proxy_osd.ml b/ocaml/src/proxy_osd.ml index e2364b50..ec690a30 100644 --- a/ocaml/src/proxy_osd.ml +++ b/ocaml/src/proxy_osd.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt.Infix open Alba_based_osd diff --git a/ocaml/src/proxy_osd_test.ml b/ocaml/src/proxy_osd_test.ml index 6c7aeb2c..25791493 100644 --- a/ocaml/src/proxy_osd_test.ml +++ b/ocaml/src/proxy_osd_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Proxy_osd open Lwt.Infix diff --git a/ocaml/src/proxy_protocol.ml b/ocaml/src/proxy_protocol.ml index e3d5fbde..b6b071f8 100644 --- a/ocaml/src/proxy_protocol.ml +++ b/ocaml/src/proxy_protocol.ml @@ -20,7 +20,7 @@ but WITHOUT ANY WARRANTY of any kind. - remove std::exception from llio.cc? *) -open Prelude +open! Prelude open Stat open Range_query_args2 open Checksum diff --git a/ocaml/src/proxy_server.ml b/ocaml/src/proxy_server.ml index 00d86b52..92a3d421 100644 --- a/ocaml/src/proxy_server.ml +++ b/ocaml/src/proxy_server.ml @@ -17,7 +17,7 @@ but WITHOUT ANY WARRANTY of any kind. *) open Lwt.Infix -open Prelude +open! Prelude open Proxy_protocol open Range_query_args open Lwt_bytes2 diff --git a/ocaml/src/proxy_test.ml b/ocaml/src/proxy_test.ml index be3b17c3..e8bca314 100644 --- a/ocaml/src/proxy_test.ml +++ b/ocaml/src/proxy_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt.Infix open Proxy_protocol.Protocol diff --git a/ocaml/src/range_query_args.ml b/ocaml/src/range_query_args.ml index 82f65f84..12c4a904 100644 --- a/ocaml/src/range_query_args.ml +++ b/ocaml/src/range_query_args.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + module RangeQueryArgs = struct type 'a t = { diff --git a/ocaml/src/range_query_args2.ml b/ocaml/src/range_query_args2.ml index be18f8f8..32fc9592 100644 --- a/ocaml/src/range_query_args2.ml +++ b/ocaml/src/range_query_args2.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + module RangeQueryArgs = struct include Range_query_args.RangeQueryArgs diff --git a/ocaml/src/read_preference_test.ml b/ocaml/src/read_preference_test.ml index 8356efa2..e62ccccd 100644 --- a/ocaml/src/read_preference_test.ml +++ b/ocaml/src/read_preference_test.ml @@ -19,7 +19,7 @@ but WITHOUT ANY WARRANTY of any kind. open Lwt.Infix open Alba_test -open Prelude +open! Prelude open Nsm_model let _get_node_ids () = diff --git a/ocaml/src/rebalancing_helper.ml b/ocaml/src/rebalancing_helper.ml index dadf68a5..fc0236d5 100644 --- a/ocaml/src/rebalancing_helper.ml +++ b/ocaml/src/rebalancing_helper.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + type fill_rate = int * (int32 * float) list [@@deriving show] @@ -72,8 +74,6 @@ let categorize fill_rates = (snd fill_rates) -open Prelude - let compare_moves a b= let score (_,_,_,x) = x in (score a) - (score b) diff --git a/ocaml/src/rebalancing_helper_test.ml b/ocaml/src/rebalancing_helper_test.ml index 46aa8364..74c2b50a 100644 --- a/ocaml/src/rebalancing_helper_test.ml +++ b/ocaml/src/rebalancing_helper_test.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + let total = 1999419994112L let used = [| diff --git a/ocaml/src/recover_nsm_host.ml b/ocaml/src/recover_nsm_host.ml index 0a40c9bd..3e9b4d4a 100644 --- a/ocaml/src/recover_nsm_host.ml +++ b/ocaml/src/recover_nsm_host.ml @@ -17,7 +17,7 @@ but WITHOUT ANY WARRANTY of any kind. *) open Lwt.Infix -open Prelude +open! Prelude open Slice open Rocks_store open Lwt_buffer diff --git a/ocaml/src/recovery_info.ml b/ocaml/src/recovery_info.ml index b554e168..87c08012 100644 --- a/ocaml/src/recovery_info.ml +++ b/ocaml/src/recovery_info.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Nsm_model open Lwt_bytes2 diff --git a/ocaml/src/remotes.ml b/ocaml/src/remotes.ml index cf376c48..8ed28f35 100644 --- a/ocaml/src/remotes.ml +++ b/ocaml/src/remotes.ml @@ -17,7 +17,7 @@ but WITHOUT ANY WARRANTY of any kind. *) open Lwt.Infix -open Prelude +open! Prelude module Pool = struct module Albamgr = struct diff --git a/ocaml/src/repair.ml b/ocaml/src/repair.ml index 3567cb4d..1383d7a0 100644 --- a/ocaml/src/repair.ml +++ b/ocaml/src/repair.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt_bytes2 open Lwt.Infix diff --git a/ocaml/src/rocks_store.ml b/ocaml/src/rocks_store.ml index 2bc32161..f6a36858 100644 --- a/ocaml/src/rocks_store.ml +++ b/ocaml/src/rocks_store.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Key_value_store module Rocks_key_value_store_ = struct diff --git a/ocaml/src/sync_bench.ml b/ocaml/src/sync_bench.ml index 31392fbb..e18e5db9 100644 --- a/ocaml/src/sync_bench.ml +++ b/ocaml/src/sync_bench.ml @@ -17,7 +17,7 @@ but WITHOUT ANY WARRANTY of any kind. *) open Lwt.Infix -open Prelude +open! Prelude open Asd_server open Stat let post_write_nothing _ _ _ = Lwt.return_unit diff --git a/ocaml/src/test.ml b/ocaml/src/test.ml index d7df8c09..f7abcd9a 100644 --- a/ocaml/src/test.ml +++ b/ocaml/src/test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open OUnit let suite = "all" >:::[ diff --git a/ocaml/src/tools/alba_crc32c.ml b/ocaml/src/tools/alba_crc32c.ml index ca4367b4..9983b36f 100644 --- a/ocaml/src/tools/alba_crc32c.ml +++ b/ocaml/src/tools/alba_crc32c.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + external crc32c_string : int32 -> string -> int -> int -> bool -> int32 = "crc32c_string" diff --git a/ocaml/src/tools/alba_crc32c_test.ml b/ocaml/src/tools/alba_crc32c_test.ml index 60fb1b9f..72d17a2d 100644 --- a/ocaml/src/tools/alba_crc32c_test.ml +++ b/ocaml/src/tools/alba_crc32c_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Alba_crc32c open OUnit diff --git a/ocaml/src/tools/alba_interval.ml b/ocaml/src/tools/alba_interval.ml index 6d3132e7..9c7d14cd 100644 --- a/ocaml/src/tools/alba_interval.ml +++ b/ocaml/src/tools/alba_interval.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module Interval = struct type t = { offset : Int64.t; diff --git a/ocaml/src/tools/alba_llio.ml b/ocaml/src/tools/alba_llio.ml index 897d51b9..2c24453b 100644 --- a/ocaml/src/tools/alba_llio.ml +++ b/ocaml/src/tools/alba_llio.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + include Llio let varint_to buf i = diff --git a/ocaml/src/tools/alba_partial_read.ml b/ocaml/src/tools/alba_partial_read.ml index ec1502b4..a2aca221 100644 --- a/ocaml/src/tools/alba_partial_read.ml +++ b/ocaml/src/tools/alba_partial_read.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + external _partial_read_job : string (* fn *) -> int (* n elements *) diff --git a/ocaml/src/tools/alba_wrappers.ml b/ocaml/src/tools/alba_wrappers.ml index a5f83237..ca8695e6 100644 --- a/ocaml/src/tools/alba_wrappers.ml +++ b/ocaml/src/tools/alba_wrappers.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + external alba_get_maxrss : unit -> int = "alba_get_maxrss" external alba_get_num_fds : unit -> int = "alba_get_num_fds" diff --git a/ocaml/src/tools/bigstring_slice.ml b/ocaml/src/tools/bigstring_slice.ml index 701f1200..b7a1ef07 100644 --- a/ocaml/src/tools/bigstring_slice.ml +++ b/ocaml/src/tools/bigstring_slice.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt_bytes2 type t = { diff --git a/ocaml/src/tools/buffer_pool.ml b/ocaml/src/tools/buffer_pool.ml index b8922d0c..f4c8d0c6 100644 --- a/ocaml/src/tools/buffer_pool.ml +++ b/ocaml/src/tools/buffer_pool.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + type t = Lwt_bytes.t Weak_pool.t let create ~buffer_size = diff --git a/ocaml/src/tools/buffer_pool_test.ml b/ocaml/src/tools/buffer_pool_test.ml index c49001c7..96f5b9fb 100644 --- a/ocaml/src/tools/buffer_pool_test.ml +++ b/ocaml/src/tools/buffer_pool_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Buffer_pool let test_buffer_pool () = diff --git a/ocaml/src/tools/bytes_descr.ml b/ocaml/src/tools/bytes_descr.ml index 3a2b76f4..9dad3ea6 100644 --- a/ocaml/src/tools/bytes_descr.ml +++ b/ocaml/src/tools/bytes_descr.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt_bytes2 open Ctypes diff --git a/ocaml/src/tools/cache.ml b/ocaml/src/tools/cache.ml index 204fdf5b..7d492aa4 100644 --- a/ocaml/src/tools/cache.ml +++ b/ocaml/src/tools/cache.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + type value_source = | Fast | Slow diff --git a/ocaml/src/tools/cache_test.ml b/ocaml/src/tools/cache_test.ml index 71d4f1c3..ef039a3d 100644 --- a/ocaml/src/tools/cache_test.ml +++ b/ocaml/src/tools/cache_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open OUnit open Cache diff --git a/ocaml/src/tools/compressors.ml b/ocaml/src/tools/compressors.ml index 08325a05..d22bfbec 100644 --- a/ocaml/src/tools/compressors.ml +++ b/ocaml/src/tools/compressors.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt_bytes2 open Bytes_descr diff --git a/ocaml/src/tools/compressors_test.ml b/ocaml/src/tools/compressors_test.ml index 49b27fc6..c67489c9 100644 --- a/ocaml/src/tools/compressors_test.ml +++ b/ocaml/src/tools/compressors_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Compressors let test_snappy () = diff --git a/ocaml/src/tools/ctypes_helper.ml b/ocaml/src/tools/ctypes_helper.ml index 59503a03..a049cda3 100644 --- a/ocaml/src/tools/ctypes_helper.ml +++ b/ocaml/src/tools/ctypes_helper.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Ctypes open Foreign diff --git a/ocaml/src/tools/deser.ml b/ocaml/src/tools/deser.ml index 27fbef2f..eb95f45b 100644 --- a/ocaml/src/tools/deser.ml +++ b/ocaml/src/tools/deser.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude type 'a t = 'a Llio.deserializer * 'a Llio.serializer diff --git a/ocaml/src/tools/fsutil.ml b/ocaml/src/tools/fsutil.ml index 23849106..49283f09 100644 --- a/ocaml/src/tools/fsutil.ml +++ b/ocaml/src/tools/fsutil.ml @@ -54,6 +54,7 @@ DESCRIPTION (* yes, we copied & modified & added stuff *) +open! Prelude open Ctypes open Foreign type mount_flag = ST_RDONLY | ST_NOSUID diff --git a/ocaml/src/tools/gcrypt.ml b/ocaml/src/tools/gcrypt.ml index c2aee6fa..ccf790bc 100644 --- a/ocaml/src/tools/gcrypt.ml +++ b/ocaml/src/tools/gcrypt.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt_bytes2 open Ctypes diff --git a/ocaml/src/tools/gcrypt_test.ml b/ocaml/src/tools/gcrypt_test.ml index 85c3449b..30ad018c 100644 --- a/ocaml/src/tools/gcrypt_test.ml +++ b/ocaml/src/tools/gcrypt_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Gcrypt open Lwt_bytes2 open Lwt.Infix diff --git a/ocaml/src/tools/hashes.ml b/ocaml/src/tools/hashes.ml index d99cd2cd..396fe850 100644 --- a/ocaml/src/tools/hashes.ml +++ b/ocaml/src/tools/hashes.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Checksum open Slice diff --git a/ocaml/src/tools/llio2.ml b/ocaml/src/tools/llio2.ml index f8f90479..9d2d1efd 100644 --- a/ocaml/src/tools/llio2.ml +++ b/ocaml/src/tools/llio2.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt_bytes2 module ReadBuffer = struct diff --git a/ocaml/src/tools/lwt_extra2.ml b/ocaml/src/tools/lwt_extra2.ml index a52824f9..68437941 100644 --- a/ocaml/src/tools/lwt_extra2.ml +++ b/ocaml/src/tools/lwt_extra2.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Lwt.Infix open Lwt_bytes2 diff --git a/ocaml/src/tools/lwt_pool2.ml b/ocaml/src/tools/lwt_pool2.ml index 3151fe53..f91c152b 100644 --- a/ocaml/src/tools/lwt_pool2.ml +++ b/ocaml/src/tools/lwt_pool2.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix type check_result = diff --git a/ocaml/src/tools/memcmp.ml b/ocaml/src/tools/memcmp.ml index 9e2f9334..71608aff 100644 --- a/ocaml/src/tools/memcmp.ml +++ b/ocaml/src/tools/memcmp.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Ctypes open Foreign diff --git a/ocaml/src/tools/memcmp_test.ml b/ocaml/src/tools/memcmp_test.ml index 820e7f3f..a85d3f8f 100644 --- a/ocaml/src/tools/memcmp_test.ml +++ b/ocaml/src/tools/memcmp_test.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Memcmp let test_compare () = diff --git a/ocaml/src/tools/net_fd.ml b/ocaml/src/tools/net_fd.ml index c3cf77c1..d50c3180 100644 --- a/ocaml/src/tools/net_fd.ml +++ b/ocaml/src/tools/net_fd.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt_bytes2 open Lwt.Infix diff --git a/ocaml/src/tools/networking2.ml b/ocaml/src/tools/networking2.ml index 02096cee..b5aad8fd 100644 --- a/ocaml/src/tools/networking2.ml +++ b/ocaml/src/tools/networking2.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Lwt.Infix let make_address ip port = diff --git a/ocaml/src/tools/oUnit_XML.ml b/ocaml/src/tools/oUnit_XML.ml index 8b9d9a63..5bfe3579 100644 --- a/ocaml/src/tools/oUnit_XML.ml +++ b/ocaml/src/tools/oUnit_XML.ml @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. *) +open! Prelude open OUnit type unit_result ={ diff --git a/ocaml/src/tools/object_reader.ml b/ocaml/src/tools/object_reader.ml index 84abaaa5..21d943c5 100644 --- a/ocaml/src/tools/object_reader.ml +++ b/ocaml/src/tools/object_reader.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Slice open Lwt.Infix diff --git a/ocaml/src/tools/object_reader2.ml b/ocaml/src/tools/object_reader2.ml index 4056a945..5e9cc703 100644 --- a/ocaml/src/tools/object_reader2.ml +++ b/ocaml/src/tools/object_reader2.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Object_reader open Lwt.Infix diff --git a/ocaml/src/tools/prelude_test.ml b/ocaml/src/tools/prelude_test.ml index 2094a723..5dc492bc 100644 --- a/ocaml/src/tools/prelude_test.ml +++ b/ocaml/src/tools/prelude_test.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude let test_range () = assert ([ 0; 1; 2; 3; ] = Int.range 0 4) diff --git a/ocaml/src/tools/slice.ml b/ocaml/src/tools/slice.ml index 6cd22aa1..814029df 100644 --- a/ocaml/src/tools/slice.ml +++ b/ocaml/src/tools/slice.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude module Slice = struct type t = { buf : Bytes.t; diff --git a/ocaml/src/tools/stat.ml b/ocaml/src/tools/stat.ml index 059947e4..1f1b00d9 100644 --- a/ocaml/src/tools/stat.ml +++ b/ocaml/src/tools/stat.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + module Stat = struct type stat = { n : int64; diff --git a/ocaml/src/tools/stat_deser.ml b/ocaml/src/tools/stat_deser.ml index 7a7f413d..c7a23750 100644 --- a/ocaml/src/tools/stat_deser.ml +++ b/ocaml/src/tools/stat_deser.ml @@ -21,6 +21,7 @@ but WITHOUT ANY WARRANTY of any kind. * into arakoon *) +open! Prelude open Stat.Stat let to_buffer' buf stat = diff --git a/ocaml/src/tools/statistics_collection.ml b/ocaml/src/tools/statistics_collection.ml index c9e8a070..7e43d55e 100644 --- a/ocaml/src/tools/statistics_collection.ml +++ b/ocaml/src/tools/statistics_collection.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + module Generic = struct open Stat include Stat diff --git a/ocaml/src/tools/statistics_collection_deser.ml b/ocaml/src/tools/statistics_collection_deser.ml index 9fd047d5..2fae08c6 100644 --- a/ocaml/src/tools/statistics_collection_deser.ml +++ b/ocaml/src/tools/statistics_collection_deser.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Statistics_collection.Generic let to_buffer_with_version' ~ser_version buf t= diff --git a/ocaml/src/tools/syncfs.ml b/ocaml/src/tools/syncfs.ml index 0fe7993d..9bca4a7f 100644 --- a/ocaml/src/tools/syncfs.ml +++ b/ocaml/src/tools/syncfs.ml @@ -16,6 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude open Foreign open Ctypes diff --git a/ocaml/src/tools/tcp_keepalive2.ml b/ocaml/src/tools/tcp_keepalive2.ml index 2fe2df48..bfe2979a 100644 --- a/ocaml/src/tools/tcp_keepalive2.ml +++ b/ocaml/src/tools/tcp_keepalive2.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + let default_enable_tcp_keepalive = true let default_tcp_keepalive_time = 20 let default_tcp_keepalive_intvl = 20 diff --git a/ocaml/src/tools/test_extra.ml b/ocaml/src/tools/test_extra.ml index dd76fdf1..af1f469c 100644 --- a/ocaml/src/tools/test_extra.ml +++ b/ocaml/src/tools/test_extra.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + let lwt_run t = let nfds0 = Alba_wrappers.Sys2.get_num_fds () in let rc = Lwt_main.run t in diff --git a/ocaml/src/tools/tls.ml b/ocaml/src/tools/tls.ml index d814f5ce..78efac60 100644 --- a/ocaml/src/tools/tls.ml +++ b/ocaml/src/tools/tls.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + let _PROTOCOL = Ssl.TLSv1 type t = { diff --git a/ocaml/src/tools/weak_pool.ml b/ocaml/src/tools/weak_pool.ml index 48dae304..ede0e872 100644 --- a/ocaml/src/tools/weak_pool.ml +++ b/ocaml/src/tools/weak_pool.ml @@ -16,6 +16,8 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) +open! Prelude + type 'a t = { mutable items : 'a Weak.t; make_element : unit -> 'a; } diff --git a/ocaml/src/verify.ml b/ocaml/src/verify.ml index 20d1b2f5..38630909 100644 --- a/ocaml/src/verify.ml +++ b/ocaml/src/verify.ml @@ -16,7 +16,7 @@ Open vStorage is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. *) -open Prelude +open! Prelude open Slice open Lwt_bytes2 open Lwt.Infix From a1511ebce545ef08b43175ae9d8ab4218b6dad9b Mon Sep 17 00:00:00 2001 From: Jan Doms Date: Thu, 11 May 2017 15:02:33 +0200 Subject: [PATCH 4/4] more tail recursive list functions --- ocaml/src/tools/prelude.ml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/ocaml/src/tools/prelude.ml b/ocaml/src/tools/prelude.ml index b05b9d6a..2ea52ae7 100644 --- a/ocaml/src/tools/prelude.ml +++ b/ocaml/src/tools/prelude.ml @@ -138,7 +138,11 @@ module List = struct (* include tail recursive variants *) let map f l = Core.List.map ~f l + let map2 f l1 l2 = Core.List.map2_exn ~f l1 l2 let mapi f l = Core.List.mapi ~f l + let concat = Core.List.concat + let fold_right f l init = Core.List.fold_right ~f ~init l + let merge cmp l1 l2 = Core.List.merge ~cmp l1 l2 let any = function | [] -> false @@ -313,25 +317,28 @@ module List = struct else _inner todo' (yh::acc) x yt end in - (_inner max_n [] x y) |> List.rev + (_inner max_n [] x y) |> rev + + let combine x0s x1s = + map2 + (fun x0 x1 -> x0, x1) + x0s x1s + + let split xs = + let x0s_r, x1s_r = + fold_left + (fun (x0s, x1s) (x0, x1) -> x0::x0s, x1::x1s) + ([], []) + xs + in + rev x0s_r, rev x1s_r let split3 xs = let x0s_r, x1s_r, x2s_r = - List.fold_left + fold_left (fun (x0s,x1s,x2s) (x0,x1,x2) -> (x0::x0s, x1::x1s, x2::x2s)) ([], [], []) xs - in List.rev x0s_r, List.rev x1s_r, List.rev x2s_r - - let rev_map2 f l1 l2 = - let rec inner acc = function - | [], [] -> acc - | e1::l1, e2::l2 -> - inner (f e1 e2 :: acc) (l1, l2) - | _ -> invalid_arg "List.rev_map2" - in - inner [] (l1, l2) - - let map2 f l1 l2 = rev_map2 f l1 l2 |> rev + in rev x0s_r, rev x1s_r, rev x2s_r let rev_map3 f l1 l2 l3 = let rec inner acc = function