blob: a1d837a6665953b82cf7db7c0f7f3a0215e10f8e [file] [log] [blame]
// Copyright 2016 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.
#ifndef SRC_STORAGE_MINFS_MINFS_H_
#define SRC_STORAGE_MINFS_MINFS_H_
#include <inttypes.h>
#include <lib/fit/function.h>
#include <lib/zx/result.h>
#include <functional>
#include <memory>
#include <utility>
#include "src/storage/minfs/bcache.h"
#include "src/storage/minfs/format.h"
#include "src/storage/minfs/mount.h"
namespace minfs {
// Controls the validation-checking performed by minfs when loading
// structures from disk.
enum class IntegrityCheck {
// Do not attempt to validate structures on load. This is useful
// for inspection tools, which do not depend on the correctness
// of on-disk structures.
kNone,
// Validate structures (locally) before usage. This is the
// recommended option for mounted filesystems.
kAll,
};
// Indicates whether to update backup superblock.
enum class UpdateBackupSuperblock {
// Do not write the backup superblock.
kNoUpdate,
// Update the backup superblock.
kUpdate,
};
// Format the partition backed by |bc| as MinFS.
zx::result<> Mkfs(const MountOptions& options, Bcache* bc);
// Format the partition backed by |bc| as MinFS.
inline zx::result<> Mkfs(Bcache* bc) { return Mkfs({}, bc); }
} // namespace minfs
#endif // SRC_STORAGE_MINFS_MINFS_H_