| # 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:*", |
| ] |
| 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", |
| "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 = [ |
| "//zircon/public/lib/fbl", |
| |
| # bcache.h includes fs/transaction/device_transaction_handler.h & storage/buffer/... |
| "//zircon/system/ulib/fs/transaction", |
| "//zircon/system/ulib/storage/buffer", |
| ] |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/storage/fvm", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/safemath", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxc", |
| "//zircon/system/ulib/bitmap", |
| "//zircon/system/ulib/disk_inspector", |
| "//zircon/system/ulib/fs", |
| "//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 fuchis and gn config |
| # asks us to enable. |
| "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", |
| |
| # fsck.h includes block-client/cpp/block-device.h |
| "//zircon/system/ulib/block-client", |
| |
| # minfs_inspector.h includes fs/journal/format.h |
| "//zircon/system/ulib/fs/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/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/fs/metrics:metrics-cobalt", |
| "//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 += [ |
| "//zircon/system/ulib/fs/journal", |
| "//zircon/system/ulib/zircon:zircon-headers", |
| ] |
| } |
| configs += [ |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| "//build/config:Wno-conversion", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| "allocator/test:minfs-allocator-tests", |
| "test:minfs-fuzzers", |
| "test:minfs-tests", |
| "test/host:minfs_host($host_toolchain)", |
| "//src/lib/isolated_devmgr/v2_component", |
| ] |
| } |