blob: 49cb84219af95ca5c115d90d3384ac1e306f11b4 [file] [log] [blame]
// Copyright 2020 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_VOLUME_IMAGE_FTL_FTL_IMAGE_H_
#define SRC_STORAGE_VOLUME_IMAGE_FTL_FTL_IMAGE_H_
#include <lib/fpromise/result.h>
#include <string>
#include "src/storage/volume_image/ftl/options.h"
#include "src/storage/volume_image/partition.h"
#include "src/storage/volume_image/utils/writer.h"
namespace storage::volume_image {
// Returns |fpromise::ok|, when the contents of |partition| have been written into |writer| as a
// |RawNandImage|.
//
// It is required for |writer| to manage gaps in unwritten parts. For example, a raw block image may
// choose to zero the contents of the unwritten parts, while a sparse format may just keep track of
// the ranges.
fpromise::result<void, std::string> FtlImageWrite(const RawNandOptions& options,
const Partition& partition, Writer* writer);
} // namespace storage::volume_image
#endif // SRC_STORAGE_VOLUME_IMAGE_FTL_FTL_IMAGE_H_