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