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