blob: b82cddc644b4cd1c723b70376191248ddbda112e [file] [log] [blame]
// Copyright 2022 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.fs.realm;
using zx;
using fuchsia.device;
using fuchsia.io;
type MountOptions = resource table {
1: read_only bool;
2: verbose bool;
3: write_compression_algorithm string:32;
};
type FormatOptions = resource table {
1: verbose bool;
2: fvm_data_slices uint32;
};
@discoverable
closed protocol Controller {
/// Mounts a filesystem on a block device.
strict Mount(resource struct {
device client_end:fuchsia.device.Controller;
name string:fuchsia.io.MAX_FILENAME;
options MountOptions;
}) -> () error zx.Status;
/// Unmounts a previously mounted filesystem.
strict Unmount(struct {
name string:fuchsia.io.MAX_FILENAME;
}) -> () error zx.Status;
/// Formats a block device with a particular filesystem format
strict Format(resource struct {
device client_end:fuchsia.device.Controller;
name string:fuchsia.io.MAX_FILENAME;
options FormatOptions;
}) -> () error zx.Status;
/// Checks the consistency of the filesystem formatted on
/// the block device
strict Check(resource struct {
device client_end:fuchsia.device.Controller;
name string:fuchsia.io.MAX_FILENAME;
}) -> () error zx.Status;
};