summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.c
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/dict.c
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/dict.c')
-rw-r--r--libglusterfs/src/dict.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index c4f3fb71de3..243c92985a8 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -2321,7 +2321,15 @@ err:
return ret;
}
-
+/********************************************************************
+ *
+ * dict_set_bin_common:
+ * This is the common function to set key and its value in
+ * dictionary. Flag(is_static) should be set appropriately based
+ * on the type of memory type used for value(*ptr). If flag is set
+ * to false value(*ptr) will be freed using GF_FREE() on destroy.
+ *
+ *******************************************************************/
static int
dict_set_bin_common (dict_t *this, char *key, void *ptr, size_t size,
gf_boolean_t is_static)
@@ -2353,13 +2361,26 @@ err:
return ret;
}
+/********************************************************************
+ *
+ * dict_set_bin:
+ * Set key and its value in the dictionary. This function should
+ * be called if the value is stored in dynamic memory.
+ *
+ *******************************************************************/
int
dict_set_bin (dict_t *this, char *key, void *ptr, size_t size)
{
return dict_set_bin_common (this, key, ptr, size, _gf_false);
}
-
+/********************************************************************
+ *
+ * dict_set_static_bin:
+ * Set key and its value in the dictionary. This function should
+ * be called if the value is stored in static memory.
+ *
+ *******************************************************************/
int
dict_set_static_bin (dict_t *this, char *key, void *ptr, size_t size)
{