summaryrefslogtreecommitdiffstats
path: root/src/fuse/connection.h
diff options
context:
space:
mode:
authorSimon Rettberg2015-11-21 12:24:21 +0100
committerSimon Rettberg2015-11-21 12:24:21 +0100
commit4c94cb861dfbfe2a8c9c165165cbdbc062eaa39b (patch)
tree5ef29b28a920626b572a0d6dd378440ddb7f885b /src/fuse/connection.h
parent[SERVER] Improve image related locking (diff)
downloaddnbd3-4c94cb861dfbfe2a8c9c165165cbdbc062eaa39b.tar.gz
dnbd3-4c94cb861dfbfe2a8c9c165165cbdbc062eaa39b.tar.xz
dnbd3-4c94cb861dfbfe2a8c9c165165cbdbc062eaa39b.zip
[FUSE] Start refactoring so we can handle multithread fuse
Diffstat (limited to 'src/fuse/connection.h')
-rw-r--r--src/fuse/connection.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fuse/connection.h b/src/fuse/connection.h
new file mode 100644
index 0000000..8ab2c35
--- /dev/null
+++ b/src/fuse/connection.h
@@ -0,0 +1,25 @@
+#ifndef _CONNECTION_H_
+#define _CONNECTION_H_
+
+#include <stdbool.h>
+#include <stdint.h>
+
+struct _dnbd3_async;
+
+typedef struct _dnbd3_async {
+ struct _dnbd3_async *next; // Next in this linked list (provate field, not set by caller)
+ char* buffer; // Caller-provided buffer to be filled
+ uint64_t offset;
+ uint32_t length;
+ int signalFd; // Used to signal the caller
+ bool finished; // Will be set to true if the request has been handled
+ bool success; // Will be set to true if the request succeeded
+} dnbd3_async_t;
+
+bool connection_init(const char *hosts, const char *image, const uint16_t rid);
+
+bool connection_read(dnbd3_async_t *request);
+
+void connection_close();
+
+#endif /* CONNECTION_H_ */