verity: remove verify_mode
We don't really use verify_mode any more. We used to use it when
dm_bht_compute called verify_path but that is no longer the case.
I'm sending this patch now because it makes the LOCALLY_VERIFIED state
patch I'm working on a little cleaner. So this is really work
leading up to that.
BUG=9752
TEST=Ran platform_DMVerityCorruption on H/W.
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
kernel.git Review URL: http://codereview.chromium.org/6659037
TBRing because code has already been LGTMed and commited to kernel.git.
Change-Id: I09b2e9b7caeb7020c14fb7d2366e463afee9b515
TBR=wad@chromium.org,taysom@chromium.org,ups@chromium.org
Review URL: http://codereview.chromium.org/6705014
diff --git a/dm-bht.c b/dm-bht.c
index 5a6cc3b..46b03c0 100644
--- a/dm-bht.c
+++ b/dm-bht.c
@@ -307,7 +307,6 @@
if (status)
goto bad_entries_alloc;
- bht->verify_mode = DM_BHT_REVERIFY_LEAVES;
bht->entry_readahead = 0;
return 0;
@@ -727,10 +726,9 @@
goto mismatch;
}
- if (bht->verify_mode != DM_BHT_FULL_REVERIFY)
- atomic_cmpxchg(&entry->state,
- DM_BHT_ENTRY_READY,
- DM_BHT_ENTRY_VERIFIED);
+ atomic_cmpxchg(&entry->state,
+ DM_BHT_ENTRY_READY,
+ DM_BHT_ENTRY_VERIFIED);
entry = parent;
depth--;
@@ -1169,17 +1167,6 @@
EXPORT_SYMBOL(dm_bht_set_write_cb);
/**
- * dm_bht_set_verify_mode - set verify mode
- * @bht: pointer to a dm_bht_create()d bht
- * @verify_mode: indicate verification behavior
- */
-void dm_bht_set_verify_mode(struct dm_bht *bht, int verify_mode)
-{
- bht->verify_mode = verify_mode;
-}
-EXPORT_SYMBOL(dm_bht_set_verify_mode);
-
-/**
* dm_bht_set_entry_readahead - set verify mode
* @bht: pointer to a dm_bht_create()d bht
* @readahead_count: number of entries to readahead from a given level
diff --git a/dm-bht.h b/dm-bht.h
index 25c20b5..a6528d3 100644
--- a/dm-bht.h
+++ b/dm-bht.h
@@ -83,14 +83,12 @@
* TODO(wad): All hash storage memory is pre-allocated and freed once an
* entire branch has been verified.
*/
-enum verify_mode { DM_BHT_REVERIFY_LEAVES = 0, DM_BHT_FULL_REVERIFY };
struct dm_bht {
/* Configured values */
/* ENFORCE: depth must be >= 2. */
unsigned int depth; /* Depth of the tree including the root */
unsigned int block_count; /* Number of blocks hashed */
char hash_alg[CRYPTO_MAX_ALG_NAME];
- int verify_mode; /* different verification modes */
unsigned int entry_readahead; /* number of entries to attempt to
* pre-read in a level.
*/
@@ -127,7 +125,6 @@
unsigned int readahead_count);
void dm_bht_set_read_cb(struct dm_bht *bht, dm_bht_callback read_cb);
void dm_bht_set_write_cb(struct dm_bht *bht, dm_bht_callback write_cb);
-void dm_bht_set_verify_mode(struct dm_bht *bht, int verify_mode);
int dm_bht_set_root_hexdigest(struct dm_bht *bht, const u8 *hexdigest);
int dm_bht_root_hexdigest(struct dm_bht *bht, u8 *hexdigest, int available);