| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| declare_args() { |
| # Set this to true when configuring gn args to enable minfs dirty cache. |
| # This is a compile time argument instead of mount time argument because |
| # we conditionally want to enable dirty cache only on specific |
| # configurations. Once it is enabled, we want the board to run all instances |
| # of minfs, including # data and all minfs created to run test, should enable |
| # dirty cache. This ensures that we run what we test. |
| minfs_enable_dirty_cache = false |
| } |
| |
| static_library("minfs") { |
| friend = [ |
| "test:*", |
| "allocator/test:*", |
| "//src/storage/conformance/conformance_harness/minfs:bin", |
| ] |
| visibility = [ |
| "//src/devices/block/bin/disk-inspect", |
| "//src/storage/*", |
| "//zircon/system/utest/fvm", |
| "//zircon/system/utest/minfs-micro-benchmark", |
| "//zircon/tools/minfs", |
| ] |
| public = [ |
| "bcache.h", |
| "format.h", |
| "fsck.h", |
| "metrics.h", |
| "minfs.h", |
| "transaction_limits.h", |
| ] |
| sources = [ |
| "allocator/allocator.h", |
| "allocator/allocator_common.cc", |
| "allocator/allocator_reservation.cc", |
| "allocator/inode_manager.h", |
| "allocator/metadata.cc", |
| "allocator/metadata.h", |
| "allocator/storage.h", |
| "allocator/storage_common.cc", |
| "allocator_reservation.h", |
| "block_utils.h", |
| "buffer_view.cc", |
| "buffer_view.h", |
| "directory.cc", |
| "directory.h", |
| "file.cc", |
| "file.h", |
| "fsck.cc", |
| "inspector.h", |
| "inspector/disk_struct.h", |
| "inspector/loader.h", |
| "inspector/parser.h", |
| "inspector_inode.h", |
| "inspector_inode_table.h", |
| "inspector_private.h", |
| "inspector_superblock.h", |
| "lazy_buffer.cc", |
| "lazy_buffer.h", |
| "lazy_reader.cc", |
| "lazy_reader.h", |
| "metrics.cc", |
| "metrics.h", |
| "minfs.cc", |
| "minfs_private.h", |
| "pending_work.h", |
| "resizeable_array_buffer.cc", |
| "resizeable_array_buffer.h", |
| "resizeable_buffer.h", |
| "resizeable_vmo_buffer.h", |
| "superblock.h", |
| "transaction_limits.cc", |
| "unowned_vmo_buffer.h", |
| "vnode.cc", |
| "vnode.h", |
| "vnode_allocation.h", |
| "vnode_mapper.cc", |
| "vnode_mapper.h", |
| "writeback.cc", |
| "writeback.h", |
| ] |
| public_deps = [ |
| "//src/lib/storage/vfs/cpp/transaction", |
| "//zircon/public/lib/fbl", |
| "//zircon/system/ulib/storage/buffer", |
| ] |
| deps = [ |
| "//sdk/lib/fit", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/storage/vfs/cpp", |
| "//src/storage/fvm", |
| "//src/storage/lib/disk_inspector", |
| "//zircon/public/lib/safemath", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxc", |
| "//zircon/system/ulib/bitmap", |
| "//zircon/system/ulib/range", |
| "//zircon/system/ulib/storage/operation", |
| "//zircon/third_party/ulib/cksum", |
| ] |
| if (is_fuchsia) { |
| if (minfs_enable_dirty_cache) { |
| defines = [ |
| # Enable dirty cache only when we are running on fuchsia and gn config |
| # asks us to enable it. |
| "MINFS_ENABLE_DIRTY_CACHE", |
| ] |
| } |
| |
| public += [ |
| "command_handler.h", |
| "minfs_inspector.h", |
| ] |
| sources += [ |
| "allocator/allocator.cc", |
| "allocator/inode_manager.cc", |
| "allocator/storage.cc", |
| "bcache.cc", |
| "file_target.cc", |
| "inspector.cc", |
| "inspector/command_handler.cc", |
| "inspector/disk_struct.cc", |
| "inspector/loader.cc", |
| "inspector/minfs_inspector.cc", |
| "inspector/parser.cc", |
| "inspector_inode.cc", |
| "inspector_inode_table.cc", |
| "inspector_superblock.cc", |
| "minfs_target.cc", |
| "resizeable_vmo_buffer.cc", |
| "superblock.cc", |
| "vnode_allocation.cc", |
| ] |
| public_deps += [ |
| # bcache.h includes fuchsia/hardware/block/c/fidl.h. |
| "//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block_c", |
| |
| # minfs.h includes src/lib/cobalt/cpp/cobalt_logger.h |
| "//src/lib/cobalt/cpp:cobalt_logger", |
| |
| # fsck.h includes block-client/cpp/block-device.h |
| "//zircon/system/ulib/block-client", |
| |
| # minfs_inspector.h includes journal/format.h |
| "//src/lib/storage/vfs/cpp/journal", |
| ] |
| deps += [ |
| "//sdk/fidl/fuchsia.device:fuchsia.device_c", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_llcpp", |
| "//sdk/fidl/fuchsia.hardware.block.volume:fuchsia.hardware.block.volume_c", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| "//sdk/fidl/fuchsia.minfs:fuchsia.minfs_llcpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/storage/vfs/cpp/metrics:metrics-cobalt", |
| "//src/storage/fvm", |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fdio-caller", |
| "//zircon/system/ulib/fidl-utils", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/storage-metrics", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/trace-engine", |
| ] |
| } else { |
| public += [ "host.h" ] |
| sources += [ |
| "allocator/allocator_host.cc", |
| "allocator/inode_manager_host.cc", |
| "allocator/storage_host.cc", |
| "bcache_host.cc", |
| "file_host.cc", |
| "host.cc", |
| "minfs_host.cc", |
| "superblock_host.cc", |
| ] |
| deps += [ |
| "//src/lib/storage/vfs/cpp/journal", |
| "//src/zircon/lib/zircon:zircon-headers", |
| ] |
| } |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| "allocator/test:minfs-allocator-tests", |
| "test:minfs-fuzzers", |
| "test:minfs-tests", |
| "test/host:minfs_host($host_toolchain)", |
| "//src/storage/testing:storage-isolated-devmgr", |
| ] |
| } |