Rev 4553 | Rev 4583 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4553 | Rev 4572 | ||
---|---|---|---|
Line 82... | Line 82... | ||
82 | link_t hash_link; |
82 | link_t hash_link; |
83 | /** Buffer with the block data. */ |
83 | /** Buffer with the block data. */ |
84 | void *data; |
84 | void *data; |
85 | } block_t; |
85 | } block_t; |
86 | 86 | ||
- | 87 | /** Caching mode */ |
|
- | 88 | enum cache_mode { |
|
- | 89 | /** Write-Through */ |
|
- | 90 | CACHE_MODE_WT, |
|
- | 91 | /** Write-Back */ |
|
- | 92 | CACHE_MODE_WB |
|
- | 93 | }; |
|
- | 94 | ||
87 | extern int block_init(dev_handle_t, size_t); |
95 | extern int block_init(dev_handle_t, size_t); |
88 | extern void block_fini(dev_handle_t); |
96 | extern void block_fini(dev_handle_t); |
89 | 97 | ||
90 | extern int block_bb_read(dev_handle_t, off_t, size_t); |
98 | extern int block_bb_read(dev_handle_t, off_t, size_t); |
91 | extern void *block_bb_get(dev_handle_t); |
99 | extern void *block_bb_get(dev_handle_t); |
92 | 100 | ||
93 | extern int block_cache_init(dev_handle_t, size_t, unsigned); |
101 | extern int block_cache_init(dev_handle_t, size_t, unsigned, enum cache_mode); |
94 | 102 | ||
95 | extern block_t *block_get(dev_handle_t, bn_t, int flags); |
103 | extern block_t *block_get(dev_handle_t, bn_t, int flags); |
96 | extern void block_put(block_t *); |
104 | extern void block_put(block_t *); |
97 | 105 | ||
98 | extern int block_read(dev_handle_t, off_t *, size_t *, off_t *, void *, size_t, |
106 | extern int block_read(dev_handle_t, off_t *, size_t *, off_t *, void *, size_t, |