summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorManuel Bentele2020-11-06 12:44:43 +0100
committerManuel Bentele2020-11-06 12:44:43 +0100
commitef92307fd49e75482c7599caf68685afc1807512 (patch)
tree14dfcdd43d0a1c12d9e84d5b7c98807a2e56bece /inc
parent[BUILD] add CMake support to build docker images based on Archlinux (diff)
downloaddnbd3-ef92307fd49e75482c7599caf68685afc1807512.tar.gz
dnbd3-ef92307fd49e75482c7599caf68685afc1807512.tar.xz
dnbd3-ef92307fd49e75482c7599caf68685afc1807512.zip
[KERNEL, CLIENT]: submit and probe multiple dnbd3-server with ioctl OPEN
The ioctl OPEN call for DNBD3 devices exposed by the dnbd3 Linux kernel module, is extended with a fixed array of dnbd3 hosts. The fixed array allows the dnbd3-client to submit host information (IP address and port) of multiple dnbd3-servers. This information is used to probe all submitted dnbd3-servers and add them to the alternative dnbd3-server list. If at least one dnbd3-server is not reachable, the OPEN ioctl call will abort with an error code.
Diffstat (limited to 'inc')
-rw-r--r--inc/dnbd3/types.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/inc/dnbd3/types.h b/inc/dnbd3/types.h
index 63e182c..59bf2d1 100644
--- a/inc/dnbd3/types.h
+++ b/inc/dnbd3/types.h
@@ -128,10 +128,14 @@ typedef struct __attribute__((packed)) dnbd3_host_t
dnbd3_af type; // 1byte (ip version. HOST_IP4 or HOST_IP6. 0 means this struct is empty and should be ignored)
} dnbd3_host_t;
+/* IOCTLs */
+#define MAX_HOSTS_PER_IOCTL NUMBER_SERVERS
+
typedef struct __attribute__((packed))
{
uint16_t len;
- dnbd3_host_t host;
+ dnbd3_host_t hosts[MAX_HOSTS_PER_IOCTL];
+ uint8_t hosts_num;
uint16_t imgnamelen;
char *imgname;
int rid;