1/**
2 * \file
3 * \brief block_server client process.
4 */
5
6/*
7 * Copyright (c) 2007, 2008, 2009, 2010, ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
13 */
14
15#ifndef BLOCK_STORAGE_H
16#define BLOCK_STORAGE_H
17
18
19
20struct bs_block
21{
22    size_t id;
23    size_t size;
24    void *data;
25};
26
27struct block_storage
28{
29    uint8_t ready;
30    size_t num_blocks;
31    size_t block_size;
32    struct bs_block *blocks;
33};
34
35size_t block_storage_get_block_size(void);
36
37errval_t block_storage_init(size_t num_blocks, size_t block_size);
38
39errval_t block_storage_dealloc(void);
40
41errval_t block_storage_read(size_t bid, void *dst);
42
43errval_t block_storage_write(size_t bid, void *src);
44
45#endif /* BLOCK_STORAGE_H */
46