summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-write.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2018-03-02 12:37:42 +0530
committerRavishankar N <ravishankar@redhat.com>2018-03-06 08:49:31 +0000
commit51d34907986fba09a560aa18238944811fc47b6a (patch)
treede96fb509f9f51d2d59ff9c781bbb423a7bb38b0 /xlators/cluster/afr/src/afr-inode-write.c
parent4511b45bf4d13581cd74c4b87495eda6d54ec5be (diff)
cluster/afr: Remove unused code paths
Removed 1) afr-v1 self-heal locks related code which is not used anymore 2) transaction has some data types that are not needed, so removed them 3) Never used lock tracing available in afr as gluster's network tracing does the job. So removed that as well. 4) Changelog is always enabled and afr is always used with locks, so __changelog_enabled, afr_lock_server_count etc functions can be deleted. 5) transaction.fop/done/resume always call the same functions, so no need to have these variables. BUG: 1549606 Change-Id: I370c146fec2892d40e674d232a5d7256e003c7f1 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c39
1 files changed, 3 insertions, 36 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 60c459d8463..8893a7db670 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -210,7 +210,7 @@ __afr_inode_write_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->transaction.unwind (frame, this);
}
- local->transaction.resume (frame, this);
+ afr_transaction_resume (frame, this);
}
return 0;
@@ -360,13 +360,10 @@ afr_writev_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata)
{
- afr_local_t *local = NULL;
call_frame_t *fop_frame = NULL;
int child_index = (long) cookie;
int call_count = -1;
- local = frame->local;
-
afr_inode_write_fill (frame, this, child_index, op_ret, op_errno,
prebuf, postbuf, xdata);
@@ -377,7 +374,7 @@ afr_writev_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (!afr_txn_nothing_failed (frame, this)) {
//Don't unwind until post-op is complete
- local->transaction.resume (frame, this);
+ afr_transaction_resume (frame, this);
} else {
/*
* Generally inode-write fops do transaction.unwind then
@@ -392,7 +389,7 @@ afr_writev_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
fop_frame = afr_transaction_detach_fop_frame (frame);
afr_writev_copy_outvars (frame, fop_frame);
- local->transaction.resume (frame, this);
+ afr_transaction_resume (frame, this);
afr_writev_unwind (fop_frame, this);
}
}
@@ -465,8 +462,6 @@ afr_do_writev (call_frame_t *frame, xlator_t *this)
local->op = GF_FOP_WRITE;
local->transaction.wind = afr_writev_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_transaction_writev_unwind;
local->transaction.main_frame = frame;
@@ -655,8 +650,6 @@ afr_truncate (call_frame_t *frame, xlator_t *this,
goto out;
local->transaction.wind = afr_truncate_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_truncate_unwind;
loc_copy (&local->loc, loc);
@@ -783,8 +776,6 @@ afr_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
local->op = GF_FOP_FTRUNCATE;
local->transaction.wind = afr_ftruncate_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_ftruncate_unwind;
local->transaction.main_frame = frame;
@@ -891,8 +882,6 @@ afr_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *buf,
goto out;
local->transaction.wind = afr_setattr_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_setattr_unwind;
loc_copy (&local->loc, loc);
@@ -998,8 +987,6 @@ afr_fsetattr (call_frame_t *frame, xlator_t *this,
goto out;
local->transaction.wind = afr_fsetattr_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_fsetattr_unwind;
local->fd = fd_ref (fd);
@@ -1642,8 +1629,6 @@ afr_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
goto out;
local->transaction.wind = afr_setxattr_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_setxattr_unwind;
loc_copy (&local->loc, loc);
@@ -1756,8 +1741,6 @@ afr_fsetxattr (call_frame_t *frame, xlator_t *this,
goto out;
local->transaction.wind = afr_fsetxattr_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_fsetxattr_unwind;
local->fd = fd_ref (fd);
@@ -1871,8 +1854,6 @@ afr_removexattr (call_frame_t *frame, xlator_t *this,
goto out;
local->transaction.wind = afr_removexattr_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_removexattr_unwind;
loc_copy (&local->loc, loc);
@@ -1980,8 +1961,6 @@ afr_fremovexattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
goto out;
local->transaction.wind = afr_fremovexattr_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_fremovexattr_unwind;
local->fd = fd_ref (fd);
@@ -2097,8 +2076,6 @@ afr_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
local->op = GF_FOP_FALLOCATE;
local->transaction.wind = afr_fallocate_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_fallocate_unwind;
local->transaction.main_frame = frame;
@@ -2211,8 +2188,6 @@ afr_discard (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
local->op = GF_FOP_DISCARD;
local->transaction.wind = afr_discard_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_discard_unwind;
local->transaction.main_frame = frame;
@@ -2322,8 +2297,6 @@ afr_zerofill (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
local->op = GF_FOP_ZEROFILL;
local->transaction.wind = afr_zerofill_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_zerofill_unwind;
local->transaction.main_frame = frame;
@@ -2416,8 +2389,6 @@ afr_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
local->xdata_req = dict_ref (xdata);
local->transaction.wind = afr_xattrop_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_xattrop_unwind;
loc_copy (&local->loc, loc);
@@ -2512,8 +2483,6 @@ afr_fxattrop (call_frame_t *frame, xlator_t *this, fd_t *fd,
local->xdata_req = dict_ref (xdata);
local->transaction.wind = afr_fxattrop_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_fxattrop_unwind;
local->fd = fd_ref (fd);
@@ -2629,8 +2598,6 @@ afr_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync,
}
local->transaction.wind = afr_fsync_wind;
- local->transaction.fop = __afr_txn_write_fop;
- local->transaction.done = __afr_txn_write_done;
local->transaction.unwind = afr_fsync_unwind;
local->transaction.main_frame = frame;