summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/ec/src/ec-helpers.h')
-rw-r--r--xlators/cluster/ec/src/ec-helpers.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec-helpers.h b/xlators/cluster/ec/src/ec-helpers.h
index dfea6fef537..0b355bd440e 100644
--- a/xlators/cluster/ec/src/ec-helpers.h
+++ b/xlators/cluster/ec/src/ec-helpers.h
@@ -13,6 +13,10 @@
#include "ec-types.h"
+#define EC_ERR(_x) ((void *)-(intptr_t)(_x))
+#define EC_IS_ERR(_x) (((uintptr_t)(_x) & ~0xfffULL) == ~0xfffULL)
+#define EC_GET_ERR(_x) ((int32_t)(intptr_t)(_x))
+
#define EC_ALIGN_CHECK(_ptr, _align) \
((((uintptr_t)(_ptr)) & ((_align) - 1)) == 0)