verity: remove entry_readahead

We don't use entry_readahead and readahead is really best done by
other layers.

BUG=9752
TEST=Ran platform_DMVerityCorruption on H/W.

kernel.git Review URL: http://codereview.chromium.org/6757012

TBRing. Already LGTMed and committed to kernel.git.

Change-Id: Id58c0d36fb5576715cbf1e4143a17671b9a6b65b

R=wad@chromium.org

Review URL: http://codereview.chromium.org/6675058
diff --git a/dm-bht.c b/dm-bht.c
index 5078b27..5957cb7 100644
--- a/dm-bht.c
+++ b/dm-bht.c
@@ -317,7 +317,6 @@
 	if (status)
 		goto bad_entries_alloc;
 
-	bht->entry_readahead = 0;
 	return 0;
 
 bad_entries_alloc:
@@ -1011,26 +1010,6 @@
 		}
 		/* Accrue return code flags */
 		populated |= read_status;
-
-		/* Attempt to pull in up to entry_readahead extra entries on
-		 * this I/O call iff we're doing the read right now.  This
-		 * helps optimize sequential access to the mapped drive.
-		 */
-		if (bht->entry_readahead &&
-		    (read_status & DM_BHT_ENTRY_REQUESTED)) {
-			unsigned int readahead_count;
-			entry_index++;
-			readahead_count = min(bht->entry_readahead,
-					      level->count - entry_index);
-			/* The result is completely ignored since this call is
-			 * critical for the current request.
-			 */
-			if (readahead_count)
-				dm_bht_maybe_read_entries(bht, read_cb_ctx,
-							  depth, entry_index,
-							  readahead_count,
-							  true);
-		}
 	}
 
 	/* All nodes are ready. The hash for the block_index can be verified */
@@ -1160,18 +1139,6 @@
 EXPORT_SYMBOL(dm_bht_set_write_cb);
 
 /**
- * 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
- */
-void dm_bht_set_entry_readahead(struct dm_bht *bht,
-				unsigned int readahead_count)
-{
-	bht->entry_readahead = readahead_count;
-}
-EXPORT_SYMBOL(dm_bht_set_entry_readahead);
-
-/**
  * dm_bht_set_root_hexdigest - sets an unverified root digest hash from hex
  * @bht:	pointer to a dm_bht_create()d bht
  * @hexdigest:	array of u8s containing the new digest in binary
@@ -1225,4 +1192,3 @@
 	return 0;
 }
 EXPORT_SYMBOL(dm_bht_root_hexdigest);
-
diff --git a/dm-bht.h b/dm-bht.h
index c75ff91..3106079 100644
--- a/dm-bht.h
+++ b/dm-bht.h
@@ -89,9 +89,6 @@
 	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];
-	unsigned int entry_readahead;  /* number of entries to attempt to
-					* pre-read in a level.
-					*/
 
 	/* Computed values */
 	unsigned int node_count;  /* Data size (in hashes) for each entry */
@@ -121,8 +118,6 @@
 
 /* Basic accessors for struct dm_bht */
 sector_t dm_bht_sectors(const struct dm_bht *bht);
-void dm_bht_set_entry_readahead(struct dm_bht *bht,
-				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);
 int dm_bht_set_root_hexdigest(struct dm_bht *bht, const u8 *hexdigest);