summaryrefslogtreecommitdiffstats
path: root/drivers/block/loop/loop_file_fmt_qcow_main.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/loop/loop_file_fmt_qcow_main.h')
-rw-r--r--drivers/block/loop/loop_file_fmt_qcow_main.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/block/loop/loop_file_fmt_qcow_main.h b/drivers/block/loop/loop_file_fmt_qcow_main.h
index c04aa4547799..8f2fa32cb422 100644
--- a/drivers/block/loop/loop_file_fmt_qcow_main.h
+++ b/drivers/block/loop/loop_file_fmt_qcow_main.h
@@ -16,9 +16,14 @@
#define _LINUX_LOOP_FILE_FMT_QCOW_H
#include <linux/list.h>
+#include <linux/mutex.h>
#include <linux/types.h>
#include <linux/zlib.h>
+#ifdef CONFIG_DEBUG_FS
+#include <linux/debugfs.h>
+#endif
+
#include "loop_file_fmt.h"
#ifdef CONFIG_DEBUG_DRIVER
@@ -89,6 +94,14 @@ do { \
#define QCOW_DEFAULT_CLUSTER_SIZE 65536
+/* Buffer size for debugfs file buffer to display QCOW header information */
+#define QCOW_HEADER_BUF_LEN 1024
+
+/* Buffer size for debugfs file buffer to receive and display offset and
+ * cluster offset information */
+#define QCOW_OFFSET_BUF_LEN 32
+#define QCOW_CLUSTER_BUF_LEN 128
+
struct loop_file_fmt_qcow_header {
u32 magic;
u32 version;
@@ -221,6 +234,18 @@ struct loop_file_fmt_qcow_data {
u64 autoclear_features;
struct z_stream_s *strm;
+
+ /* debugfs entries */
+#ifdef CONFIG_DEBUG_FS
+ struct dentry *dbgfs_dir;
+ struct dentry *dbgfs_file_qcow_header;
+ char dbgfs_file_qcow_header_buf[QCOW_HEADER_BUF_LEN];
+ struct dentry *dbgfs_file_qcow_offset;
+ char dbgfs_file_qcow_offset_buf[QCOW_OFFSET_BUF_LEN];
+ char dbgfs_file_qcow_cluster_buf[QCOW_CLUSTER_BUF_LEN];
+ u64 dbgfs_qcow_offset;
+ struct mutex dbgfs_qcow_offset_mutex;
+#endif
};
struct loop_file_fmt_qcow_cow_region {