d1681e
From 18093998f1e5178e707055904b32149c52acc774 Mon Sep 17 00:00:00 2001
d1681e
From: Pranith Kumar K <pkarampu@redhat.com>
d1681e
Date: Fri, 2 Mar 2018 10:13:20 +0530
d1681e
Subject: [PATCH 192/201] cluster/afr: Remove compound-fops usage in afr
d1681e
d1681e
We are not seeing much improvement with this change. So removing the
d1681e
feature so that it doesn't need to be maintained anymore.
d1681e
d1681e
 > Fixes: #414
d1681e
Upstream-patch: https://review.gluster.org/19655
d1681e
d1681e
BUG: 1559788
d1681e
Change-Id: Ic7969b151544daf2547bd262a9fa03f575626411
d1681e
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/131943
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
---
d1681e
 tests/basic/afr/compounded-write-txns.t   |  37 ----
d1681e
 xlators/cluster/afr/src/afr-common.c      |  43 ----
d1681e
 xlators/cluster/afr/src/afr-transaction.c | 333 +-----------------------------
d1681e
 xlators/cluster/afr/src/afr-transaction.h |   4 +-
d1681e
 xlators/cluster/afr/src/afr.c             |  10 +-
d1681e
 xlators/cluster/afr/src/afr.h             |  13 --
d1681e
 6 files changed, 7 insertions(+), 433 deletions(-)
d1681e
 delete mode 100644 tests/basic/afr/compounded-write-txns.t
d1681e
d1681e
diff --git a/tests/basic/afr/compounded-write-txns.t b/tests/basic/afr/compounded-write-txns.t
d1681e
deleted file mode 100644
d1681e
index 7cecd87..0000000
d1681e
--- a/tests/basic/afr/compounded-write-txns.t
d1681e
+++ /dev/null
d1681e
@@ -1,37 +0,0 @@
d1681e
-#!/bin/bash
d1681e
-. $(dirname $0)/../../include.rc
d1681e
-. $(dirname $0)/../../volume.rc
d1681e
-
d1681e
-cleanup
d1681e
-
d1681e
-TEST glusterd
d1681e
-TEST pidof glusterd
d1681e
-TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
d1681e
-TEST $CLI volume set $V0 write-behind off
d1681e
-TEST $CLI volume set $V0 client-io-threads off
d1681e
-TEST $CLI volume start $V0
d1681e
-TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0
d1681e
-
d1681e
-# Create and generate data into a src file
d1681e
-
d1681e
-TEST `printf %1024s |tr " " "1" > /tmp/source`
d1681e
-TEST `printf %1024s |tr " " "2" >> /tmp/source`
d1681e
-
d1681e
-TEST dd if=/tmp/source of=$M0/file bs=1024 count=2 2>/dev/null
d1681e
-md5sum_file=$(md5sum $M0/file | awk '{print $1}')
d1681e
-
d1681e
-TEST $CLI volume set $V0 cluster.use-compound-fops on
d1681e
-
d1681e
-TEST dd if=$M0/file of=$M0/file-copy bs=1024 count=2 2>/dev/null
d1681e
-
d1681e
-EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
d1681e
-TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0
d1681e
-
d1681e
-EXPECT "$md5sum_file" echo `md5sum $M0/file-copy | awk '{print $1}'`
d1681e
-
d1681e
-EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
d1681e
-TEST $CLI volume stop $V0
d1681e
-TEST $CLI volume delete $V0
d1681e
-
d1681e
-TEST rm -f /tmp/source
d1681e
-cleanup
d1681e
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
d1681e
index a790402..04c8613 100644
d1681e
--- a/xlators/cluster/afr/src/afr-common.c
d1681e
+++ b/xlators/cluster/afr/src/afr-common.c
d1681e
@@ -43,7 +43,6 @@
d1681e
 #include "afr-self-heal.h"
d1681e
 #include "afr-self-heald.h"
d1681e
 #include "afr-messages.h"
d1681e
-#include "compound-fop-utils.h"
d1681e
 
d1681e
 int32_t
d1681e
 afr_quorum_errno (afr_private_t *priv)
d1681e
@@ -5246,7 +5245,6 @@ afr_local_init (afr_local_t *local, afr_private_t *priv, int32_t *op_errno)
d1681e
 
d1681e
         local->need_full_crawl = _gf_false;
d1681e
 
d1681e
-        local->compound = _gf_false;
d1681e
         INIT_LIST_HEAD (&local->healer);
d1681e
 	return 0;
d1681e
 out:
d1681e
@@ -5393,7 +5391,6 @@ afr_transaction_local_init (afr_local_t *local, xlator_t *this)
d1681e
         if (!local->pending)
d1681e
                 goto out;
d1681e
 
d1681e
-        local->compound = _gf_false;
d1681e
 	INIT_LIST_HEAD (&local->transaction.eager_locked);
d1681e
 
d1681e
         ret = 0;
d1681e
@@ -6142,46 +6139,6 @@ afr_get_msg_id (char *op_type)
d1681e
         return -1;
d1681e
 }
d1681e
 
d1681e
-gf_boolean_t
d1681e
-afr_can_compound_pre_op_and_op (afr_private_t *priv, glusterfs_fop_t fop)
d1681e
-{
d1681e
-        if (priv->arbiter_count != 0)
d1681e
-                return _gf_false;
d1681e
-
d1681e
-        if (!priv->use_compound_fops)
d1681e
-                return _gf_false;
d1681e
-
d1681e
-        switch (fop) {
d1681e
-        case GF_FOP_WRITE:
d1681e
-                return _gf_true;
d1681e
-        default:
d1681e
-                return _gf_false;
d1681e
-        }
d1681e
-}
d1681e
-
d1681e
-afr_compound_cbk_t
d1681e
-afr_pack_fop_args (call_frame_t *frame, compound_args_t *args,
d1681e
-                   glusterfs_fop_t fop, int index)
d1681e
-{
d1681e
-        afr_local_t     *local  = frame->local;
d1681e
-
d1681e
-        switch (fop) {
d1681e
-        case GF_FOP_WRITE:
d1681e
-                COMPOUND_PACK_ARGS (writev, GF_FOP_WRITE,
d1681e
-                                    args, index,
d1681e
-                                    local->fd, local->cont.writev.vector,
d1681e
-                                    local->cont.writev.count,
d1681e
-                                    local->cont.writev.offset,
d1681e
-                                    local->cont.writev.flags,
d1681e
-                                    local->cont.writev.iobref,
d1681e
-                                    local->xdata_req);
d1681e
-                return afr_pre_op_writev_cbk;
d1681e
-        default:
d1681e
-                break;
d1681e
-        }
d1681e
-        return NULL;
d1681e
-}
d1681e
-
d1681e
 int
d1681e
 afr_fav_child_reset_sink_xattrs_cbk (int ret, call_frame_t *heal_frame,
d1681e
                                      void *opaque)
d1681e
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
d1681e
index 1c80c6b..02fb10a 100644
d1681e
--- a/xlators/cluster/afr/src/afr-transaction.c
d1681e
+++ b/xlators/cluster/afr/src/afr-transaction.c
d1681e
@@ -17,7 +17,6 @@
d1681e
 #include "afr-transaction.h"
d1681e
 #include "afr-self-heal.h"
d1681e
 #include "afr-messages.h"
d1681e
-#include "compound-fop-utils.h"
d1681e
 
d1681e
 #include <signal.h>
d1681e
 
d1681e
@@ -38,10 +37,6 @@ afr_changelog_call_count (afr_transaction_type type,
d1681e
                           unsigned char *failed_subvols,
d1681e
                           unsigned int child_count);
d1681e
 int
d1681e
-afr_post_op_unlock_do (call_frame_t *frame, xlator_t *this, dict_t *xattr,
d1681e
-                       afr_changelog_resume_t changelog_resume,
d1681e
-                       afr_xattrop_type_t op);
d1681e
-int
d1681e
 afr_changelog_do (call_frame_t *frame, xlator_t *this, dict_t *xattr,
d1681e
 		  afr_changelog_resume_t changelog_resume,
d1681e
                   afr_xattrop_type_t op);
d1681e
@@ -847,12 +842,10 @@ afr_changelog_post_op_now (call_frame_t *frame, xlator_t *this)
d1681e
         afr_private_t           *priv           = this->private;
d1681e
         afr_local_t             *local          = NULL;
d1681e
         dict_t                  *xattr          = NULL;
d1681e
-        afr_fd_ctx_t            *fd_ctx         = NULL;
d1681e
         int                     i               = 0;
d1681e
         int                     ret             = 0;
d1681e
         int                     idx             = 0;
d1681e
         int                     nothing_failed  = 1;
d1681e
-        gf_boolean_t            compounded_unlock = _gf_true;
d1681e
         gf_boolean_t            need_undirty    = _gf_false;
d1681e
 
d1681e
         afr_handle_quorum (frame);
d1681e
@@ -918,36 +911,8 @@ afr_changelog_post_op_now (call_frame_t *frame, xlator_t *this)
d1681e
 		goto out;
d1681e
 	}
d1681e
 
d1681e
-        if (local->compound && local->fd) {
d1681e
-                LOCK (&local->fd->lock);
d1681e
-                {
d1681e
-                        fd_ctx = __afr_fd_ctx_get (local->fd, this);
d1681e
-                        for (i = 0; i < priv->child_count; i++) {
d1681e
-                                if (local->transaction.pre_op[i] &&
d1681e
-                                    local->transaction.eager_lock[i]) {
d1681e
-                                        if (fd_ctx->lock_piggyback[i])
d1681e
-                                                compounded_unlock = _gf_false;
d1681e
-                                        else if (fd_ctx->lock_acquired[i])
d1681e
-                                                compounded_unlock = _gf_false;
d1681e
-                                }
d1681e
-                                if (compounded_unlock == _gf_false)
d1681e
-                                        break;
d1681e
-                        }
d1681e
-                }
d1681e
-                UNLOCK (&local->fd->lock);
d1681e
-        }
d1681e
-
d1681e
-        /* Do not compound if any brick got piggybacked lock as
d1681e
-         * unlock should not be done for that. */
d1681e
-        if (local->compound && compounded_unlock) {
d1681e
-                afr_post_op_unlock_do (frame, this, xattr,
d1681e
-                                       afr_changelog_post_op_done,
d1681e
-                                       AFR_TRANSACTION_POST_OP);
d1681e
-        } else {
d1681e
-                afr_changelog_do (frame, this, xattr,
d1681e
-                                  afr_changelog_post_op_done,
d1681e
-                                  AFR_TRANSACTION_POST_OP);
d1681e
-        }
d1681e
+        afr_changelog_do (frame, this, xattr, afr_changelog_post_op_done,
d1681e
+                          AFR_TRANSACTION_POST_OP);
d1681e
 out:
d1681e
 	if (xattr)
d1681e
                 dict_unref (xattr);
d1681e
@@ -1277,66 +1242,6 @@ out:
d1681e
 }
d1681e
 
d1681e
 int
d1681e
-afr_pre_op_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
d1681e
-                       int op_ret, int op_errno,
d1681e
-                       void *data, dict_t *xdata)
d1681e
-{
d1681e
-        afr_local_t *local = NULL;
d1681e
-        call_frame_t    *fop_frame = NULL;
d1681e
-        default_args_cbk_t *write_args_cbk = NULL;
d1681e
-        compound_args_cbk_t *args_cbk = data;
d1681e
-        int call_count = -1;
d1681e
-        int child_index = -1;
d1681e
-
d1681e
-        local = frame->local;
d1681e
-        child_index = (long) cookie;
d1681e
-
d1681e
-	if (local->pre_op_compat)
d1681e
-		afr_changelog_pre_op_update (frame, this);
d1681e
-
d1681e
-        if (op_ret == -1) {
d1681e
-                local->op_errno = op_errno;
d1681e
-		afr_transaction_fop_failed (frame, this, child_index);
d1681e
-        }
d1681e
-
d1681e
-        /* If the compound fop failed due to saved_frame_unwind(), then
d1681e
-         * protocol/client fails it even before args_cbk is allocated.
d1681e
-         * Handle that case by passing the op_ret, op_errno values explicitly.
d1681e
-         */
d1681e
-        if ((op_ret == -1) && (args_cbk == NULL)) {
d1681e
-                afr_inode_write_fill  (frame, this, child_index, op_ret,
d1681e
-                                       op_errno, NULL, NULL, NULL);
d1681e
-        } else {
d1681e
-                write_args_cbk = &args_cbk->rsp_list[1];
d1681e
-                afr_inode_write_fill  (frame, this, child_index,
d1681e
-                                       write_args_cbk->op_ret,
d1681e
-                                       write_args_cbk->op_errno,
d1681e
-                                       &write_args_cbk->prestat,
d1681e
-                                       &write_args_cbk->poststat,
d1681e
-                                       write_args_cbk->xdata);
d1681e
-        }
d1681e
-
d1681e
-	call_count = afr_frame_return (frame);
d1681e
-
d1681e
-        if (call_count == 0) {
d1681e
-                compound_args_cleanup (local->c_args);
d1681e
-                local->c_args = NULL;
d1681e
-                afr_process_post_writev (frame, this);
d1681e
-                if (!afr_txn_nothing_failed (frame, this)) {
d1681e
-                        /* Don't unwind until post-op is complete */
d1681e
-                        local->transaction.resume (frame, this);
d1681e
-                } else {
d1681e
-                /* frame change, place frame in post-op delay and unwind */
d1681e
-                        fop_frame = afr_transaction_detach_fop_frame (frame);
d1681e
-                        afr_writev_copy_outvars (frame, fop_frame);
d1681e
-                        local->transaction.resume (frame, this);
d1681e
-                        afr_writev_unwind (fop_frame, this);
d1681e
-                }
d1681e
-        }
d1681e
-        return 0;
d1681e
-}
d1681e
-
d1681e
-int
d1681e
 afr_changelog_prepare (xlator_t *this, call_frame_t *frame, int *call_count,
d1681e
                        afr_changelog_resume_t changelog_resume,
d1681e
                        afr_xattrop_type_t op, dict_t **xdata,
d1681e
@@ -1366,223 +1271,6 @@ afr_changelog_prepare (xlator_t *this, call_frame_t *frame, int *call_count,
d1681e
 }
d1681e
 
d1681e
 int
d1681e
-afr_pre_op_fop_do (call_frame_t *frame, xlator_t *this, dict_t *xattr,
d1681e
-                   afr_changelog_resume_t changelog_resume,
d1681e
-                   afr_xattrop_type_t op)
d1681e
-{
d1681e
-        afr_local_t *local = NULL;
d1681e
-        afr_private_t *priv = NULL;
d1681e
-        dict_t *xdata = NULL;
d1681e
-        dict_t *newloc_xdata = NULL;
d1681e
-        compound_args_t *args = NULL;
d1681e
-        int i = 0, call_count = 0;
d1681e
-        afr_compound_cbk_t compound_cbk;
d1681e
-        int ret = 0;
d1681e
-        int op_errno = ENOMEM;
d1681e
-
d1681e
-        local = frame->local;
d1681e
-        priv = this->private;
d1681e
-
d1681e
-        /* If lock failed on all, just unlock and unwind */
d1681e
-        ret = afr_changelog_prepare (this, frame, &call_count, changelog_resume,
d1681e
-                                     op, &xdata, &newloc_xdata);
d1681e
-
d1681e
-        if (ret)
d1681e
-                return 0;
d1681e
-
d1681e
-        local->call_count = call_count;
d1681e
-
d1681e
-        afr_save_lk_owner (frame);
d1681e
-        frame->root->lk_owner =
d1681e
-                local->transaction.main_frame->root->lk_owner;
d1681e
-
d1681e
-        args = compound_fop_alloc (2, GF_CFOP_XATTROP_WRITEV, NULL);
d1681e
-
d1681e
-        if (!args)
d1681e
-                goto err;
d1681e
-
d1681e
-        /* pack pre-op part */
d1681e
-        i = 0;
d1681e
-        COMPOUND_PACK_ARGS (fxattrop, GF_FOP_FXATTROP,
d1681e
-                            args, i,
d1681e
-                            local->fd, GF_XATTROP_ADD_ARRAY,
d1681e
-                            xattr, xdata);
d1681e
-        i++;
d1681e
-        /* pack whatever fop needs to be packed
d1681e
-         * @compound_cbk holds the cbk that would need to be called
d1681e
-         */
d1681e
-        compound_cbk = afr_pack_fop_args (frame, args, local->op, i);
d1681e
-
d1681e
-        local->c_args = args;
d1681e
-
d1681e
-        for (i = 0; i < priv->child_count; i++) {
d1681e
-                /* Means lock did not succeed on this brick */
d1681e
-                if (!local->transaction.pre_op[i] ||
d1681e
-                    local->transaction.failed_subvols[i])
d1681e
-                        continue;
d1681e
-
d1681e
-                STACK_WIND_COOKIE (frame, compound_cbk,
d1681e
-                                   (void *) (long) i,
d1681e
-                                   priv->children[i],
d1681e
-                                   priv->children[i]->fops->compound,
d1681e
-                                   args,
d1681e
-                                   NULL);
d1681e
-                if (!--call_count)
d1681e
-                        break;
d1681e
-        }
d1681e
-
d1681e
-        if (xdata)
d1681e
-                dict_unref (xdata);
d1681e
-        if (newloc_xdata)
d1681e
-                dict_unref (newloc_xdata);
d1681e
-        return 0;
d1681e
-err:
d1681e
-	local->internal_lock.lock_cbk = local->transaction.done;
d1681e
-	local->op_ret = -1;
d1681e
-	local->op_errno = op_errno;
d1681e
-
d1681e
-        afr_restore_lk_owner (frame);
d1681e
-	afr_unlock (frame, this);
d1681e
-
d1681e
-        if (xdata)
d1681e
-                dict_unref (xdata);
d1681e
-        if (newloc_xdata)
d1681e
-                dict_unref (newloc_xdata);
d1681e
-	return 0;
d1681e
-}
d1681e
-
d1681e
-int
d1681e
-afr_post_op_unlock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
d1681e
-                       int op_ret, int op_errno,
d1681e
-                       void *data, dict_t *xdata)
d1681e
-{
d1681e
-        afr_local_t *local = NULL;
d1681e
-        int call_count = -1;
d1681e
-        afr_internal_lock_t *int_lock = NULL;
d1681e
-        int32_t             child_index = (long)cookie;
d1681e
-
d1681e
-        local = frame->local;
d1681e
-        child_index = (long) cookie;
d1681e
-
d1681e
-        local = frame->local;
d1681e
-        int_lock = &local->internal_lock;
d1681e
-
d1681e
-        afr_update_uninodelk (local, int_lock, child_index);
d1681e
-
d1681e
-        LOCK (&frame->lock);
d1681e
-        {
d1681e
-                call_count = --int_lock->lk_call_count;
d1681e
-        }
d1681e
-        UNLOCK (&frame->lock);
d1681e
-
d1681e
-        if (call_count == 0) {
d1681e
-                compound_args_cleanup (local->c_args);
d1681e
-                local->c_args = NULL;
d1681e
-                if (local->transaction.resume_stub) {
d1681e
-                        call_resume (local->transaction.resume_stub);
d1681e
-                        local->transaction.resume_stub = NULL;
d1681e
-                }
d1681e
-                gf_msg_trace (this->name, 0,
d1681e
-                              "All internal locks unlocked");
d1681e
-                int_lock->lock_cbk (frame, this);
d1681e
-        }
d1681e
-
d1681e
-        return 0;
d1681e
-}
d1681e
-
d1681e
-int
d1681e
-afr_post_op_unlock_do (call_frame_t *frame, xlator_t *this, dict_t *xattr,
d1681e
-		       afr_changelog_resume_t changelog_resume,
d1681e
-                       afr_xattrop_type_t op)
d1681e
-{
d1681e
-	afr_local_t             *local          = NULL;
d1681e
-	afr_private_t           *priv           = NULL;
d1681e
-        dict_t                  *xdata          = NULL;
d1681e
-        dict_t                  *newloc_xdata   = NULL;
d1681e
-        compound_args_t         *args           = NULL;
d1681e
-        afr_internal_lock_t     *int_lock       = NULL;
d1681e
-        afr_inodelk_t           *inodelk        = NULL;
d1681e
-	int                     i               = 0;
d1681e
-	int                     call_count      = 0;
d1681e
-        struct gf_flock         flock           = {0,};
d1681e
-        int                     ret             = 0;
d1681e
-
d1681e
-	local = frame->local;
d1681e
-	priv = this->private;
d1681e
-        int_lock = &local->internal_lock;
d1681e
-
d1681e
-        if (afr_is_inodelk_transaction(local)) {
d1681e
-                inodelk = afr_get_inodelk (int_lock, int_lock->domain);
d1681e
-
d1681e
-                flock.l_start = inodelk->flock.l_start;
d1681e
-                flock.l_len   = inodelk->flock.l_len;
d1681e
-                flock.l_type  = F_UNLCK;
d1681e
-        }
d1681e
-
d1681e
-        ret = afr_changelog_prepare (this, frame, &call_count, changelog_resume,
d1681e
-                                     op, &xdata, &newloc_xdata);
d1681e
-
d1681e
-        if (ret)
d1681e
-                return 0;
d1681e
-
d1681e
-        int_lock->lk_call_count = call_count;
d1681e
-
d1681e
-        int_lock->lock_cbk = local->transaction.done;
d1681e
-
d1681e
-        args = compound_fop_alloc (2, GF_CFOP_XATTROP_UNLOCK, NULL);
d1681e
-
d1681e
-        if (!args) {
d1681e
-		local->op_ret = -1;
d1681e
-		local->op_errno = ENOMEM;
d1681e
-		afr_changelog_post_op_done (frame, this);
d1681e
-		goto out;
d1681e
-	}
d1681e
-
d1681e
-        i = 0;
d1681e
-        COMPOUND_PACK_ARGS (fxattrop, GF_FOP_FXATTROP,
d1681e
-                            args, i,
d1681e
-                            local->fd, GF_XATTROP_ADD_ARRAY,
d1681e
-                            xattr, xdata);
d1681e
-        i++;
d1681e
-
d1681e
-        if (afr_is_inodelk_transaction(local)) {
d1681e
-                if (local->fd) {
d1681e
-                        COMPOUND_PACK_ARGS (finodelk, GF_FOP_FINODELK,
d1681e
-                                            args, i,
d1681e
-                                            int_lock->domain, local->fd,
d1681e
-                                            F_SETLK, &flock, NULL);
d1681e
-                } else {
d1681e
-                        COMPOUND_PACK_ARGS (inodelk, GF_FOP_INODELK,
d1681e
-                                            args, i,
d1681e
-                                            int_lock->domain, &local->loc,
d1681e
-                                            F_SETLK, &flock, NULL);
d1681e
-                }
d1681e
-        }
d1681e
-
d1681e
-        local->c_args = args;
d1681e
-
d1681e
-        for (i = 0; i < priv->child_count; i++) {
d1681e
-                if (!local->transaction.pre_op[i] ||
d1681e
-                    local->transaction.failed_subvols[i])
d1681e
-                        continue;
d1681e
-                STACK_WIND_COOKIE (frame, afr_post_op_unlock_cbk,
d1681e
-                                   (void *) (long) i,
d1681e
-                                   priv->children[i],
d1681e
-                                   priv->children[i]->fops->compound,
d1681e
-                                   args,
d1681e
-                                   NULL);
d1681e
-                if (!--call_count)
d1681e
-                        break;
d1681e
-        }
d1681e
-out:
d1681e
-        if (xdata)
d1681e
-                dict_unref (xdata);
d1681e
-        if (newloc_xdata)
d1681e
-                dict_unref (newloc_xdata);
d1681e
-        return 0;
d1681e
-}
d1681e
-
d1681e
-int
d1681e
 afr_changelog_do (call_frame_t *frame, xlator_t *this, dict_t *xattr,
d1681e
 		  afr_changelog_resume_t changelog_resume,
d1681e
                   afr_xattrop_type_t op)
d1681e
@@ -1793,21 +1481,8 @@ afr_changelog_pre_op (call_frame_t *frame, xlator_t *this)
d1681e
 		goto next;
d1681e
 	}
d1681e
 
d1681e
-	/* Till here we have already decided if pre-op needs to be done,
d1681e
-         * based on various criteria. The only thing that needs to be checked
d1681e
-         * now on is whether compound-fops is enabled or not.
d1681e
-         * If it is, then perform pre-op and fop together for writev op.
d1681e
-         */
d1681e
-        if (afr_can_compound_pre_op_and_op (priv, local->op)) {
d1681e
-                local->compound = _gf_true;
d1681e
-                afr_pre_op_fop_do (frame, this, xdata_req,
d1681e
-                                   afr_transaction_perform_fop,
d1681e
-                                   AFR_TRANSACTION_PRE_OP);
d1681e
-        } else {
d1681e
-                afr_changelog_do (frame, this, xdata_req,
d1681e
-                                  afr_transaction_perform_fop,
d1681e
-                                  AFR_TRANSACTION_PRE_OP);
d1681e
-        }
d1681e
+        afr_changelog_do (frame, this, xdata_req, afr_transaction_perform_fop,
d1681e
+                          AFR_TRANSACTION_PRE_OP);
d1681e
 
d1681e
 	if (xdata_req)
d1681e
 		dict_unref (xdata_req);
d1681e
diff --git a/xlators/cluster/afr/src/afr-transaction.h b/xlators/cluster/afr/src/afr-transaction.h
d1681e
index dd19e5b..d01e144 100644
d1681e
--- a/xlators/cluster/afr/src/afr-transaction.h
d1681e
+++ b/xlators/cluster/afr/src/afr-transaction.h
d1681e
@@ -58,7 +58,5 @@ afr_pick_error_xdata (afr_local_t *local, afr_private_t *priv,
d1681e
                       inode_t *inode1, unsigned char *readable1,
d1681e
                       inode_t *inode2, unsigned char *readable2);
d1681e
 int
d1681e
-afr_pre_op_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
d1681e
-                       int op_ret, int op_errno,
d1681e
-                       void *data, dict_t *xdata);
d1681e
+afr_transaction_resume (call_frame_t *frame, xlator_t *this);
d1681e
 #endif /* __TRANSACTION_H__ */
d1681e
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
d1681e
index aa48e76..9ed0481 100644
d1681e
--- a/xlators/cluster/afr/src/afr.c
d1681e
+++ b/xlators/cluster/afr/src/afr.c
d1681e
@@ -245,9 +245,6 @@ reconfigure (xlator_t *this, dict_t *options)
d1681e
         GF_OPTION_RECONF ("locking-scheme", priv->locking_scheme, options, str,
d1681e
                           out);
d1681e
         GF_OPTION_RECONF ("full-lock", priv->full_lock, options, bool, out);
d1681e
-        GF_OPTION_RECONF ("use-compound-fops", priv->use_compound_fops,
d1681e
-                          options, bool,
d1681e
-                          out);
d1681e
         GF_OPTION_RECONF ("granular-entry-heal", priv->esh_granular, options,
d1681e
                           bool, out);
d1681e
 
d1681e
@@ -536,8 +533,6 @@ init (xlator_t *this)
d1681e
         GF_OPTION_INIT ("pre-op-compat", priv->pre_op_compat, bool, out);
d1681e
         GF_OPTION_INIT ("locking-scheme", priv->locking_scheme, str, out);
d1681e
         GF_OPTION_INIT ("full-lock", priv->full_lock, bool, out);
d1681e
-        GF_OPTION_INIT ("use-compound-fops", priv->use_compound_fops,
d1681e
-                        bool, out);
d1681e
         GF_OPTION_INIT ("granular-entry-heal", priv->esh_granular, bool, out);
d1681e
 
d1681e
         GF_OPTION_INIT ("eager-lock", priv->eager_lock, bool, out);
d1681e
@@ -1121,9 +1116,8 @@ struct volume_options options[] = {
d1681e
         { .key   = {"use-compound-fops"},
d1681e
           .type  = GF_OPTION_TYPE_BOOL,
d1681e
           .default_value = "no",
d1681e
-          .description = "Use compound fops framework to modify afr "
d1681e
-                         "transaction such that network roundtrips are "
d1681e
-                         "reduced, thus improving the performance.",
d1681e
+          .description = "this option exists only for backward compatibility "
d1681e
+                         "and configuring it doesn't have any effect"
d1681e
         },
d1681e
         { .key  = {NULL} },
d1681e
 };
d1681e
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
d1681e
index 11278fb..a5b0d3b 100644
d1681e
--- a/xlators/cluster/afr/src/afr.h
d1681e
+++ b/xlators/cluster/afr/src/afr.h
d1681e
@@ -44,10 +44,6 @@ typedef int (*afr_inode_refresh_cbk_t) (call_frame_t *frame, xlator_t *this, int
d1681e
 
d1681e
 typedef int (*afr_changelog_resume_t) (call_frame_t *frame, xlator_t *this);
d1681e
 
d1681e
-typedef int (*afr_compound_cbk_t) (call_frame_t *frame, void *cookie,
d1681e
-                                   xlator_t *this, int op_ret, int op_errno,
d1681e
-                                   void *data, dict_t *xdata);
d1681e
-
d1681e
 #define AFR_COUNT(array,max) ({int __i; int __res = 0; for (__i = 0; __i < max; __i++) if (array[__i]) __res++; __res;})
d1681e
 #define AFR_INTERSECT(dst,src1,src2,max) ({int __i; for (__i = 0; __i < max; __i++) dst[__i] = src1[__i] && src2[__i];})
d1681e
 #define AFR_CMP(a1,a2,len) ({int __cmp = 0; int __i; for (__i = 0; __i < len; __i++) if (a1[__i] != a2[__i]) { __cmp = 1; break;} __cmp;})
d1681e
@@ -181,7 +177,6 @@ typedef struct _afr_private {
d1681e
         gf_boolean_t           full_lock;
d1681e
         gf_boolean_t           esh_granular;
d1681e
         gf_boolean_t           consistent_io;
d1681e
-        gf_boolean_t           use_compound_fops;
d1681e
 } afr_private_t;
d1681e
 
d1681e
 
d1681e
@@ -843,9 +838,7 @@ typedef struct _afr_local {
d1681e
         call_frame_t *heal_frame;
d1681e
 
d1681e
         gf_boolean_t need_full_crawl;
d1681e
-        gf_boolean_t compound;
d1681e
         afr_fop_lock_state_t fop_lock_state;
d1681e
-        compound_args_t *c_args;
d1681e
 
d1681e
         gf_boolean_t is_read_txn;
d1681e
         afr_inode_ctx_t *inode_ctx;
d1681e
@@ -1252,12 +1245,6 @@ afr_writev_copy_outvars (call_frame_t *src_frame, call_frame_t *dst_frame);
d1681e
 void
d1681e
 afr_update_uninodelk (afr_local_t *local, afr_internal_lock_t *int_lock,
d1681e
                     int32_t child_index);
d1681e
-gf_boolean_t
d1681e
-afr_can_compound_pre_op_and_op (afr_private_t *priv, glusterfs_fop_t fop);
d1681e
-
d1681e
-afr_compound_cbk_t
d1681e
-afr_pack_fop_args (call_frame_t *frame, compound_args_t *args,
d1681e
-                   glusterfs_fop_t fop, int index);
d1681e
 int
d1681e
 afr_is_inodelk_transaction(afr_local_t *local);
d1681e
 
d1681e
-- 
d1681e
1.8.3.1
d1681e