summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Gohad <tushar.gohad@intel.com>2015-09-17 23:23:01 +0000
committerTushar Gohad <tushar.gohad@intel.com>2015-09-17 23:23:01 +0000
commit5ac6ae9c12a6e4ca356d5e268b171d906e734e05 (patch)
treec19f925e6390133c1493bf69f86e4344a649eeed
parentb80d5b947b37c7047375cefcc4f6f3ca93d951d9 (diff)
downloadliberasurecode-5ac6ae9c12a6e4ca356d5e268b171d906e734e05.tar.gz
Move fragment_header defn to main erasurecode header
-rw-r--r--include/erasurecode/erasurecode.h28
-rw-r--r--include/erasurecode/erasurecode_helpers.h23
2 files changed, 25 insertions, 26 deletions
diff --git a/include/erasurecode/erasurecode.h b/include/erasurecode/erasurecode.h
index 7bdad5d..793b829 100644
--- a/include/erasurecode/erasurecode.h
+++ b/include/erasurecode/erasurecode.h
@@ -29,7 +29,6 @@
#ifndef _ERASURECODE_H_
#define _ERASURECODE_H_
-#include "list.h"
#include "erasurecode_stdinc.h"
#include "erasurecode_version.h"
@@ -259,9 +258,6 @@ fragment_metadata
uint32_t backend_version; /* 4 */
} fragment_metadata_t;
-#define FRAGSIZE_2_BLOCKSIZE(fragment_size) \
- (fragment_size - sizeof(fragment_header_t))
-
/**
* Get opaque metadata for a fragment. The metadata is opaque to the
* client, but meaningful to the underlying library. It is used to verify
@@ -303,6 +299,30 @@ int is_invalid_fragment(int desc, char *fragment);
int liberasurecode_verify_stripe_metadata(int desc,
char **fragments, int num_fragments);
+/* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */
+
+/**
+ * liberasurecode fragment header definition
+ *
+ * Prevent the compiler from padding this by using the __packed__ keyword
+ */
+
+#define LIBERASURECODE_FRAG_HEADER_MAGIC 0xb0c5ecc
+#define LIBERASURECODE_MAX_CHECKSUM_LEN 8 /* quad words */
+
+typedef struct __attribute__((__packed__)) fragment_header_s
+{
+ fragment_metadata_t meta; /* 59 bytes */
+ uint32_t magic; /* 4 bytes */
+ uint32_t libec_version; /* 4 bytes */
+ // We must be aligned to 16-byte boundaries
+ // So, size this array accordingly
+ uint8_t aligned_padding[13];
+} fragment_header_t;
+
+#define FRAGSIZE_2_BLOCKSIZE(fragment_size) \
+ (fragment_size - sizeof(fragment_header_t))
+
/* ==~=*=~===~=*=~==~=*=~== liberasurecode Helpers ==~*==~=*=~==~=~=*=~==~= */
/**
diff --git a/include/erasurecode/erasurecode_helpers.h b/include/erasurecode/erasurecode_helpers.h
index 33b26bd..3982b18 100644
--- a/include/erasurecode/erasurecode_helpers.h
+++ b/include/erasurecode/erasurecode_helpers.h
@@ -1,5 +1,5 @@
/*
- * <Copyright>
+ * Copyright 2014, Kevin Greenan, Tushar Gohda, All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -34,27 +34,6 @@
/* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */
-/**
- * liberasurecode fragment header definition
- *
- * Prevent the compiler from padding this by using the __packed__ keyword
- */
-
-#define LIBERASURECODE_FRAG_HEADER_MAGIC 0xb0c5ecc
-#define LIBERASURECODE_MAX_CHECKSUM_LEN 8 /* quad words */
-
-typedef struct __attribute__((__packed__)) fragment_header_s
-{
- fragment_metadata_t meta; /* 59 bytes */
- uint32_t magic; /* 4 bytes */
- uint32_t libec_version; /* 4 bytes */
- // We must be aligned to 16-byte boundaries
- // So, size this array accordingly
- uint8_t aligned_padding[13];
-} fragment_header_t;
-
-/* ==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~==~=*=~== */
-
#define talloc(type, num) (type *) malloc(sizeof(type) * (num))
/* Determine if an address is aligned to a particular boundary */