@nxtedition/rocksdb 6.0.1 → 7.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUILDING.md +12 -4
- package/binding.cc +421 -40
- package/deps/rocksdb/build_version.cc +4 -10
- package/deps/rocksdb/rocksdb/CMakeLists.txt +26 -3
- package/deps/rocksdb/rocksdb/Makefile +73 -91
- package/deps/rocksdb/rocksdb/TARGETS +27 -2
- package/deps/rocksdb/rocksdb/cache/cache_test.cc +29 -17
- package/deps/rocksdb/rocksdb/cache/fast_lru_cache.cc +511 -0
- package/deps/rocksdb/rocksdb/cache/fast_lru_cache.h +299 -0
- package/deps/rocksdb/rocksdb/cache/lru_cache.cc +3 -0
- package/deps/rocksdb/rocksdb/cache/lru_cache.h +7 -0
- package/deps/rocksdb/rocksdb/cmake/modules/CxxFlags.cmake +7 -0
- package/deps/rocksdb/rocksdb/cmake/modules/FindJeMalloc.cmake +29 -0
- package/deps/rocksdb/rocksdb/cmake/modules/FindNUMA.cmake +29 -0
- package/deps/rocksdb/rocksdb/cmake/modules/FindSnappy.cmake +29 -0
- package/deps/rocksdb/rocksdb/cmake/modules/FindTBB.cmake +33 -0
- package/deps/rocksdb/rocksdb/cmake/modules/Findgflags.cmake +29 -0
- package/deps/rocksdb/rocksdb/cmake/modules/Findlz4.cmake +29 -0
- package/deps/rocksdb/rocksdb/cmake/modules/Finduring.cmake +26 -0
- package/deps/rocksdb/rocksdb/cmake/modules/Findzstd.cmake +29 -0
- package/deps/rocksdb/rocksdb/cmake/modules/ReadVersion.cmake +10 -0
- package/deps/rocksdb/rocksdb/common.mk +30 -0
- package/deps/rocksdb/rocksdb/crash_test.mk +3 -3
- package/deps/rocksdb/rocksdb/db/arena_wrapped_db_iter.cc +1 -1
- package/deps/rocksdb/rocksdb/db/blob/blob_index.h +3 -3
- package/deps/rocksdb/rocksdb/db/blob/db_blob_index_test.cc +7 -7
- package/deps/rocksdb/rocksdb/db/builder.cc +22 -7
- package/deps/rocksdb/rocksdb/db/c.cc +71 -0
- package/deps/rocksdb/rocksdb/db/c_test.c +28 -2
- package/deps/rocksdb/rocksdb/db/column_family.cc +12 -5
- package/deps/rocksdb/rocksdb/db/column_family_test.cc +23 -22
- package/deps/rocksdb/rocksdb/db/compact_files_test.cc +11 -11
- package/deps/rocksdb/rocksdb/db/compaction/compaction.cc +2 -2
- package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator.cc +36 -10
- package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator.h +4 -1
- package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator_test.cc +3 -2
- package/deps/rocksdb/rocksdb/db/compaction/compaction_job.cc +54 -16
- package/deps/rocksdb/rocksdb/db/compaction/compaction_job.h +14 -2
- package/deps/rocksdb/rocksdb/db/compaction/compaction_job_stats_test.cc +3 -3
- package/deps/rocksdb/rocksdb/db/compaction/compaction_job_test.cc +85 -18
- package/deps/rocksdb/rocksdb/db/compaction/compaction_picker.cc +7 -7
- package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_level.cc +1 -1
- package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_test.cc +23 -22
- package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_universal.cc +1 -1
- package/deps/rocksdb/rocksdb/db/compaction/compaction_service_test.cc +151 -32
- package/deps/rocksdb/rocksdb/db/comparator_db_test.cc +1 -1
- package/deps/rocksdb/rocksdb/db/convenience.cc +8 -6
- package/deps/rocksdb/rocksdb/db/corruption_test.cc +209 -38
- package/deps/rocksdb/rocksdb/db/cuckoo_table_db_test.cc +2 -2
- package/deps/rocksdb/rocksdb/db/db_basic_test.cc +404 -32
- package/deps/rocksdb/rocksdb/db/db_block_cache_test.cc +28 -25
- package/deps/rocksdb/rocksdb/db/db_bloom_filter_test.cc +85 -138
- package/deps/rocksdb/rocksdb/db/db_compaction_filter_test.cc +68 -3
- package/deps/rocksdb/rocksdb/db/db_compaction_test.cc +38 -13
- package/deps/rocksdb/rocksdb/db/db_filesnapshot.cc +1 -1
- package/deps/rocksdb/rocksdb/db/db_flush_test.cc +1 -1
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl.cc +11 -20
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl.h +15 -1
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl_compaction_flush.cc +12 -9
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl_debug.cc +5 -4
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl_experimental.cc +1 -1
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl_files.cc +2 -2
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl_open.cc +42 -10
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl_readonly.cc +54 -23
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl_readonly.h +3 -0
- package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.cc +14 -4
- package/deps/rocksdb/rocksdb/db/db_info_dumper.cc +26 -18
- package/deps/rocksdb/rocksdb/db/db_iter_stress_test.cc +8 -7
- package/deps/rocksdb/rocksdb/db/db_iter_test.cc +8 -8
- package/deps/rocksdb/rocksdb/db/db_iterator_test.cc +6 -3
- package/deps/rocksdb/rocksdb/db/db_kv_checksum_test.cc +2 -2
- package/deps/rocksdb/rocksdb/db/db_log_iter_test.cc +6 -6
- package/deps/rocksdb/rocksdb/db/db_memtable_test.cc +2 -2
- package/deps/rocksdb/rocksdb/db/db_options_test.cc +28 -12
- package/deps/rocksdb/rocksdb/db/db_properties_test.cc +16 -15
- package/deps/rocksdb/rocksdb/db/db_range_del_test.cc +6 -4
- package/deps/rocksdb/rocksdb/db/db_readonly_with_timestamp_test.cc +331 -0
- package/deps/rocksdb/rocksdb/db/db_secondary_test.cc +11 -6
- package/deps/rocksdb/rocksdb/db/db_sst_test.cc +68 -7
- package/deps/rocksdb/rocksdb/db/db_table_properties_test.cc +6 -5
- package/deps/rocksdb/rocksdb/db/db_test.cc +60 -42
- package/deps/rocksdb/rocksdb/db/db_test2.cc +244 -111
- package/deps/rocksdb/rocksdb/db/db_test_util.cc +101 -19
- package/deps/rocksdb/rocksdb/db/db_test_util.h +52 -2
- package/deps/rocksdb/rocksdb/db/db_universal_compaction_test.cc +1 -1
- package/deps/rocksdb/rocksdb/db/db_wal_test.cc +7 -7
- package/deps/rocksdb/rocksdb/db/db_with_timestamp_basic_test.cc +5 -175
- package/deps/rocksdb/rocksdb/db/db_with_timestamp_test_util.cc +96 -0
- package/deps/rocksdb/rocksdb/db/db_with_timestamp_test_util.h +126 -0
- package/deps/rocksdb/rocksdb/db/db_write_test.cc +6 -6
- package/deps/rocksdb/rocksdb/db/dbformat.h +2 -1
- package/deps/rocksdb/rocksdb/db/deletefile_test.cc +1 -1
- package/deps/rocksdb/rocksdb/db/error_handler_fs_test.cc +8 -8
- package/deps/rocksdb/rocksdb/db/experimental.cc +1 -1
- package/deps/rocksdb/rocksdb/db/external_sst_file_basic_test.cc +91 -12
- package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.cc +16 -2
- package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.h +2 -0
- package/deps/rocksdb/rocksdb/db/external_sst_file_test.cc +7 -7
- package/deps/rocksdb/rocksdb/db/file_indexer.h +1 -4
- package/deps/rocksdb/rocksdb/db/flush_job.cc +28 -15
- package/deps/rocksdb/rocksdb/db/flush_job.h +4 -0
- package/deps/rocksdb/rocksdb/db/flush_job_test.cc +98 -30
- package/deps/rocksdb/rocksdb/db/forward_iterator.cc +1 -1
- package/deps/rocksdb/rocksdb/db/import_column_family_job.cc +14 -1
- package/deps/rocksdb/rocksdb/db/import_column_family_test.cc +6 -0
- package/deps/rocksdb/rocksdb/db/internal_stats.cc +12 -12
- package/deps/rocksdb/rocksdb/db/listener_test.cc +4 -3
- package/deps/rocksdb/rocksdb/db/memtable.cc +2 -2
- package/deps/rocksdb/rocksdb/db/memtable_list.h +1 -1
- package/deps/rocksdb/rocksdb/db/memtable_list_test.cc +37 -25
- package/deps/rocksdb/rocksdb/db/obsolete_files_test.cc +1 -1
- package/deps/rocksdb/rocksdb/db/perf_context_test.cc +18 -18
- package/deps/rocksdb/rocksdb/db/plain_table_db_test.cc +6 -6
- package/deps/rocksdb/rocksdb/db/prefix_test.cc +1 -1
- package/deps/rocksdb/rocksdb/db/repair.cc +13 -2
- package/deps/rocksdb/rocksdb/db/repair_test.cc +37 -15
- package/deps/rocksdb/rocksdb/db/snapshot_checker.h +1 -2
- package/deps/rocksdb/rocksdb/db/snapshot_impl.h +3 -1
- package/deps/rocksdb/rocksdb/db/table_cache.cc +20 -130
- package/deps/rocksdb/rocksdb/db/table_cache.h +3 -2
- package/deps/rocksdb/rocksdb/db/table_cache_sync_and_async.h +140 -0
- package/deps/rocksdb/rocksdb/db/version_builder.cc +1 -1
- package/deps/rocksdb/rocksdb/db/version_builder_test.cc +133 -133
- package/deps/rocksdb/rocksdb/db/version_edit.cc +22 -2
- package/deps/rocksdb/rocksdb/db/version_edit.h +13 -4
- package/deps/rocksdb/rocksdb/db/version_edit_test.cc +14 -14
- package/deps/rocksdb/rocksdb/db/version_set.cc +207 -214
- package/deps/rocksdb/rocksdb/db/version_set.h +14 -3
- package/deps/rocksdb/rocksdb/db/version_set_sync_and_async.h +154 -0
- package/deps/rocksdb/rocksdb/db/version_set_test.cc +10 -9
- package/deps/rocksdb/rocksdb/db/wal_edit.h +2 -1
- package/deps/rocksdb/rocksdb/db/wal_manager.cc +2 -3
- package/deps/rocksdb/rocksdb/db/wal_manager_test.cc +1 -1
- package/deps/rocksdb/rocksdb/db/write_batch.cc +178 -30
- package/deps/rocksdb/rocksdb/db/write_batch_test.cc +6 -6
- package/deps/rocksdb/rocksdb/db/write_controller.h +1 -1
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_common.cc +0 -2
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_common.h +9 -6
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_compaction_filter.h +2 -1
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_driver.cc +4 -3
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_gflags.cc +44 -6
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_listener.cc +4 -1
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_shared_state.cc +0 -10
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_shared_state.h +45 -42
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.cc +374 -275
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.h +53 -3
- package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_tool.cc +0 -12
- package/deps/rocksdb/rocksdb/db_stress_tool/expected_state.cc +13 -11
- package/deps/rocksdb/rocksdb/db_stress_tool/multi_ops_txns_stress.cc +276 -109
- package/deps/rocksdb/rocksdb/db_stress_tool/multi_ops_txns_stress.h +63 -0
- package/deps/rocksdb/rocksdb/db_stress_tool/no_batched_ops_stress.cc +45 -54
- package/deps/rocksdb/rocksdb/env/composite_env.cc +87 -14
- package/deps/rocksdb/rocksdb/env/env.cc +0 -60
- package/deps/rocksdb/rocksdb/env/env_encryption.cc +9 -0
- package/deps/rocksdb/rocksdb/env/env_encryption_ctr.h +1 -1
- package/deps/rocksdb/rocksdb/env/env_posix.cc +6 -5
- package/deps/rocksdb/rocksdb/env/env_test.cc +18 -5
- package/deps/rocksdb/rocksdb/env/fs_posix.cc +17 -12
- package/deps/rocksdb/rocksdb/env/io_posix.cc +39 -37
- package/deps/rocksdb/rocksdb/file/delete_scheduler_test.cc +9 -9
- package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.cc +159 -65
- package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.h +44 -22
- package/deps/rocksdb/rocksdb/file/file_util.h +2 -0
- package/deps/rocksdb/rocksdb/file/prefetch_test.cc +142 -17
- package/deps/rocksdb/rocksdb/file/random_access_file_reader.h +5 -2
- package/deps/rocksdb/rocksdb/file/sequence_file_reader.cc +7 -0
- package/deps/rocksdb/rocksdb/file/writable_file_writer.cc +60 -40
- package/deps/rocksdb/rocksdb/file/writable_file_writer.h +1 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/advanced_options.h +23 -5
- package/deps/rocksdb/rocksdb/include/rocksdb/c.h +49 -1
- package/deps/rocksdb/rocksdb/include/rocksdb/cache.h +5 -5
- package/deps/rocksdb/rocksdb/include/rocksdb/cleanable.h +59 -2
- package/deps/rocksdb/rocksdb/include/rocksdb/compaction_filter.h +1 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/convenience.h +2 -1
- package/deps/rocksdb/rocksdb/include/rocksdb/db.h +46 -44
- package/deps/rocksdb/rocksdb/include/rocksdb/env.h +1 -1
- package/deps/rocksdb/rocksdb/include/rocksdb/file_system.h +2 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/iostats_context.h +2 -4
- package/deps/rocksdb/rocksdb/include/rocksdb/memtablerep.h +3 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/options.h +45 -3
- package/deps/rocksdb/rocksdb/include/rocksdb/perf_context.h +2 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/snapshot.h +4 -1
- package/deps/rocksdb/rocksdb/include/rocksdb/statistics.h +3 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/table.h +91 -40
- package/deps/rocksdb/rocksdb/include/rocksdb/thread_status.h +1 -2
- package/deps/rocksdb/rocksdb/include/rocksdb/unique_id.h +22 -13
- package/deps/rocksdb/rocksdb/include/rocksdb/utilities/customizable_util.h +9 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/utilities/ldb_cmd.h +4 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/utilities/object_registry.h +25 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/utilities/options_type.h +378 -103
- package/deps/rocksdb/rocksdb/include/rocksdb/utilities/transaction_db.h +14 -0
- package/deps/rocksdb/rocksdb/include/rocksdb/version.h +2 -2
- package/deps/rocksdb/rocksdb/include/rocksdb/write_batch.h +18 -4
- package/deps/rocksdb/rocksdb/memory/arena.h +1 -1
- package/deps/rocksdb/rocksdb/memory/concurrent_arena.cc +1 -5
- package/deps/rocksdb/rocksdb/memory/concurrent_arena.h +1 -5
- package/deps/rocksdb/rocksdb/memory/jemalloc_nodump_allocator.cc +6 -8
- package/deps/rocksdb/rocksdb/memtable/skiplistrep.cc +1 -1
- package/deps/rocksdb/rocksdb/memtable/write_buffer_manager.cc +1 -1
- package/deps/rocksdb/rocksdb/memtable/write_buffer_manager_test.cc +5 -3
- package/deps/rocksdb/rocksdb/microbench/db_basic_bench.cc +266 -45
- package/deps/rocksdb/rocksdb/monitoring/histogram.cc +2 -1
- package/deps/rocksdb/rocksdb/monitoring/iostats_context.cc +1 -4
- package/deps/rocksdb/rocksdb/monitoring/iostats_context_imp.h +4 -4
- package/deps/rocksdb/rocksdb/monitoring/perf_context.cc +7 -8
- package/deps/rocksdb/rocksdb/monitoring/perf_context_imp.h +2 -2
- package/deps/rocksdb/rocksdb/monitoring/perf_level.cc +1 -5
- package/deps/rocksdb/rocksdb/monitoring/perf_level_imp.h +1 -5
- package/deps/rocksdb/rocksdb/monitoring/persistent_stats_history.cc +2 -2
- package/deps/rocksdb/rocksdb/monitoring/statistics.cc +1 -1
- package/deps/rocksdb/rocksdb/monitoring/thread_status_updater.cc +2 -1
- package/deps/rocksdb/rocksdb/monitoring/thread_status_updater.h +1 -1
- package/deps/rocksdb/rocksdb/monitoring/thread_status_util.cc +3 -3
- package/deps/rocksdb/rocksdb/monitoring/thread_status_util.h +2 -2
- package/deps/rocksdb/rocksdb/options/cf_options.cc +47 -38
- package/deps/rocksdb/rocksdb/options/configurable.cc +9 -27
- package/deps/rocksdb/rocksdb/options/configurable_test.cc +1 -1
- package/deps/rocksdb/rocksdb/options/customizable.cc +3 -1
- package/deps/rocksdb/rocksdb/options/customizable_test.cc +379 -318
- package/deps/rocksdb/rocksdb/options/db_options.cc +46 -17
- package/deps/rocksdb/rocksdb/options/db_options.h +2 -0
- package/deps/rocksdb/rocksdb/options/options.cc +7 -0
- package/deps/rocksdb/rocksdb/options/options_helper.cc +86 -39
- package/deps/rocksdb/rocksdb/options/options_parser.cc +10 -10
- package/deps/rocksdb/rocksdb/options/options_settable_test.cc +12 -7
- package/deps/rocksdb/rocksdb/options/options_test.cc +222 -68
- package/deps/rocksdb/rocksdb/port/port_posix.h +0 -15
- package/deps/rocksdb/rocksdb/port/win/env_win.cc +5 -4
- package/deps/rocksdb/rocksdb/port/win/env_win.h +2 -2
- package/deps/rocksdb/rocksdb/port/win/port_win.h +0 -31
- package/deps/rocksdb/rocksdb/rocksdb.pc.in +11 -0
- package/deps/rocksdb/rocksdb/src.mk +6 -1
- package/deps/rocksdb/rocksdb/table/block_based/binary_search_index_reader.cc +2 -1
- package/deps/rocksdb/rocksdb/table/block_based/block.cc +4 -2
- package/deps/rocksdb/rocksdb/table/block_based/block.h +21 -25
- package/deps/rocksdb/rocksdb/table/block_based/block_based_filter_block.cc +3 -4
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_builder.cc +23 -8
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_factory.cc +52 -15
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.cc +81 -7
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.h +8 -2
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.cc +94 -726
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.h +21 -15
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_impl.h +9 -3
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +754 -0
- package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_test.cc +44 -73
- package/deps/rocksdb/rocksdb/table/block_based/block_prefetcher.cc +15 -5
- package/deps/rocksdb/rocksdb/table/block_based/block_prefetcher.h +2 -1
- package/deps/rocksdb/rocksdb/table/block_based/filter_block.h +2 -11
- package/deps/rocksdb/rocksdb/table/block_based/filter_block_reader_common.cc +59 -1
- package/deps/rocksdb/rocksdb/table/block_based/filter_block_reader_common.h +18 -0
- package/deps/rocksdb/rocksdb/table/block_based/filter_policy.cc +33 -17
- package/deps/rocksdb/rocksdb/table/block_based/full_filter_block.cc +0 -61
- package/deps/rocksdb/rocksdb/table/block_based/full_filter_block.h +0 -13
- package/deps/rocksdb/rocksdb/table/block_based/hash_index_reader.cc +2 -1
- package/deps/rocksdb/rocksdb/table/block_based/index_builder.h +2 -2
- package/deps/rocksdb/rocksdb/table/block_based/index_reader_common.cc +3 -2
- package/deps/rocksdb/rocksdb/table/block_based/index_reader_common.h +2 -1
- package/deps/rocksdb/rocksdb/table/block_based/partitioned_filter_block.cc +3 -2
- package/deps/rocksdb/rocksdb/table/block_based/partitioned_index_iterator.cc +4 -3
- package/deps/rocksdb/rocksdb/table/block_based/partitioned_index_reader.cc +8 -4
- package/deps/rocksdb/rocksdb/table/block_based/reader_common.cc +4 -4
- package/deps/rocksdb/rocksdb/table/block_based/uncompression_dict_reader.cc +2 -1
- package/deps/rocksdb/rocksdb/table/block_fetcher.cc +65 -7
- package/deps/rocksdb/rocksdb/table/block_fetcher.h +2 -0
- package/deps/rocksdb/rocksdb/table/cleanable_test.cc +113 -0
- package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_builder.cc +1 -1
- package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_builder.h +1 -1
- package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_reader_test.cc +1 -1
- package/deps/rocksdb/rocksdb/table/format.cc +22 -20
- package/deps/rocksdb/rocksdb/table/iterator.cc +1 -81
- package/deps/rocksdb/rocksdb/table/merging_iterator.cc +39 -0
- package/deps/rocksdb/rocksdb/table/meta_blocks.cc +2 -2
- package/deps/rocksdb/rocksdb/table/multiget_context.h +60 -13
- package/deps/rocksdb/rocksdb/table/persistent_cache_options.h +0 -3
- package/deps/rocksdb/rocksdb/table/plain/plain_table_factory.cc +12 -1
- package/deps/rocksdb/rocksdb/table/plain/plain_table_reader.cc +4 -4
- package/deps/rocksdb/rocksdb/table/sst_file_dumper.cc +2 -1
- package/deps/rocksdb/rocksdb/table/sst_file_dumper.h +1 -1
- package/deps/rocksdb/rocksdb/table/sst_file_writer_collectors.h +1 -1
- package/deps/rocksdb/rocksdb/table/table_properties.cc +3 -5
- package/deps/rocksdb/rocksdb/table/table_reader.h +13 -0
- package/deps/rocksdb/rocksdb/table/table_test.cc +202 -78
- package/deps/rocksdb/rocksdb/table/unique_id.cc +84 -25
- package/deps/rocksdb/rocksdb/table/unique_id_impl.h +37 -4
- package/deps/rocksdb/rocksdb/test_util/testutil.cc +3 -1
- package/deps/rocksdb/rocksdb/test_util/testutil.h +11 -8
- package/deps/rocksdb/rocksdb/test_util/transaction_test_util.cc +8 -4
- package/deps/rocksdb/rocksdb/test_util/transaction_test_util.h +17 -0
- package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.cc +11 -9
- package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc +3 -3
- package/deps/rocksdb/rocksdb/tools/db_bench_tool.cc +277 -105
- package/deps/rocksdb/rocksdb/tools/db_sanity_test.cc +4 -4
- package/deps/rocksdb/rocksdb/tools/ldb_cmd.cc +186 -42
- package/deps/rocksdb/rocksdb/tools/ldb_cmd_impl.h +75 -49
- package/deps/rocksdb/rocksdb/tools/ldb_cmd_test.cc +9 -8
- package/deps/rocksdb/rocksdb/tools/ldb_tool.cc +4 -1
- package/deps/rocksdb/rocksdb/tools/reduce_levels_test.cc +2 -2
- package/deps/rocksdb/rocksdb/tools/sst_dump_tool.cc +26 -4
- package/deps/rocksdb/rocksdb/tools/trace_analyzer_tool.cc +1 -1
- package/deps/rocksdb/rocksdb/trace_replay/block_cache_tracer.h +1 -1
- package/deps/rocksdb/rocksdb/util/async_file_reader.cc +72 -0
- package/deps/rocksdb/rocksdb/util/async_file_reader.h +144 -0
- package/deps/rocksdb/rocksdb/util/autovector_test.cc +4 -4
- package/deps/rocksdb/rocksdb/util/bloom_test.cc +14 -8
- package/deps/rocksdb/rocksdb/util/build_version.cc.in +5 -6
- package/deps/rocksdb/rocksdb/util/cleanable.cc +180 -0
- package/deps/rocksdb/rocksdb/util/comparator.cc +5 -3
- package/deps/rocksdb/rocksdb/util/compression.h +56 -7
- package/deps/rocksdb/rocksdb/util/coro_utils.h +111 -0
- package/deps/rocksdb/rocksdb/util/file_reader_writer_test.cc +148 -0
- package/deps/rocksdb/rocksdb/util/filelock_test.cc +2 -2
- package/deps/rocksdb/rocksdb/util/filter_bench.cc +12 -4
- package/deps/rocksdb/rocksdb/util/heap.h +5 -3
- package/deps/rocksdb/rocksdb/util/random.cc +1 -5
- package/deps/rocksdb/rocksdb/util/rate_limiter.cc +12 -9
- package/deps/rocksdb/rocksdb/util/rate_limiter_test.cc +1 -1
- package/deps/rocksdb/rocksdb/util/ribbon_alg.h +1 -1
- package/deps/rocksdb/rocksdb/util/ribbon_test.cc +2 -4
- package/deps/rocksdb/rocksdb/util/single_thread_executor.h +55 -0
- package/deps/rocksdb/rocksdb/util/slice.cc +8 -9
- package/deps/rocksdb/rocksdb/util/string_util.cc +3 -2
- package/deps/rocksdb/rocksdb/util/string_util.h +0 -13
- package/deps/rocksdb/rocksdb/util/thread_local.cc +4 -23
- package/deps/rocksdb/rocksdb/utilities/backup/backup_engine.cc +99 -22
- package/deps/rocksdb/rocksdb/utilities/backup/backup_engine_impl.h +7 -0
- package/deps/rocksdb/rocksdb/utilities/backup/backup_engine_test.cc +102 -59
- package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_test.cc +38 -36
- package/deps/rocksdb/rocksdb/utilities/blob_db/blob_dump_tool.cc +2 -2
- package/deps/rocksdb/rocksdb/utilities/fault_injection_fs.cc +28 -0
- package/deps/rocksdb/rocksdb/utilities/fault_injection_fs.h +3 -0
- package/deps/rocksdb/rocksdb/utilities/memory/memory_test.cc +1 -1
- package/deps/rocksdb/rocksdb/utilities/object_registry.cc +71 -0
- package/deps/rocksdb/rocksdb/utilities/object_registry_test.cc +71 -0
- package/deps/rocksdb/rocksdb/utilities/options/options_util_test.cc +1 -1
- package/deps/rocksdb/rocksdb/utilities/simulator_cache/sim_cache_test.cc +5 -5
- package/deps/rocksdb/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc +3 -3
- package/deps/rocksdb/rocksdb/utilities/transactions/lock/point/point_lock_tracker.cc +0 -13
- package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_locking_test.cc +40 -0
- package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc +10 -8
- package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.h +4 -2
- package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +17 -0
- package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc +7 -7
- package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction.cc +8 -1
- package/deps/rocksdb/rocksdb/utilities/transactions/snapshot_checker.cc +5 -1
- package/deps/rocksdb/rocksdb/utilities/transactions/transaction_test.cc +21 -15
- package/deps/rocksdb/rocksdb/utilities/transactions/transaction_util.cc +2 -2
- package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_transaction_test.cc +69 -11
- package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn.cc +22 -9
- package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn_db.cc +26 -5
- package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn_db.h +17 -4
- package/deps/rocksdb/rocksdb/utilities/transactions/write_unprepared_transaction_test.cc +19 -16
- package/deps/rocksdb/rocksdb/utilities/transactions/write_unprepared_txn.cc +7 -3
- package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +3 -2
- package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +2 -2
- package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +2 -2
- package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_test.cc +6 -6
- package/deps/rocksdb/rocksdb.gyp +20 -13
- package/index.js +187 -3
- package/iterator.js +1 -0
- package/package-lock.json +23687 -0
- package/package.json +2 -30
- package/prebuilds/darwin-arm64/node.napi.node +0 -0
- package/snapshot.js +23 -0
- package/deps/liburing/liburing/README +0 -46
- package/deps/liburing/liburing/test/232c93d07b74-test.c +0 -305
- package/deps/liburing/liburing/test/35fa71a030ca-test.c +0 -329
- package/deps/liburing/liburing/test/500f9fbadef8-test.c +0 -89
- package/deps/liburing/liburing/test/7ad0e4b2f83c-test.c +0 -93
- package/deps/liburing/liburing/test/8a9973408177-test.c +0 -106
- package/deps/liburing/liburing/test/917257daa0fe-test.c +0 -53
- package/deps/liburing/liburing/test/Makefile +0 -312
- package/deps/liburing/liburing/test/a0908ae19763-test.c +0 -58
- package/deps/liburing/liburing/test/a4c0b3decb33-test.c +0 -180
- package/deps/liburing/liburing/test/accept-link.c +0 -251
- package/deps/liburing/liburing/test/accept-reuse.c +0 -164
- package/deps/liburing/liburing/test/accept-test.c +0 -79
- package/deps/liburing/liburing/test/accept.c +0 -476
- package/deps/liburing/liburing/test/across-fork.c +0 -283
- package/deps/liburing/liburing/test/b19062a56726-test.c +0 -53
- package/deps/liburing/liburing/test/b5837bd5311d-test.c +0 -77
- package/deps/liburing/liburing/test/ce593a6c480a-test.c +0 -135
- package/deps/liburing/liburing/test/close-opath.c +0 -122
- package/deps/liburing/liburing/test/config +0 -10
- package/deps/liburing/liburing/test/connect.c +0 -398
- package/deps/liburing/liburing/test/cq-full.c +0 -96
- package/deps/liburing/liburing/test/cq-overflow.c +0 -294
- package/deps/liburing/liburing/test/cq-peek-batch.c +0 -102
- package/deps/liburing/liburing/test/cq-ready.c +0 -94
- package/deps/liburing/liburing/test/cq-size.c +0 -58
- package/deps/liburing/liburing/test/d4ae271dfaae-test.c +0 -96
- package/deps/liburing/liburing/test/d77a67ed5f27-test.c +0 -65
- package/deps/liburing/liburing/test/defer.c +0 -307
- package/deps/liburing/liburing/test/double-poll-crash.c +0 -186
- package/deps/liburing/liburing/test/eeed8b54e0df-test.c +0 -114
- package/deps/liburing/liburing/test/empty-eownerdead.c +0 -42
- package/deps/liburing/liburing/test/eventfd-disable.c +0 -151
- package/deps/liburing/liburing/test/eventfd-ring.c +0 -97
- package/deps/liburing/liburing/test/eventfd.c +0 -112
- package/deps/liburing/liburing/test/fadvise.c +0 -202
- package/deps/liburing/liburing/test/fallocate.c +0 -249
- package/deps/liburing/liburing/test/fc2a85cb02ef-test.c +0 -138
- package/deps/liburing/liburing/test/file-register.c +0 -843
- package/deps/liburing/liburing/test/file-update.c +0 -173
- package/deps/liburing/liburing/test/files-exit-hang-poll.c +0 -128
- package/deps/liburing/liburing/test/files-exit-hang-timeout.c +0 -134
- package/deps/liburing/liburing/test/fixed-link.c +0 -90
- package/deps/liburing/liburing/test/fsync.c +0 -224
- package/deps/liburing/liburing/test/hardlink.c +0 -136
- package/deps/liburing/liburing/test/helpers.c +0 -135
- package/deps/liburing/liburing/test/helpers.h +0 -67
- package/deps/liburing/liburing/test/io-cancel.c +0 -537
- package/deps/liburing/liburing/test/io_uring_enter.c +0 -296
- package/deps/liburing/liburing/test/io_uring_register.c +0 -664
- package/deps/liburing/liburing/test/io_uring_setup.c +0 -192
- package/deps/liburing/liburing/test/iopoll.c +0 -366
- package/deps/liburing/liburing/test/lfs-openat-write.c +0 -117
- package/deps/liburing/liburing/test/lfs-openat.c +0 -273
- package/deps/liburing/liburing/test/link-timeout.c +0 -1107
- package/deps/liburing/liburing/test/link.c +0 -496
- package/deps/liburing/liburing/test/link_drain.c +0 -229
- package/deps/liburing/liburing/test/madvise.c +0 -195
- package/deps/liburing/liburing/test/mkdir.c +0 -108
- package/deps/liburing/liburing/test/multicqes_drain.c +0 -383
- package/deps/liburing/liburing/test/nop-all-sizes.c +0 -107
- package/deps/liburing/liburing/test/nop.c +0 -115
- package/deps/liburing/liburing/test/open-close.c +0 -146
- package/deps/liburing/liburing/test/openat2.c +0 -240
- package/deps/liburing/liburing/test/personality.c +0 -204
- package/deps/liburing/liburing/test/pipe-eof.c +0 -81
- package/deps/liburing/liburing/test/pipe-reuse.c +0 -105
- package/deps/liburing/liburing/test/poll-cancel-ton.c +0 -139
- package/deps/liburing/liburing/test/poll-cancel.c +0 -135
- package/deps/liburing/liburing/test/poll-link.c +0 -227
- package/deps/liburing/liburing/test/poll-many.c +0 -208
- package/deps/liburing/liburing/test/poll-mshot-update.c +0 -273
- package/deps/liburing/liburing/test/poll-ring.c +0 -48
- package/deps/liburing/liburing/test/poll-v-poll.c +0 -353
- package/deps/liburing/liburing/test/poll.c +0 -109
- package/deps/liburing/liburing/test/probe.c +0 -137
- package/deps/liburing/liburing/test/read-write.c +0 -876
- package/deps/liburing/liburing/test/register-restrictions.c +0 -633
- package/deps/liburing/liburing/test/rename.c +0 -134
- package/deps/liburing/liburing/test/ring-leak.c +0 -173
- package/deps/liburing/liburing/test/ring-leak2.c +0 -249
- package/deps/liburing/liburing/test/rsrc_tags.c +0 -449
- package/deps/liburing/liburing/test/runtests-loop.sh +0 -16
- package/deps/liburing/liburing/test/runtests.sh +0 -170
- package/deps/liburing/liburing/test/rw_merge_test.c +0 -97
- package/deps/liburing/liburing/test/self.c +0 -91
- package/deps/liburing/liburing/test/send_recv.c +0 -291
- package/deps/liburing/liburing/test/send_recvmsg.c +0 -345
- package/deps/liburing/liburing/test/sendmsg_fs_cve.c +0 -198
- package/deps/liburing/liburing/test/shared-wq.c +0 -84
- package/deps/liburing/liburing/test/short-read.c +0 -75
- package/deps/liburing/liburing/test/shutdown.c +0 -163
- package/deps/liburing/liburing/test/sigfd-deadlock.c +0 -74
- package/deps/liburing/liburing/test/socket-rw-eagain.c +0 -156
- package/deps/liburing/liburing/test/socket-rw.c +0 -147
- package/deps/liburing/liburing/test/splice.c +0 -511
- package/deps/liburing/liburing/test/sq-full-cpp.cc +0 -45
- package/deps/liburing/liburing/test/sq-full.c +0 -45
- package/deps/liburing/liburing/test/sq-poll-dup.c +0 -200
- package/deps/liburing/liburing/test/sq-poll-kthread.c +0 -168
- package/deps/liburing/liburing/test/sq-poll-share.c +0 -137
- package/deps/liburing/liburing/test/sq-space_left.c +0 -159
- package/deps/liburing/liburing/test/sqpoll-cancel-hang.c +0 -159
- package/deps/liburing/liburing/test/sqpoll-disable-exit.c +0 -195
- package/deps/liburing/liburing/test/sqpoll-exit-hang.c +0 -77
- package/deps/liburing/liburing/test/sqpoll-sleep.c +0 -68
- package/deps/liburing/liburing/test/statx.c +0 -172
- package/deps/liburing/liburing/test/stdout.c +0 -232
- package/deps/liburing/liburing/test/submit-link-fail.c +0 -154
- package/deps/liburing/liburing/test/submit-reuse.c +0 -239
- package/deps/liburing/liburing/test/symlink.c +0 -116
- package/deps/liburing/liburing/test/teardowns.c +0 -58
- package/deps/liburing/liburing/test/thread-exit.c +0 -131
- package/deps/liburing/liburing/test/timeout-new.c +0 -246
- package/deps/liburing/liburing/test/timeout-overflow.c +0 -204
- package/deps/liburing/liburing/test/timeout.c +0 -1354
- package/deps/liburing/liburing/test/unlink.c +0 -111
- package/deps/liburing/liburing/test/wakeup-hang.c +0 -162
- package/deps/rocksdb/rocksdb/README.md +0 -32
- package/deps/rocksdb/rocksdb/microbench/README.md +0 -60
- package/deps/rocksdb/rocksdb/plugin/README.md +0 -43
- package/deps/rocksdb/rocksdb/port/README +0 -10
- package/deps/rocksdb/rocksdb/python.mk +0 -9
- package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/README +0 -13
- package/prebuilds/darwin-x64/node.napi.node +0 -0
- package/prebuilds/linux-arm64/node.napi.node +0 -0
- package/prebuilds/linux-x64/node.napi.node +0 -0
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
/* SPDX-License-Identifier: MIT */
|
|
2
|
-
/*
|
|
3
|
-
* Description: test sharing a ring across a fork
|
|
4
|
-
*/
|
|
5
|
-
#include <fcntl.h>
|
|
6
|
-
#include <pthread.h>
|
|
7
|
-
#include <signal.h>
|
|
8
|
-
#include <stdio.h>
|
|
9
|
-
#include <stdlib.h>
|
|
10
|
-
#include <string.h>
|
|
11
|
-
#include <sys/mman.h>
|
|
12
|
-
#include <sys/stat.h>
|
|
13
|
-
#include <sys/types.h>
|
|
14
|
-
#include <sys/wait.h>
|
|
15
|
-
#include <unistd.h>
|
|
16
|
-
|
|
17
|
-
#include "liburing.h"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
struct forktestmem
|
|
21
|
-
{
|
|
22
|
-
struct io_uring ring;
|
|
23
|
-
pthread_barrier_t barrier;
|
|
24
|
-
pthread_barrierattr_t barrierattr;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
static int open_tempfile(const char *dir, const char *fname)
|
|
28
|
-
{
|
|
29
|
-
int fd;
|
|
30
|
-
char buf[32];
|
|
31
|
-
|
|
32
|
-
snprintf(buf, sizeof(buf), "%s/%s",
|
|
33
|
-
dir, fname);
|
|
34
|
-
fd = open(buf, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
|
|
35
|
-
if (fd < 0) {
|
|
36
|
-
perror("open");
|
|
37
|
-
exit(1);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return fd;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
static int submit_write(struct io_uring *ring, int fd, const char *str,
|
|
44
|
-
int wait)
|
|
45
|
-
{
|
|
46
|
-
struct io_uring_sqe *sqe;
|
|
47
|
-
struct iovec iovec;
|
|
48
|
-
int ret;
|
|
49
|
-
|
|
50
|
-
sqe = io_uring_get_sqe(ring);
|
|
51
|
-
if (!sqe) {
|
|
52
|
-
fprintf(stderr, "could not get sqe\n");
|
|
53
|
-
return 1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
iovec.iov_base = (char *) str;
|
|
57
|
-
iovec.iov_len = strlen(str);
|
|
58
|
-
io_uring_prep_writev(sqe, fd, &iovec, 1, 0);
|
|
59
|
-
ret = io_uring_submit_and_wait(ring, wait);
|
|
60
|
-
if (ret < 0) {
|
|
61
|
-
fprintf(stderr, "submit failed: %s\n", strerror(-ret));
|
|
62
|
-
return 1;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
static int wait_cqe(struct io_uring *ring, const char *stage)
|
|
69
|
-
{
|
|
70
|
-
struct io_uring_cqe *cqe;
|
|
71
|
-
int ret;
|
|
72
|
-
|
|
73
|
-
ret = io_uring_wait_cqe(ring, &cqe);
|
|
74
|
-
if (ret) {
|
|
75
|
-
fprintf(stderr, "%s wait_cqe failed %d\n", stage, ret);
|
|
76
|
-
return 1;
|
|
77
|
-
}
|
|
78
|
-
if (cqe->res < 0) {
|
|
79
|
-
fprintf(stderr, "%s cqe failed %d\n", stage, cqe->res);
|
|
80
|
-
return 1;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
io_uring_cqe_seen(ring, cqe);
|
|
84
|
-
return 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
static int verify_file(const char *tmpdir, const char *fname, const char* expect)
|
|
88
|
-
{
|
|
89
|
-
int fd;
|
|
90
|
-
char buf[512];
|
|
91
|
-
int err = 0;
|
|
92
|
-
|
|
93
|
-
memset(buf, 0, sizeof(buf));
|
|
94
|
-
|
|
95
|
-
fd = open_tempfile(tmpdir, fname);
|
|
96
|
-
if (fd < 0)
|
|
97
|
-
return 1;
|
|
98
|
-
|
|
99
|
-
if (read(fd, buf, sizeof(buf) - 1) < 0)
|
|
100
|
-
return 1;
|
|
101
|
-
|
|
102
|
-
if (strcmp(buf, expect) != 0) {
|
|
103
|
-
fprintf(stderr, "content mismatch for %s\n"
|
|
104
|
-
"got:\n%s\n"
|
|
105
|
-
"expected:\n%s\n",
|
|
106
|
-
fname, buf, expect);
|
|
107
|
-
err = 1;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
close(fd);
|
|
111
|
-
return err;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
static void cleanup(const char *tmpdir)
|
|
115
|
-
{
|
|
116
|
-
char buf[32];
|
|
117
|
-
|
|
118
|
-
/* don't check errors, called during partial runs */
|
|
119
|
-
|
|
120
|
-
snprintf(buf, sizeof(buf), "%s/%s", tmpdir, "shared");
|
|
121
|
-
unlink(buf);
|
|
122
|
-
|
|
123
|
-
snprintf(buf, sizeof(buf), "%s/%s", tmpdir, "parent1");
|
|
124
|
-
unlink(buf);
|
|
125
|
-
|
|
126
|
-
snprintf(buf, sizeof(buf), "%s/%s", tmpdir, "parent2");
|
|
127
|
-
unlink(buf);
|
|
128
|
-
|
|
129
|
-
snprintf(buf, sizeof(buf), "%s/%s", tmpdir, "child");
|
|
130
|
-
unlink(buf);
|
|
131
|
-
|
|
132
|
-
rmdir(tmpdir);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
int main(int argc, char *argv[])
|
|
136
|
-
{
|
|
137
|
-
struct forktestmem *shmem;
|
|
138
|
-
char tmpdir[] = "forktmpXXXXXX";
|
|
139
|
-
int shared_fd;
|
|
140
|
-
int ret;
|
|
141
|
-
pid_t p;
|
|
142
|
-
|
|
143
|
-
if (argc > 1)
|
|
144
|
-
return 0;
|
|
145
|
-
|
|
146
|
-
shmem = mmap(0, sizeof(struct forktestmem), PROT_READ|PROT_WRITE,
|
|
147
|
-
MAP_SHARED | MAP_ANONYMOUS, 0, 0);
|
|
148
|
-
if (!shmem) {
|
|
149
|
-
fprintf(stderr, "mmap failed\n");
|
|
150
|
-
exit(1);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
pthread_barrierattr_init(&shmem->barrierattr);
|
|
154
|
-
pthread_barrierattr_setpshared(&shmem->barrierattr, 1);
|
|
155
|
-
pthread_barrier_init(&shmem->barrier, &shmem->barrierattr, 2);
|
|
156
|
-
|
|
157
|
-
ret = io_uring_queue_init(10, &shmem->ring, 0);
|
|
158
|
-
if (ret < 0) {
|
|
159
|
-
fprintf(stderr, "queue init failed\n");
|
|
160
|
-
exit(1);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (mkdtemp(tmpdir) == NULL) {
|
|
164
|
-
fprintf(stderr, "temp directory creation failed\n");
|
|
165
|
-
exit(1);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
shared_fd = open_tempfile(tmpdir, "shared");
|
|
169
|
-
|
|
170
|
-
/*
|
|
171
|
-
* First do a write before the fork, to test whether child can
|
|
172
|
-
* reap that
|
|
173
|
-
*/
|
|
174
|
-
if (submit_write(&shmem->ring, shared_fd, "before fork: write shared fd\n", 0))
|
|
175
|
-
goto errcleanup;
|
|
176
|
-
|
|
177
|
-
p = fork();
|
|
178
|
-
switch (p) {
|
|
179
|
-
case -1:
|
|
180
|
-
fprintf(stderr, "fork failed\n");
|
|
181
|
-
goto errcleanup;
|
|
182
|
-
|
|
183
|
-
default: {
|
|
184
|
-
/* parent */
|
|
185
|
-
int parent_fd1;
|
|
186
|
-
int parent_fd2;
|
|
187
|
-
int wstatus;
|
|
188
|
-
|
|
189
|
-
/* wait till fork is started up */
|
|
190
|
-
pthread_barrier_wait(&shmem->barrier);
|
|
191
|
-
|
|
192
|
-
parent_fd1 = open_tempfile(tmpdir, "parent1");
|
|
193
|
-
parent_fd2 = open_tempfile(tmpdir, "parent2");
|
|
194
|
-
|
|
195
|
-
/* do a parent write to the shared fd */
|
|
196
|
-
if (submit_write(&shmem->ring, shared_fd, "parent: write shared fd\n", 0))
|
|
197
|
-
goto errcleanup;
|
|
198
|
-
|
|
199
|
-
/* do a parent write to an fd where same numbered fd exists in child */
|
|
200
|
-
if (submit_write(&shmem->ring, parent_fd1, "parent: write parent fd 1\n", 0))
|
|
201
|
-
goto errcleanup;
|
|
202
|
-
|
|
203
|
-
/* do a parent write to an fd where no same numbered fd exists in child */
|
|
204
|
-
if (submit_write(&shmem->ring, parent_fd2, "parent: write parent fd 2\n", 0))
|
|
205
|
-
goto errcleanup;
|
|
206
|
-
|
|
207
|
-
/* wait to switch read/writ roles with child */
|
|
208
|
-
pthread_barrier_wait(&shmem->barrier);
|
|
209
|
-
|
|
210
|
-
/* now wait for child to exit, to ensure we still can read completion */
|
|
211
|
-
waitpid(p, &wstatus, 0);
|
|
212
|
-
if (WEXITSTATUS(wstatus) != 0) {
|
|
213
|
-
fprintf(stderr, "child failed\n");
|
|
214
|
-
goto errcleanup;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (wait_cqe(&shmem->ring, "p cqe 1"))
|
|
218
|
-
goto errcleanup;
|
|
219
|
-
|
|
220
|
-
if (wait_cqe(&shmem->ring, "p cqe 2"))
|
|
221
|
-
goto errcleanup;
|
|
222
|
-
|
|
223
|
-
/* check that IO can still be submitted after child exited */
|
|
224
|
-
if (submit_write(&shmem->ring, shared_fd, "parent: write shared fd after child exit\n", 0))
|
|
225
|
-
goto errcleanup;
|
|
226
|
-
|
|
227
|
-
if (wait_cqe(&shmem->ring, "p cqe 3"))
|
|
228
|
-
goto errcleanup;
|
|
229
|
-
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
case 0: {
|
|
233
|
-
/* child */
|
|
234
|
-
int child_fd;
|
|
235
|
-
|
|
236
|
-
/* wait till fork is started up */
|
|
237
|
-
pthread_barrier_wait(&shmem->barrier);
|
|
238
|
-
|
|
239
|
-
child_fd = open_tempfile(tmpdir, "child");
|
|
240
|
-
|
|
241
|
-
if (wait_cqe(&shmem->ring, "c cqe shared"))
|
|
242
|
-
exit(1);
|
|
243
|
-
|
|
244
|
-
if (wait_cqe(&shmem->ring, "c cqe parent 1"))
|
|
245
|
-
exit(1);
|
|
246
|
-
|
|
247
|
-
if (wait_cqe(&shmem->ring, "c cqe parent 2"))
|
|
248
|
-
exit(1);
|
|
249
|
-
|
|
250
|
-
if (wait_cqe(&shmem->ring, "c cqe parent 3"))
|
|
251
|
-
exit(1);
|
|
252
|
-
|
|
253
|
-
/* wait to switch read/writ roles with parent */
|
|
254
|
-
pthread_barrier_wait(&shmem->barrier);
|
|
255
|
-
|
|
256
|
-
if (submit_write(&shmem->ring, child_fd, "child: write child fd\n", 0))
|
|
257
|
-
exit(1);
|
|
258
|
-
|
|
259
|
-
/* ensure both writes have finished before child exits */
|
|
260
|
-
if (submit_write(&shmem->ring, shared_fd, "child: write shared fd\n", 2))
|
|
261
|
-
exit(1);
|
|
262
|
-
|
|
263
|
-
exit(0);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
if (verify_file(tmpdir, "shared",
|
|
268
|
-
"before fork: write shared fd\n"
|
|
269
|
-
"parent: write shared fd\n"
|
|
270
|
-
"child: write shared fd\n"
|
|
271
|
-
"parent: write shared fd after child exit\n") ||
|
|
272
|
-
verify_file(tmpdir, "parent1", "parent: write parent fd 1\n") ||
|
|
273
|
-
verify_file(tmpdir, "parent2", "parent: write parent fd 2\n") ||
|
|
274
|
-
verify_file(tmpdir, "child", "child: write child fd\n"))
|
|
275
|
-
goto errcleanup;
|
|
276
|
-
|
|
277
|
-
cleanup(tmpdir);
|
|
278
|
-
exit(0);
|
|
279
|
-
|
|
280
|
-
errcleanup:
|
|
281
|
-
cleanup(tmpdir);
|
|
282
|
-
exit(1);
|
|
283
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/* SPDX-License-Identifier: MIT */
|
|
2
|
-
// autogenerated by syzkaller (https://github.com/google/syzkaller)
|
|
3
|
-
|
|
4
|
-
#include <endian.h>
|
|
5
|
-
#include <stdint.h>
|
|
6
|
-
#include <stdio.h>
|
|
7
|
-
#include <stdlib.h>
|
|
8
|
-
#include <string.h>
|
|
9
|
-
#include <sys/types.h>
|
|
10
|
-
#include <sys/mman.h>
|
|
11
|
-
#include <unistd.h>
|
|
12
|
-
|
|
13
|
-
#include "liburing.h"
|
|
14
|
-
#include "../src/syscall.h"
|
|
15
|
-
|
|
16
|
-
int main(int argc, char *argv[])
|
|
17
|
-
{
|
|
18
|
-
if (argc > 1)
|
|
19
|
-
return 0;
|
|
20
|
-
|
|
21
|
-
mmap((void *) 0x20000000, 0x1000000, 3, 0x32, -1, 0);
|
|
22
|
-
|
|
23
|
-
*(uint32_t*)0x20000200 = 0;
|
|
24
|
-
*(uint32_t*)0x20000204 = 0;
|
|
25
|
-
*(uint32_t*)0x20000208 = 5;
|
|
26
|
-
*(uint32_t*)0x2000020c = 0x400;
|
|
27
|
-
*(uint32_t*)0x20000210 = 0;
|
|
28
|
-
*(uint32_t*)0x20000214 = 0;
|
|
29
|
-
*(uint32_t*)0x20000218 = 0;
|
|
30
|
-
*(uint32_t*)0x2000021c = 0;
|
|
31
|
-
*(uint32_t*)0x20000220 = 0;
|
|
32
|
-
*(uint32_t*)0x20000224 = 0;
|
|
33
|
-
*(uint32_t*)0x20000228 = 0;
|
|
34
|
-
*(uint32_t*)0x2000022c = 0;
|
|
35
|
-
*(uint32_t*)0x20000230 = 0;
|
|
36
|
-
*(uint32_t*)0x20000234 = 0;
|
|
37
|
-
*(uint32_t*)0x20000238 = 0;
|
|
38
|
-
*(uint32_t*)0x2000023c = 0;
|
|
39
|
-
*(uint32_t*)0x20000240 = 0;
|
|
40
|
-
*(uint32_t*)0x20000244 = 0;
|
|
41
|
-
*(uint64_t*)0x20000248 = 0;
|
|
42
|
-
*(uint32_t*)0x20000250 = 0;
|
|
43
|
-
*(uint32_t*)0x20000254 = 0;
|
|
44
|
-
*(uint32_t*)0x20000258 = 0;
|
|
45
|
-
*(uint32_t*)0x2000025c = 0;
|
|
46
|
-
*(uint32_t*)0x20000260 = 0;
|
|
47
|
-
*(uint32_t*)0x20000264 = 0;
|
|
48
|
-
*(uint32_t*)0x20000268 = 0;
|
|
49
|
-
*(uint32_t*)0x2000026c = 0;
|
|
50
|
-
*(uint64_t*)0x20000270 = 0;
|
|
51
|
-
__sys_io_uring_setup(0xc9f, (struct io_uring_params *) 0x20000200);
|
|
52
|
-
return 0;
|
|
53
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/* SPDX-License-Identifier: MIT */
|
|
2
|
-
/*
|
|
3
|
-
* Description: Check to see if wait_nr is being honored.
|
|
4
|
-
*/
|
|
5
|
-
#include <stdio.h>
|
|
6
|
-
#include "liburing.h"
|
|
7
|
-
|
|
8
|
-
int main(int argc, char *argv[])
|
|
9
|
-
{
|
|
10
|
-
struct io_uring_sqe *sqe;
|
|
11
|
-
struct io_uring_cqe *cqe;
|
|
12
|
-
struct io_uring ring;
|
|
13
|
-
int ret;
|
|
14
|
-
struct __kernel_timespec ts = {
|
|
15
|
-
.tv_sec = 0,
|
|
16
|
-
.tv_nsec = 10000000
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
if (argc > 1)
|
|
20
|
-
return 0;
|
|
21
|
-
|
|
22
|
-
if (io_uring_queue_init(4, &ring, 0) != 0) {
|
|
23
|
-
fprintf(stderr, "ring setup failed\n");
|
|
24
|
-
return 1;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/*
|
|
28
|
-
* First, submit the timeout sqe so we can actually finish the test
|
|
29
|
-
* if everything is in working order.
|
|
30
|
-
*/
|
|
31
|
-
sqe = io_uring_get_sqe(&ring);
|
|
32
|
-
if (!sqe) {
|
|
33
|
-
fprintf(stderr, "get sqe failed\n");
|
|
34
|
-
return 1;
|
|
35
|
-
}
|
|
36
|
-
io_uring_prep_timeout(sqe, &ts, (unsigned)-1, 0);
|
|
37
|
-
|
|
38
|
-
ret = io_uring_submit(&ring);
|
|
39
|
-
if (ret != 1) {
|
|
40
|
-
fprintf(stderr, "Got submit %d, expected 1\n", ret);
|
|
41
|
-
return 1;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/*
|
|
45
|
-
* Next, submit a nop and wait for two events. If everything is working
|
|
46
|
-
* as it should, we should be waiting for more than a millisecond and we
|
|
47
|
-
* should see two cqes. Otherwise, execution continues immediately
|
|
48
|
-
* and we see only one cqe.
|
|
49
|
-
*/
|
|
50
|
-
sqe = io_uring_get_sqe(&ring);
|
|
51
|
-
if (!sqe) {
|
|
52
|
-
fprintf(stderr, "get sqe failed\n");
|
|
53
|
-
return 1;
|
|
54
|
-
}
|
|
55
|
-
io_uring_prep_nop(sqe);
|
|
56
|
-
|
|
57
|
-
ret = io_uring_submit_and_wait(&ring, 2);
|
|
58
|
-
if (ret != 1) {
|
|
59
|
-
fprintf(stderr, "Got submit %d, expected 1\n", ret);
|
|
60
|
-
return 1;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (io_uring_peek_cqe(&ring, &cqe) != 0) {
|
|
64
|
-
fprintf(stderr, "Unable to peek cqe!\n");
|
|
65
|
-
return 1;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
io_uring_cqe_seen(&ring, cqe);
|
|
69
|
-
|
|
70
|
-
if (io_uring_peek_cqe(&ring, &cqe) != 0) {
|
|
71
|
-
fprintf(stderr, "Unable to peek cqe!\n");
|
|
72
|
-
return 1;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
io_uring_queue_exit(&ring);
|
|
76
|
-
return 0;
|
|
77
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Test 5.7 regression with task_work not being run while a task is
|
|
3
|
-
* waiting on another event in the kernel.
|
|
4
|
-
*/
|
|
5
|
-
#include <errno.h>
|
|
6
|
-
#include <poll.h>
|
|
7
|
-
#include <stdio.h>
|
|
8
|
-
#include <stdlib.h>
|
|
9
|
-
#include <sys/eventfd.h>
|
|
10
|
-
#include <unistd.h>
|
|
11
|
-
#include <pthread.h>
|
|
12
|
-
#include "liburing.h"
|
|
13
|
-
#include "helpers.h"
|
|
14
|
-
|
|
15
|
-
static int use_sqpoll = 0;
|
|
16
|
-
|
|
17
|
-
void notify_fd(int fd)
|
|
18
|
-
{
|
|
19
|
-
char buf[8] = {0, 0, 0, 0, 0, 0, 1};
|
|
20
|
-
int ret;
|
|
21
|
-
|
|
22
|
-
ret = write(fd, &buf, 8);
|
|
23
|
-
if (ret < 0)
|
|
24
|
-
perror("write");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
void *delay_set_fd_from_thread(void *data)
|
|
28
|
-
{
|
|
29
|
-
int fd = (intptr_t) data;
|
|
30
|
-
|
|
31
|
-
sleep(1);
|
|
32
|
-
notify_fd(fd);
|
|
33
|
-
return NULL;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
int main(int argc, char *argv[])
|
|
37
|
-
{
|
|
38
|
-
struct io_uring_params p = {};
|
|
39
|
-
struct io_uring ring;
|
|
40
|
-
int loop_fd, other_fd;
|
|
41
|
-
struct io_uring_sqe *sqe;
|
|
42
|
-
struct io_uring_cqe *cqe = NULL;
|
|
43
|
-
int ret, use_fd;
|
|
44
|
-
char buf[8] = {0, 0, 0, 0, 0, 0, 1};
|
|
45
|
-
pthread_t tid;
|
|
46
|
-
|
|
47
|
-
if (argc > 1)
|
|
48
|
-
return 0;
|
|
49
|
-
|
|
50
|
-
/* Create an eventfd to be registered with the loop to be
|
|
51
|
-
* notified of events being ready
|
|
52
|
-
*/
|
|
53
|
-
loop_fd = eventfd(0, EFD_CLOEXEC);
|
|
54
|
-
if (loop_fd == -1) {
|
|
55
|
-
fprintf(stderr, "eventfd errno=%d\n", errno);
|
|
56
|
-
return 1;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Create an eventfd that can create events */
|
|
60
|
-
use_fd = other_fd = eventfd(0, EFD_CLOEXEC);
|
|
61
|
-
if (other_fd == -1) {
|
|
62
|
-
fprintf(stderr, "eventfd errno=%d\n", errno);
|
|
63
|
-
return 1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (use_sqpoll)
|
|
67
|
-
p.flags = IORING_SETUP_SQPOLL;
|
|
68
|
-
|
|
69
|
-
/* Setup the ring with a registered event fd to be notified on events */
|
|
70
|
-
ret = t_create_ring_params(8, &ring, &p);
|
|
71
|
-
if (ret == T_SETUP_SKIP)
|
|
72
|
-
return 0;
|
|
73
|
-
else if (ret < 0)
|
|
74
|
-
return ret;
|
|
75
|
-
|
|
76
|
-
ret = io_uring_register_eventfd(&ring, loop_fd);
|
|
77
|
-
if (ret < 0) {
|
|
78
|
-
fprintf(stderr, "register_eventfd=%d\n", ret);
|
|
79
|
-
return 1;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (use_sqpoll) {
|
|
83
|
-
ret = io_uring_register_files(&ring, &other_fd, 1);
|
|
84
|
-
if (ret < 0) {
|
|
85
|
-
fprintf(stderr, "register_files=%d\n", ret);
|
|
86
|
-
return 1;
|
|
87
|
-
}
|
|
88
|
-
use_fd = 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* Submit a poll operation to wait on an event in other_fd */
|
|
92
|
-
sqe = io_uring_get_sqe(&ring);
|
|
93
|
-
io_uring_prep_poll_add(sqe, use_fd, POLLIN);
|
|
94
|
-
sqe->user_data = 1;
|
|
95
|
-
if (use_sqpoll)
|
|
96
|
-
sqe->flags |= IOSQE_FIXED_FILE;
|
|
97
|
-
ret = io_uring_submit(&ring);
|
|
98
|
-
if (ret != 1) {
|
|
99
|
-
fprintf(stderr, "submit=%d\n", ret);
|
|
100
|
-
return 1;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/*
|
|
104
|
-
* CASE 3: Hangs forever in Linux 5.7.5; Works in Linux 5.6.0 When this
|
|
105
|
-
* code is uncommented, we don't se a notification on other_fd until
|
|
106
|
-
* _after_ we have started the read on loop_fd. In that case, the read() on
|
|
107
|
-
* loop_fd seems to hang forever.
|
|
108
|
-
*/
|
|
109
|
-
pthread_create(&tid, NULL, delay_set_fd_from_thread,
|
|
110
|
-
(void*) (intptr_t) other_fd);
|
|
111
|
-
|
|
112
|
-
/* Wait on the event fd for an event to be ready */
|
|
113
|
-
ret = read(loop_fd, buf, 8);
|
|
114
|
-
if (ret < 0) {
|
|
115
|
-
perror("read");
|
|
116
|
-
return 1;
|
|
117
|
-
} else if (ret != 8) {
|
|
118
|
-
fprintf(stderr, "Odd-sized eventfd read: %d\n", ret);
|
|
119
|
-
return 1;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
ret = io_uring_wait_cqe(&ring, &cqe);
|
|
124
|
-
if (ret) {
|
|
125
|
-
fprintf(stderr, "wait_cqe=%d\n", ret);
|
|
126
|
-
return ret;
|
|
127
|
-
}
|
|
128
|
-
if (cqe->res < 0) {
|
|
129
|
-
fprintf(stderr, "cqe->res=%d\n", cqe->res);
|
|
130
|
-
return 1;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
io_uring_cqe_seen(&ring, cqe);
|
|
134
|
-
return 0;
|
|
135
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
|
|
3
|
-
#define _GNU_SOURCE 1
|
|
4
|
-
#define _FILE_OFFSET_BITS 64
|
|
5
|
-
|
|
6
|
-
// Test program for io_uring IORING_OP_CLOSE with O_PATH file.
|
|
7
|
-
// Author: Clayton Harris <bugs@claycon.org>, 2020-06-07
|
|
8
|
-
|
|
9
|
-
// linux 5.6.14-300.fc32.x86_64
|
|
10
|
-
// gcc 10.1.1-1.fc32
|
|
11
|
-
// liburing.x86_64 0.5-1.fc32
|
|
12
|
-
|
|
13
|
-
// gcc -O2 -Wall -Wextra -std=c11 -o close_opath close_opath.c -luring
|
|
14
|
-
// ./close_opath testfilepath
|
|
15
|
-
|
|
16
|
-
#include <errno.h>
|
|
17
|
-
#include <fcntl.h>
|
|
18
|
-
#include <liburing.h>
|
|
19
|
-
#include <sys/stat.h>
|
|
20
|
-
#include <stdio.h>
|
|
21
|
-
#include <string.h>
|
|
22
|
-
#include <unistd.h>
|
|
23
|
-
|
|
24
|
-
typedef struct
|
|
25
|
-
{
|
|
26
|
-
const char *const flnames;
|
|
27
|
-
const int oflags;
|
|
28
|
-
} oflgs_t;
|
|
29
|
-
|
|
30
|
-
static int test_io_uring_close(struct io_uring *ring, int fd)
|
|
31
|
-
{
|
|
32
|
-
struct io_uring_sqe *sqe;
|
|
33
|
-
struct io_uring_cqe *cqe;
|
|
34
|
-
int ret;
|
|
35
|
-
|
|
36
|
-
sqe = io_uring_get_sqe(ring);
|
|
37
|
-
if (!sqe) {
|
|
38
|
-
fprintf(stderr, "io_uring_get_sqe() failed\n");
|
|
39
|
-
return -ENOENT;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
io_uring_prep_close(sqe, fd);
|
|
43
|
-
|
|
44
|
-
ret = io_uring_submit(ring);
|
|
45
|
-
if (ret < 0) {
|
|
46
|
-
fprintf(stderr, "io_uring_submit() failed, errno %d: %s\n",
|
|
47
|
-
-ret, strerror(-ret));
|
|
48
|
-
return ret;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
ret = io_uring_wait_cqe(ring, &cqe);
|
|
52
|
-
if (ret < 0) {
|
|
53
|
-
fprintf(stderr, "io_uring_wait_cqe() failed, errno %d: %s\n",
|
|
54
|
-
-ret, strerror(-ret));
|
|
55
|
-
return ret;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
ret = cqe->res;
|
|
59
|
-
io_uring_cqe_seen(ring, cqe);
|
|
60
|
-
|
|
61
|
-
if (ret < 0 && ret != -EOPNOTSUPP && ret != -EINVAL && ret != -EBADF) {
|
|
62
|
-
fprintf(stderr, "io_uring close() failed, errno %d: %s\n",
|
|
63
|
-
-ret, strerror(-ret));
|
|
64
|
-
return ret;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return 0;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
static int open_file(const char *path, const oflgs_t *oflgs)
|
|
71
|
-
{
|
|
72
|
-
int fd;
|
|
73
|
-
|
|
74
|
-
fd = openat(AT_FDCWD, path, oflgs->oflags, 0);
|
|
75
|
-
if (fd < 0) {
|
|
76
|
-
int err = errno;
|
|
77
|
-
fprintf(stderr, "openat(%s, %s) failed, errno %d: %s\n",
|
|
78
|
-
path, oflgs->flnames, err, strerror(err));
|
|
79
|
-
return -err;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return fd;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
int main(int argc, char *argv[])
|
|
86
|
-
{
|
|
87
|
-
const char *fname = ".";
|
|
88
|
-
struct io_uring ring;
|
|
89
|
-
int ret, i;
|
|
90
|
-
static const oflgs_t oflgs[] = {
|
|
91
|
-
{ "O_RDONLY", O_RDONLY },
|
|
92
|
-
{ "O_PATH", O_PATH }
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
ret = io_uring_queue_init(2, &ring, 0);
|
|
96
|
-
if (ret < 0) {
|
|
97
|
-
fprintf(stderr, "io_uring_queue_init() failed, errno %d: %s\n",
|
|
98
|
-
-ret, strerror(-ret));
|
|
99
|
-
return 0x02;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
#define OFLGS_SIZE (sizeof(oflgs) / sizeof(oflgs[0]))
|
|
103
|
-
|
|
104
|
-
ret = 0;
|
|
105
|
-
for (i = 0; i < OFLGS_SIZE; i++) {
|
|
106
|
-
int fd;
|
|
107
|
-
|
|
108
|
-
fd = open_file(fname, &oflgs[i]);
|
|
109
|
-
if (fd < 0) {
|
|
110
|
-
ret |= 0x02;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/* Should always succeed */
|
|
115
|
-
if (test_io_uring_close(&ring, fd) < 0)
|
|
116
|
-
ret |= 0x04 << i;
|
|
117
|
-
}
|
|
118
|
-
#undef OFLGS_SIZE
|
|
119
|
-
|
|
120
|
-
io_uring_queue_exit(&ring);
|
|
121
|
-
return ret;
|
|
122
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Copy this to config.local, uncomment and define values
|
|
2
|
-
#
|
|
3
|
-
# Define tests to exclude from running
|
|
4
|
-
# TEST_EXCLUDE=""
|
|
5
|
-
#
|
|
6
|
-
# Define raw test devices (or files) for test cases, if any
|
|
7
|
-
# declare -A TEST_MAP=()
|
|
8
|
-
#
|
|
9
|
-
# If no TEST_MAP entry exists for a test, use the ones given in TEST_FILES
|
|
10
|
-
# TEST_FILES="/dev/somedevice /data/somefile"
|