summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-data.h
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2014-09-18 16:50:47 +0200
committerVijay Bellur <vbellur@redhat.com>2014-09-23 22:46:58 -0700
commitc4440ab8c7417a3bcaadf1cb150476d5ff6a1325 (patch)
tree531d308bb79b29826a7dd10ca607c076dbef4063 /xlators/cluster/ec/src/ec-data.h
parent6fffc4eaf408cb9b0b2891404ee54f4ab1dd5e2e (diff)
ec: Add config information in an xattr
To simplify backward compatibility of the ec xlator when some parameter or the implementation itself is changed, a new xattr is added to each file with the configuration needed to recover it. The new attribute is called 'trusted.ec.config', and it's a 64-bit value containing the following information: 8 bits: version of the config information (currently always 0) 8 bits: algorithm used to encode the file (currently always 0) 8 bits: size of the galois field (currently always 8) 8 bits: number of bricks 8 bits: redundancy 24 bits: chunk size (currently 512) This new xattr could allow, in a future version, to have different configurations per file. This is a backport of http://review.gluster.org/8770/ Change-Id: I8c12d40ff546cc201fc66caa367484be3d48aeb4 BUG: 1140862 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8825 Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-data.h')
-rw-r--r--xlators/cluster/ec/src/ec-data.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec-data.h b/xlators/cluster/ec/src/ec-data.h
index 71f047a9aba..49090933ade 100644
--- a/xlators/cluster/ec/src/ec-data.h
+++ b/xlators/cluster/ec/src/ec-data.h
@@ -25,6 +25,9 @@
#include "ec.h"
+struct _ec_config;
+typedef struct _ec_config ec_config_t;
+
struct _ec_fd;
typedef struct _ec_fd ec_fd_t;
@@ -53,6 +56,16 @@ typedef void (* ec_wind_f)(ec_t *, ec_fop_data_t *, int32_t);
typedef int32_t (* ec_handler_f)(ec_fop_data_t *, int32_t);
typedef void (* ec_resume_f)(ec_fop_data_t *, int32_t);
+struct _ec_config
+{
+ uint32_t version;
+ uint8_t algorithm;
+ uint8_t gf_word_size;
+ uint8_t bricks;
+ uint8_t redundancy;
+ uint32_t chunk_size;
+};
+
struct _ec_fd
{
uintptr_t bad;
@@ -184,6 +197,7 @@ struct _ec_fop_data
uint64_t pre_size;
uint64_t post_size;
gf_lock_t lock;
+ ec_config_t config;
uint32_t flags;
uint32_t first;