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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 atomic_t root_state; /* Uses UNALLOCATED, REQUESTED, and VERIFIED */ | 103 atomic_t root_state; /* Uses UNALLOCATED, REQUESTED, and VERIFIED */ |
104 struct dm_bht_level *levels; /* in reverse order */ | 104 struct dm_bht_level *levels; /* in reverse order */ |
105 mempool_t *entry_pool; | 105 mempool_t *entry_pool; |
106 /* Callbacks for reading and/or writing to the hash device */ | 106 /* Callbacks for reading and/or writing to the hash device */ |
107 dm_bht_callback read_cb; | 107 dm_bht_callback read_cb; |
108 dm_bht_callback write_cb; | 108 dm_bht_callback write_cb; |
109 }; | 109 }; |
110 | 110 |
111 /* Constructor for struct dm_bht instances. */ | 111 /* Constructor for struct dm_bht instances. */ |
112 int dm_bht_create(struct dm_bht *bht, | 112 int dm_bht_create(struct dm_bht *bht, |
113 unsigned int depth, | |
114 unsigned int block_count, | 113 unsigned int block_count, |
115 const char *alg_name); | 114 const char *alg_name); |
116 /* Destructor for struct dm_bht instances. Does not free @bht */ | 115 /* Destructor for struct dm_bht instances. Does not free @bht */ |
117 int dm_bht_destroy(struct dm_bht *bht); | 116 int dm_bht_destroy(struct dm_bht *bht); |
118 | 117 |
119 /* Basic accessors for struct dm_bht */ | 118 /* Basic accessors for struct dm_bht */ |
120 sector_t dm_bht_sectors(const struct dm_bht *bht); | 119 sector_t dm_bht_sectors(const struct dm_bht *bht); |
121 void dm_bht_set_read_cb(struct dm_bht *bht, dm_bht_callback read_cb); | 120 void dm_bht_set_read_cb(struct dm_bht *bht, dm_bht_callback read_cb); |
122 void dm_bht_set_write_cb(struct dm_bht *bht, dm_bht_callback write_cb); | 121 void dm_bht_set_write_cb(struct dm_bht *bht, dm_bht_callback write_cb); |
123 int dm_bht_set_root_hexdigest(struct dm_bht *bht, const u8 *hexdigest); | 122 int dm_bht_set_root_hexdigest(struct dm_bht *bht, const u8 *hexdigest); |
(...skipping 12 matching lines...) Expand all Loading... |
136 */ | 135 */ |
137 int dm_bht_compute(struct dm_bht *bht, void *read_cb_ctx); | 136 int dm_bht_compute(struct dm_bht *bht, void *read_cb_ctx); |
138 int dm_bht_sync(struct dm_bht *bht, void *write_cb_ctx); | 137 int dm_bht_sync(struct dm_bht *bht, void *write_cb_ctx); |
139 int dm_bht_store_block(struct dm_bht *bht, unsigned int block_index, | 138 int dm_bht_store_block(struct dm_bht *bht, unsigned int block_index, |
140 u8 *block_data); | 139 u8 *block_data); |
141 int dm_bht_zeroread_callback(void *ctx, sector_t start, u8 *dst, sector_t count, | 140 int dm_bht_zeroread_callback(void *ctx, sector_t start, u8 *dst, sector_t count, |
142 struct dm_bht_entry *entry); | 141 struct dm_bht_entry *entry); |
143 void dm_bht_read_completed(struct dm_bht_entry *entry, int status); | 142 void dm_bht_read_completed(struct dm_bht_entry *entry, int status); |
144 void dm_bht_write_completed(struct dm_bht_entry *entry, int status); | 143 void dm_bht_write_completed(struct dm_bht_entry *entry, int status); |
145 #endif /* __LINUX_DM_BHT_H */ | 144 #endif /* __LINUX_DM_BHT_H */ |
OLD | NEW |