summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/cluster-syncop.h
diff options
context:
space:
mode:
authorSunil Kumar Acharya <sheggodu@redhat.com>2017-04-28 18:09:01 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-10-12 18:52:34 +0000
commitb79588a90bb2fcb2f02b65b98e2ae265a926e507 (patch)
tree114878da56f7b73c0c77b4dde17256184efde72d /libglusterfs/src/cluster-syncop.h
parent8aa0c34c5301a15a87c0cb168a89cb291e85d741 (diff)
cluster/ec: Improve performance with xattrop update
Existing EC code updates the xattr on the subvolume in a sequential pattern resulting in very poor performance. With this fix EC now updates the xattr on the subvolume in parallel which improves the xattr update performance. >BUG: 1445663 >Change-Id: I3fc40d66db0b88875ca96a9fa01002ba386c0486 >Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com> BUG: 1499150 Change-Id: I3fc40d66db0b88875ca96a9fa01002ba386c0486 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
Diffstat (limited to 'libglusterfs/src/cluster-syncop.h')
-rw-r--r--libglusterfs/src/cluster-syncop.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/libglusterfs/src/cluster-syncop.h b/libglusterfs/src/cluster-syncop.h
index 7e17faae0e0..ff9387acace 100644
--- a/libglusterfs/src/cluster-syncop.h
+++ b/libglusterfs/src/cluster-syncop.h
@@ -20,6 +20,46 @@
#include "default-args.h"
#include "syncop.h"
+/*********************************************************************
+ *
+ * PARALLEL_FOP_ONLIST:
+ * Performs file operations in parallel on bricks.
+ * This macro expects a helper function(func) to implement the
+ * functionality.
+ *
+ ********************************************************************/
+#define PARALLEL_FOP_ONLIST(subvols, on, numsubvols, replies, frame, \
+ func, args ...) \
+do { \
+ int __i = 0; \
+ int __count = 0; \
+ cluster_local_t __local = {0,}; \
+ void *__old_local = frame->local; \
+ \
+ __local.replies = replies; \
+ cluster_replies_wipe (replies, numsubvols); \
+ for (__i = 0; __i < numsubvols; __i++) \
+ INIT_LIST_HEAD (&replies[__i].entries.list); \
+ if (syncbarrier_init (&__local.barrier)) \
+ break; \
+ frame->local = &__local; \
+ for (__i = 0; __i < numsubvols; __i++) { \
+ if (on[__i]) { \
+ __count++; \
+ } \
+ } \
+ __local.barrier.waitfor = __count; \
+ for (__i = 0; __i < numsubvols; __i++) { \
+ if (on[__i]) { \
+ func (frame, subvols[__i], __i, ## args); \
+ } \
+ } \
+ syncbarrier_wait (&__local.barrier, __count); \
+ syncbarrier_destroy (&__local.barrier); \
+ frame->local = __old_local; \
+ STACK_RESET (frame->root); \
+} while (0)
+
typedef struct cluster_local_ {
default_args_cbk_t *replies;
syncbarrier_t barrier;
@@ -160,4 +200,13 @@ cluster_fsetattr (xlator_t **subvols, unsigned char *on, int numsubvols,
void
cluster_replies_wipe (default_args_cbk_t *replies, int num_subvols);
+
+int32_t
+cluster_fop_success_fill (default_args_cbk_t *replies, int numsubvols,
+ unsigned char *success);
+
+int32_t
+cluster_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict,
+ dict_t *xdata);
#endif /* !_CLUSTER_SYNCOP_H */