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
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-10-06 01:42:06 +0000
commit12cfc1983fa1521d6da94ad488145182cf97db2c (patch)
tree2249e81dd6176d6752b7155c835b0c9988ec505a /libglusterfs/src/dict.c
parentdeea16e59564575d5f211f4fb8e4e5597e570ad1 (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>
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)
{