summaryrefslogtreecommitdiffstats
path: root/src/fuse/cow.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fuse/cow.h')
-rw-r--r--src/fuse/cow.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/fuse/cow.h b/src/fuse/cow.h
new file mode 100644
index 0000000..298ce4e
--- /dev/null
+++ b/src/fuse/cow.h
@@ -0,0 +1,41 @@
+/*
+ * cow.h
+ *
+ * Created on: 22.08.2018
+ * Author: michael
+ */
+
+#ifndef COW_H_
+#define COW_H_
+#include <stddef.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "../shared/fdsignal.h"
+
+typedef struct cow_request{
+ struct cow_request *next;
+ off_t offset;
+ off_t end;
+ struct cow_request *dependencies[6];
+ struct cow_request *myDependencies[6];
+ dnbd3_signal_t* signal;
+}cow_request;
+
+bool create_cow_file(char *cow_path, char *image_Name,uint64_t imageSize);
+bool createBigBlock(unsigned long id);
+void onClose();
+cow_request getAccess(off_t offset,size_t size);
+void closeAcccess(cow_request *request);
+int write_cow(const char *data, size_t size, off_t offset);
+
+int writeToBigBlock(unsigned long bigBlockId,const char *data, off_t offset,size_t size);
+int getSmallBlockId(off_t offset);
+int cow_read(char *buf, size_t size, off_t offset);
+int readBigBlock(long bigBlockId ,char *buf,size_t size, off_t offset);
+void test();
+
+
+#endif /* COW_H_ */