move extern C markers to dm-bht headers

C code should mark its own headers as extern, so move that logic here.

BUG=chromium:878440
TEST=build passes

Change-Id: Ic90da314e5a2820faf207eb85056f7e4aa30d9b1
Reviewed-on: https://chromium-review.googlesource.com/1207270
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
diff --git a/dm-bht-userspace.h b/dm-bht-userspace.h
index 2bf93dc..8df4fda 100644
--- a/dm-bht-userspace.h
+++ b/dm-bht-userspace.h
@@ -8,6 +8,10 @@
 #ifndef __LINUX_DM_BHT_USERSPACE_H
 #define __LINUX_DM_BHT_USERSPACE_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* 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.
@@ -17,4 +21,8 @@
 int dm_bht_store_block(struct dm_bht *bht, unsigned int block,
 		       u8 *block_data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif  /* __LINUX_DM_BHT_USERSPACE_H */
diff --git a/dm-bht.h b/dm-bht.h
index f022a1a..d72f459 100644
--- a/dm-bht.h
+++ b/dm-bht.h
@@ -9,6 +9,10 @@
 #ifndef __LINUX_DM_BHT_H
 #define __LINUX_DM_BHT_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <linux/crypto.h>
 #include <linux/types.h>
 
@@ -185,4 +189,9 @@
 
 	return dm_bht_node(bht, entry, index % bht->node_count);
 }
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif  /* __LINUX_DM_BHT_H */
diff --git a/dm-bht_unittest.cc b/dm-bht_unittest.cc
index ae82bf4..bca905c 100644
--- a/dm-bht_unittest.cc
+++ b/dm-bht_unittest.cc
@@ -22,8 +22,8 @@
 #else
 #  include "dm-bht.c"
 #endif
-#include "dm-bht-userspace.h"
 }
+#include "dm-bht-userspace.h"
 
 void *my_memalign(size_t boundary, size_t size) {
   void * memptr;
diff --git a/file_hasher.h b/file_hasher.h
index add1836..c5fe51c 100644
--- a/file_hasher.h
+++ b/file_hasher.h
@@ -7,10 +7,8 @@
 #ifndef VERITY_FILE_HASHER_H__
 #define VERITY_FILE_HASHER_H__ 1
 
-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"