summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-write.c
diff options
context:
space:
mode:
authorAnand V. Avati <avati@amp.gluster.com>2010-10-18 00:16:31 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-18 03:25:46 -0700
commitf213c1b051d7e91e33a2e4631a9ef383ae48921e (patch)
treebd4fb173a3f2d099d6b2b7a7b8fe2c5dd32f2435 /xlators/cluster/afr/src/afr-inode-write.c
parent9be13aff89232c5ede11bdb37c49c2e5dca5d840 (diff)
replicate: replace first-write-to-flush optimization
use a changelog piggybacking optimization instead of first-write-to-flush optimization and do other cleanups (removal of post-post-op hook etc.) Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1235 (Bug for all pump/migrate commits) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1235
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index a7751e68e9c..8ebba6d4ad2 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -305,13 +305,9 @@ afr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
fd_ctx = (afr_fd_ctx_t *)(long) ctx;
- if (fd_ctx->down_count < priv->down_count) {
- local->up_down_flush_cbk = afr_do_writev;
- afr_up_down_flush (frame, this, fd, AFR_CHILD_DOWN_FLUSH);
-
- } else if (fd_ctx->up_count < priv->up_count) {
- local->up_down_flush_cbk = afr_do_writev;
- afr_up_down_flush (frame, this, fd, AFR_CHILD_UP_FLUSH);
+ if (fd_ctx->up_count < priv->up_count) {
+ local->openfd_flush_cbk = afr_do_writev;
+ afr_openfd_flush (frame, this, fd);
} else {
afr_do_writev (frame, this);
@@ -787,9 +783,9 @@ afr_ftruncate (call_frame_t *frame, xlator_t *this,
fd_ctx = (afr_fd_ctx_t *)(long) ctx;
- if (fd_ctx->down_count < priv->down_count) {
- local->up_down_flush_cbk = afr_do_ftruncate;
- afr_up_down_flush (frame, this, fd, AFR_CHILD_DOWN_FLUSH);
+ if (fd_ctx->up_count < priv->up_count) {
+ local->openfd_flush_cbk = afr_do_ftruncate;
+ afr_openfd_flush (frame, this, fd);
} else {
afr_do_ftruncate (frame, this);
}