diff --git a/CMakeLists.txt b/CMakeLists.txt index 71c12c11..851824d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -629,11 +629,11 @@ list(APPEND LIBDWARFS_COMMON_SRC ) list(APPEND LIBDWARFS_READER_SRC - src/dwarfs/block_cache.cpp src/dwarfs/block_range.cpp src/dwarfs/cached_block.cpp src/dwarfs/filesystem_v2.cpp src/dwarfs/fs_section.cpp + src/dwarfs/internal/block_cache.cpp src/dwarfs/internal/inode_reader_v2.cpp src/dwarfs/internal/metadata_v2.cpp src/dwarfs/internal/metadata_types.cpp diff --git a/include/dwarfs/block_cache.h b/include/dwarfs/internal/block_cache.h similarity index 98% rename from include/dwarfs/block_cache.h rename to include/dwarfs/internal/block_cache.h index 975a2bf2..1836c18f 100644 --- a/include/dwarfs/block_cache.h +++ b/include/dwarfs/internal/block_cache.h @@ -42,6 +42,8 @@ class mmif; class os_access; class performance_monitor; +namespace internal { + class block_cache { public: block_cache(logger& lgr, os_access const& os, std::shared_ptr mm, @@ -81,4 +83,6 @@ class block_cache { private: std::unique_ptr impl_; }; + +} // namespace internal } // namespace dwarfs diff --git a/src/dwarfs/filesystem_v2.cpp b/src/dwarfs/filesystem_v2.cpp index fe4ac11a..abe52c92 100644 --- a/src/dwarfs/filesystem_v2.cpp +++ b/src/dwarfs/filesystem_v2.cpp @@ -32,7 +32,6 @@ #include -#include #include #include #include @@ -43,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -610,7 +610,7 @@ filesystem_::filesystem_( PERFMON_CLS_TIMER_INIT(readv_future) PERFMON_CLS_TIMER_INIT(readv_future_throw) // clang-format on { - block_cache cache(lgr, os_, mm_, options.block_cache, perfmon); + internal::block_cache cache(lgr, os_, mm_, options.block_cache, perfmon); filesystem_parser parser(mm_, image_offset_); if (parser.has_index()) { diff --git a/src/dwarfs/block_cache.cpp b/src/dwarfs/internal/block_cache.cpp similarity index 99% rename from src/dwarfs/block_cache.cpp rename to src/dwarfs/internal/block_cache.cpp index 90f177c6..941ed58a 100644 --- a/src/dwarfs/block_cache.cpp +++ b/src/dwarfs/internal/block_cache.cpp @@ -42,9 +42,9 @@ #include #include -#include #include #include +#include #include #include #include @@ -52,7 +52,9 @@ #include #include -namespace dwarfs { +namespace dwarfs::internal { + +namespace { class sequential_access_detector { public: @@ -791,6 +793,8 @@ class block_cache_ final : public block_cache::impl { cache_tidy_config tidy_config_; }; +} // namespace + block_cache::block_cache(logger& lgr, os_access const& os, std::shared_ptr mm, const block_cache_options& options, @@ -798,4 +802,4 @@ block_cache::block_cache(logger& lgr, os_access const& os, : impl_(make_unique_logging_object( lgr, os, std::move(mm), options, std::move(perfmon))) {} -} // namespace dwarfs +} // namespace dwarfs::internal diff --git a/src/dwarfs/internal/inode_reader_v2.cpp b/src/dwarfs/internal/inode_reader_v2.cpp index 1285752d..91d5785a 100644 --- a/src/dwarfs/internal/inode_reader_v2.cpp +++ b/src/dwarfs/internal/inode_reader_v2.cpp @@ -32,8 +32,8 @@ #include #include -#include #include +#include #include #include #include