blob: c3e54dd5cff9b9ed4f4e2e4473034310aed5c400 [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.
#include <lib/zx/status.h>
#include <zircon/compiler.h>
#include <storage/buffer/array_buffer.h>
#include "src/lib/storage/vfs/cpp/transaction/transaction_handler.h"
namespace minfs {
class Bcache;
class ResizeableArrayBuffer : public storage::ArrayBuffer {
using Handle = void*;
explicit ResizeableArrayBuffer(uint32_t block_size) : ArrayBuffer(1, block_size) {}
explicit ResizeableArrayBuffer(size_t capacity, uint32_t block_size)
: ArrayBuffer(capacity, block_size) {}
// Avoid using this method unless *absolutely* necessary. Eventually, other interfaces that take
// different handle types should go away and this should no longer be required.
Handle GetHandle() { return Data(0); }
[[nodiscard]] zx::status<> Attach(const char* name, fs::TransactionHandler* device) {
return zx::ok();
zx::status<> Detach(fs::TransactionHandler* device) { return zx::ok(); }
[[nodiscard]] zx::status<> Shrink(size_t block_count);
[[nodiscard]] zx::status<> Grow(size_t block_count);
} // namespace minfs