From: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Date: Tue, 5 Sep 2017 22:06:10 +0100
CA-263485: Debug logs for bitmap file operations

Signed-off-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
diff --git a/cbt/cbt-util.c b/cbt/cbt-util.c
index 071dce0..d4b8c55 100644
--- a/cbt/cbt-util.c
+++ b/cbt/cbt-util.c
@@ -247,6 +247,10 @@ cbt_util_get(int argc, char **argv)
 			err = -EIO;
 			goto error;
 		}
+		else {
+			DPRINTF("Read %"PRIu64" bytes from bitmap region for file %s\n",
+						bmsize, name);
+		}
 
 		fwrite(buf, bmsize, 1, stdout);
 	}
@@ -381,7 +385,7 @@ cbt_util_set(int argc, char **argv)
 			goto error;
 		}
 
-    	memset(buf + old_bmsize, 0, bmsize - old_bmsize);
+		memset(buf + old_bmsize, 0, bmsize - old_bmsize);
 		// Set file pointer to start of bitmap area
 		ret = fseek(f, sizeof(struct cbt_log_metadata), SEEK_SET);
 		if(ret < 0) {
@@ -482,6 +486,8 @@ cbt_util_create(int argc, char **argv)
 	log_data->metadata.consistent = 0;
 	log_data->metadata.size = size;
 
+	DPRINTF("Creating new log file %s of size %"PRIu64"\n", name, size);
+
 	bitmap_sz = bitmap_size(size);
 	log_data->bitmap = (char*)malloc(bitmap_sz);
 	if (!log_data->bitmap) {
@@ -512,6 +518,10 @@ cbt_util_create(int argc, char **argv)
 		err = -EIO;
 		goto error;
 	}
+	else {
+		DPRINTF("Bitmap area of %"PRIu64" bytes initialised\n", bitmap_sz);
+	}
+	
 
 error:
 	if(log_data) {
diff --git a/include/cbt-util.h b/include/cbt-util.h
index f0ab219..88b7846 100644
--- a/include/cbt-util.h
+++ b/include/cbt-util.h
@@ -32,6 +32,7 @@
 #define _CBT_UTIL_H_
 
 #include <uuid/uuid.h>
+#include "../drivers/tapdisk-log.h"
 
 #define CBT_BLOCK_SIZE (64 * 1024)
 
