blob: ad4803085bb51ff66845a242c9f9a7090aa6627e [file] [log] [blame]
# 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.
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",
"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/system/ulib/fbl",
"//zircon/system/ulib/storage/buffer",
"//zircon/system/ulib/zxc",
]
deps = [
"//sdk/lib/fit",
"//sdk/lib/syslog/cpp",
"//src/lib/storage/vfs/cpp",
"//src/storage/fvm",
"//src/storage/lib/disk_inspector",
"//zircon/system/ulib/bitmap",
"//zircon/system/ulib/range",
"//zircon/system/ulib/storage/operation",
"//zircon/system/ulib/zircon-internal",
"//zircon/third_party/ulib/cksum",
"//zircon/third_party/ulib/safemath",
]
if (is_fuchsia) {
public += [
"command_handler.h",
"minfs_inspector.h",
]
sources += [
"admin_service.cc",
"admin_service.h",
"allocator/allocator.cc",
"allocator/inode_manager.cc",
"allocator/storage.cc",
"bcache.cc",
"file_target.cc",
"inspector.cc",
"inspector.h",
"inspector/command_handler.cc",
"inspector/disk_struct.cc",
"inspector/disk_struct.h",
"inspector/loader.cc",
"inspector/loader.h",
"inspector/minfs_inspector.cc",
"inspector/parser.cc",
"inspector/parser.h",
"inspector_inode.cc",
"inspector_inode.h",
"inspector_inode_table.cc",
"inspector_inode_table.h",
"inspector_private.h",
"inspector_superblock.cc",
"inspector_superblock.h",
"minfs_inspect_tree.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
"//src/lib/storage/block_client/cpp",
# minfs_inspect_tree.h uses the VFS Inspect library
"//src/lib/storage/vfs/cpp/inspect",
# minfs_inspector.h includes journal/format.h
"//src/lib/storage/vfs/cpp/journal",
# Used by the MinfsInspectTree class
"//zircon/system/ulib/zx",
]
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/system/ulib/async",
"//zircon/system/ulib/async:async-cpp",
"//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",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/storage-metrics",
"//zircon/system/ulib/sync",
"//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-fs-tests",
"test:minfs-fuzzers",
"test:minfs-slow-fs-tests",
"test/host:minfs_host($host_toolchain)",
]
}