blob: 3f35dc31cc63e14008ff67585c624f6baa8c4d39 [file] [log] [blame]
// 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 as metrics;
// Describes metrics about the running Minfs instance.
struct Metrics {
metrics.FsMetrics fs_metrics;
// Minfs initializes entire VMOs at once.
// The following fields track this information.
uint64 initialized_vmos;
uint32 init_dnum_count; // Top-level direct blocks only
uint32 init_inum_count; // Top-level indirect blocks only
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;
};
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;
};
// Describes a contiguous run of allocated blocks.
struct BlockRegion {
uint64 offset;
uint64 length;
};
[Layout = "Simple"]
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, handle<vmo>? regions, uint64 count);
// Get mount state.
GetMountState() -> (zx.status status, MountState? mount_state);
};