| // Copyright 2018 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. |
| |
| library fuchsia.minfs; |
| |
| using zx; |
| using fuchsia.storage.metrics; |
| |
| /// Describes metrics about the running Minfs instance. |
| [ForDeprecatedCBindings] |
| struct Metrics { |
| fuchsia.storage.metrics.FsMetrics fs_metrics; |
| |
| /// Minfs initializes entire VMOs at once. |
| /// The following fields track this information. |
| uint64 initialized_vmos; |
| /// Top-level direct blocks only |
| uint32 init_dnum_count; |
| /// Top-level indirect blocks only |
| uint32 init_inum_count; |
| uint32 init_dinum_count; |
| uint64 init_user_data_size; |
| uint64 init_user_data_ticks; |
| |
| /// Minfs looks up Vnodes by ino internally (using "VnodeGet"). |
| /// The following fields track this information. |
| uint64 vnodes_opened_cache_hit; |
| |
| /// The number of bytes in dirty cache for which we have not issued writes yet. |
| /// The number is filesystem block aligned. |
| uint64 dirty_bytes; |
| }; |
| |
| struct MountState { |
| /// True if the fileystem is operational in readonly state. There may have been |
| /// writes during mount or during replaying journal. |
| bool readonly_after_initialization; |
| |
| /// True if the mounted filesystem is collecting metrics. |
| bool collect_metrics; |
| |
| /// True if the mounted filesystem is in verbose mode. |
| bool verbose; |
| |
| /// True if the journalled writes were allowed during mount. |
| bool repair_filesystem; |
| |
| /// True if the journaling is enabled. |
| bool use_journal; |
| |
| /// True is dirty cache is enabled for minfs. |
| bool dirty_cache_enabled; |
| }; |
| |
| /// Describes a contiguous run of allocated blocks. |
| [ForDeprecatedCBindings] |
| struct BlockRegion { |
| uint64 offset; |
| uint64 length; |
| }; |
| |
| [ForDeprecatedCBindings] |
| protocol Minfs { |
| /// Acquires metrics about the currently running filesystem. |
| GetMetrics() -> (zx.status status, Metrics? metrics); |
| |
| /// Toggle the metrics collection system on or off. |
| ToggleMetrics(bool enable) -> (zx.status status); |
| |
| /// Retrieve information about allocated regions on the filesystem. |
| GetAllocatedRegions() -> (zx.status status, zx.handle:VMO? regions, uint64 count); |
| |
| /// Get mount state. |
| GetMountState() -> (zx.status status, MountState? mount_state); |
| }; |