diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-03-24 12:09:52 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-04-06 22:35:07 -0700 |
commit | 6e7d9a4e77a764e86bcde4e704ec05a3c84f9c11 (patch) | |
tree | 1107ff62bac604d5b05df73281a00e6d1a22cb9a /xlators/cluster/ec/src/ec-dir-write.c | |
parent | 0e23ce3fbcf1f138105476cf3b86342268e259d9 (diff) |
cluster/ec: Refactor inode-writev
All _cbk() functions in inode-write.c do same things, i.e. store
op_ret/op_errno, stat structures if they are available and combine them. Moved
this common operation into one function ec_inode_write_cbk() and made all the
other _cbk() functions to use this instead.
Change-Id: I2387b9f2d9598ced6299a26ea1900e9deb9fadc4
BUG: 1199767
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9981
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-dir-write.c')
-rw-r--r-- | xlators/cluster/ec/src/ec-dir-write.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/xlators/cluster/ec/src/ec-dir-write.c b/xlators/cluster/ec/src/ec-dir-write.c index 5aa0b400cd6..866f5120bf6 100644 --- a/xlators/cluster/ec/src/ec-dir-write.c +++ b/xlators/cluster/ec/src/ec-dir-write.c @@ -17,42 +17,6 @@ #include "ec-method.h" #include "ec-fops.h" -int32_t -ec_combine_dirwrite (ec_fop_data_t *fop, ec_cbk_data_t *dst, - ec_cbk_data_t *src) -{ - int valid = 0; - switch (fop->id) { - case GF_FOP_SYMLINK: - case GF_FOP_LINK: - case GF_FOP_CREATE: - case GF_FOP_MKNOD: - case GF_FOP_MKDIR: - valid = 3; - break; - case GF_FOP_UNLINK: - case GF_FOP_RMDIR: - valid = 2; - break; - case GF_FOP_RENAME: - valid = 5; - break; - default: - gf_log_callingfn (fop->xl->name, GF_LOG_WARNING, "Invalid fop " - "%d", fop->id); - return 0; - break; - } - - if (!ec_iatt_combine(dst->iatt, src->iatt, valid)) { - gf_log(fop->xl->name, GF_LOG_NOTICE, "Mismatching iatt in " - "answers of '%s'", gf_fop_list[fop->id]); - - return 0; - } - return 1; -} - int ec_dir_write_cbk (call_frame_t *frame, xlator_t *this, void *cookie, int op_ret, int op_errno, @@ -104,7 +68,7 @@ ec_dir_write_cbk (call_frame_t *frame, xlator_t *this, out: if (cbk) - ec_combine (cbk, ec_combine_dirwrite); + ec_combine (cbk, ec_combine_write); if (fop) ec_complete (fop); return 0; |