OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 The Chromium OS Authors <chromium-os-dev@chromium.org> | 2 * Copyright (C) 2010 The Chromium OS Authors <chromium-os-dev@chromium.org> |
3 * | 3 * |
4 * Device-Mapper block hash tree interface. | 4 * Device-Mapper block hash tree interface. |
5 * See Documentation/device-mapper/dm-bht.txt for details. | 5 * See Documentation/device-mapper/dm-bht.txt for details. |
6 * | 6 * |
7 * This file is released under the GPLv2. | 7 * This file is released under the GPLv2. |
8 */ | 8 */ |
9 #ifndef __LINUX_DM_BHT_H | 9 #ifndef __LINUX_DM_BHT_H |
10 #define __LINUX_DM_BHT_H | 10 #define __LINUX_DM_BHT_H |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 /* Basic accessors for struct dm_bht */ | 122 /* Basic accessors for struct dm_bht */ |
123 sector_t dm_bht_sectors(const struct dm_bht *bht); | 123 sector_t dm_bht_sectors(const struct dm_bht *bht); |
124 void dm_bht_set_entry_readahead(struct dm_bht *bht, | 124 void dm_bht_set_entry_readahead(struct dm_bht *bht, |
125 unsigned int readahead_count); | 125 unsigned int readahead_count); |
126 void dm_bht_set_read_cb(struct dm_bht *bht, dm_bht_callback read_cb); | 126 void dm_bht_set_read_cb(struct dm_bht *bht, dm_bht_callback read_cb); |
127 void dm_bht_set_write_cb(struct dm_bht *bht, dm_bht_callback write_cb); | 127 void dm_bht_set_write_cb(struct dm_bht *bht, dm_bht_callback write_cb); |
128 int dm_bht_set_root_hexdigest(struct dm_bht *bht, const u8 *hexdigest); | 128 int dm_bht_set_root_hexdigest(struct dm_bht *bht, const u8 *hexdigest); |
129 int dm_bht_root_hexdigest(struct dm_bht *bht, u8 *hexdigest, int available); | 129 int dm_bht_root_hexdigest(struct dm_bht *bht, u8 *hexdigest, int available); |
130 | 130 |
131 /* Functions for loading in data from disk for verification */ | 131 /* Functions for loading in data from disk for verification */ |
| 132 bool dm_bht_is_populated(struct dm_bht *bht, unsigned int block_index); |
132 int dm_bht_populate(struct dm_bht *bht, void *read_cb_ctx, | 133 int dm_bht_populate(struct dm_bht *bht, void *read_cb_ctx, |
133 unsigned int block_index); | 134 unsigned int block_index); |
134 int dm_bht_verify_block(struct dm_bht *bht, unsigned int block_index, | 135 int dm_bht_verify_block(struct dm_bht *bht, unsigned int block_index, |
135 const void *block); | 136 const void *block); |
136 | 137 |
137 /* Functions for creating struct dm_bhts on disk. A newly created dm_bht | 138 /* Functions for creating struct dm_bhts on disk. A newly created dm_bht |
138 * should not be directly used for verification. (It should be repopulated.) | 139 * should not be directly used for verification. (It should be repopulated.) |
139 * In addition, these functions aren't meant to be called in parallel. | 140 * In addition, these functions aren't meant to be called in parallel. |
140 */ | 141 */ |
141 int dm_bht_compute(struct dm_bht *bht, void *read_cb_ctx); | 142 int dm_bht_compute(struct dm_bht *bht, void *read_cb_ctx); |
142 int dm_bht_sync(struct dm_bht *bht, void *write_cb_ctx); | 143 int dm_bht_sync(struct dm_bht *bht, void *write_cb_ctx); |
143 int dm_bht_store_block(struct dm_bht *bht, unsigned int block_index, | 144 int dm_bht_store_block(struct dm_bht *bht, unsigned int block_index, |
144 u8 *block_data); | 145 u8 *block_data); |
145 int dm_bht_zeroread_callback(void *ctx, sector_t start, u8 *dst, sector_t count, | 146 int dm_bht_zeroread_callback(void *ctx, sector_t start, u8 *dst, sector_t count, |
146 struct dm_bht_entry *entry); | 147 struct dm_bht_entry *entry); |
147 void dm_bht_read_completed(struct dm_bht_entry *entry, int status); | 148 void dm_bht_read_completed(struct dm_bht_entry *entry, int status); |
148 void dm_bht_write_completed(struct dm_bht_entry *entry, int status); | 149 void dm_bht_write_completed(struct dm_bht_entry *entry, int status); |
149 #endif /* __LINUX_DM_BHT_H */ | 150 #endif /* __LINUX_DM_BHT_H */ |
OLD | NEW |