verity: move userspace api to a new header file

We can now pull out the userspace API prototypes from the kernel header file.

BUG=chromium-os:19952
TEST=Ran unit tests from dm-verity.git.
     Ran platform_DMVerityCorruption and platform_DMVerityBitCorruption.
TESTED_ON=Alex

Change-Id: I2158f3519249c67bf652fdd1d9dfba4389928020
Reviewed-on: http://gerrit.chromium.org/gerrit/7104
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
diff --git a/dm-bht-userspace.h b/dm-bht-userspace.h
new file mode 100644
index 0000000..2bf93dc
--- /dev/null
+++ b/dm-bht-userspace.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2011 The Chromium OS Authors <chromium-os-dev@chromium.org>
+ *
+ * Device-Mapper block hash tree interface.
+ *
+ * This file is released under the GPLv2.
+ */
+#ifndef __LINUX_DM_BHT_USERSPACE_H
+#define __LINUX_DM_BHT_USERSPACE_H
+
+/* Functions for creating struct dm_bhts on disk.  A newly created dm_bht
+ * should not be directly used for verification. (It should be repopulated.)
+ * In addition, these functions aren't meant to be called in parallel.
+ */
+int dm_bht_compute(struct dm_bht *bht);
+void dm_bht_set_buffer(struct dm_bht *bht, void *buffer);
+int dm_bht_store_block(struct dm_bht *bht, unsigned int block,
+		       u8 *block_data);
+
+#endif  /* __LINUX_DM_BHT_USERSPACE_H */
diff --git a/dm-bht.h b/dm-bht.h
index 923a5f1..6e4ffee 100644
--- a/dm-bht.h
+++ b/dm-bht.h
@@ -128,15 +128,6 @@
 		    unsigned int block);
 int dm_bht_verify_block(struct dm_bht *bht, unsigned int block,
 			struct page *pg, unsigned int offset);
-
-/* Functions for creating struct dm_bhts on disk.  A newly created dm_bht
- * should not be directly used for verification. (It should be repopulated.)
- * In addition, these functions aren't meant to be called in parallel.
- */
-int dm_bht_compute(struct dm_bht *bht);
-void dm_bht_set_buffer(struct dm_bht *bht, void *buffer);
-int dm_bht_store_block(struct dm_bht *bht, unsigned int block,
-		       u8 *block_data);
 int dm_bht_zeroread_callback(void *ctx, sector_t start, u8 *dst, sector_t count,
 			     struct dm_bht_entry *entry);
 void dm_bht_read_completed(struct dm_bht_entry *entry, int status);
diff --git a/dm-bht_unittest.cc b/dm-bht_unittest.cc
index 3871a38..be68988 100644
--- a/dm-bht_unittest.cc
+++ b/dm-bht_unittest.cc
@@ -20,6 +20,7 @@
 #else
 #  include "dm-bht.c"
 #endif
+#include "dm-bht-userspace.h"
 }
 
 void *my_memalign(size_t boundary, size_t size) {
diff --git a/file_hasher.h b/file_hasher.h
index 007c434..e26ef96 100644
--- a/file_hasher.h
+++ b/file_hasher.h
@@ -9,6 +9,7 @@
 
 extern "C" {
 #include "verity/dm-bht.h"
+#include "verity/dm-bht-userspace.h"
 }
 #include "verity/simple_file/file.h"
 #include "verity/include/asm/page.h"