From 077185afe35350aae03bac0d25fbebcd8a3e1c72 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 17 Mar 2015 16:43:00 +0530 Subject: cluster/afr: Make read child match check in afr optional Backport of: http://review.gluster.org/#/c/9917 Having this particular check which was introduced by commit bb2df4e63fa8a5d65f18b4a5efc757e8d475fbff causes a drop in performance in readdirp. So the behavior is made configurable with this patch. Change-Id: I9012a6bb955229a0cbb48f06e4e2edc0782dfead BUG: 1202675 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/9924 Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Atin Mukherjee Tested-by: Gluster Build System Reviewed-by: Niels de Vos --- xlators/cluster/afr/src/afr-dir-read.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/cluster/afr/src/afr-dir-read.c') diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index d94cb0ca699..2d368a49544 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -422,11 +422,14 @@ afr_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) { + afr_private_t *priv = NULL; afr_local_t *local = NULL; gf_dirent_t *entry = NULL; int par_read_child = (long) cookie; int32_t read_child = -1; + priv = this->private; + if (op_ret == -1) goto out; @@ -434,6 +437,9 @@ afr_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, afr_readdir_filter_trash_dir (entries, local->fd); + if (!priv->consistent_metadata) + goto out; + list_for_each_entry (entry, &entries->list, list) { if (entry->inode) { read_child = -1; -- cgit