diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-11-24 07:41:36 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-11-24 05:23:04 -0800 |
commit | 3fe840d93730f1f7feef053e58dfbc40f99cae04 (patch) | |
tree | a23495e515d611e062f80d30ba3217f3565407d3 | |
parent | 4a43031ce0f045b673a50159dce5316bcae825ee (diff) |
cluster/afr: Fix inode context bitmasks.
Set opendir_done and split_brain flags correctly
in the inode context.
Signed-off-by: Vikas Gorur <vikas@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 249 (Self heal of a file that does not exist on the first subvolume)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=249
-rw-r--r-- | xlators/cluster/afr/src/afr-dir-read.c | 4 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 8 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr.c | 12 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 4 |
4 files changed, 11 insertions, 17 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c index ac0663ad971..ed052589c83 100644 --- a/xlators/cluster/afr/src/afr-dir-read.c +++ b/xlators/cluster/afr/src/afr-dir-read.c @@ -57,7 +57,7 @@ afr_examine_dir_completion_cbk (call_frame_t *frame, xlator_t *this) local = frame->local; sh = &local->self_heal; - afr_set_opendir_done (this, local->fd->inode, 1); + afr_set_opendir_done (this, local->fd->inode); /* let self-heal's local cleanup free this */ local->cont.opendir.checksum = NULL; @@ -167,7 +167,7 @@ out: afr_self_heal (frame, this, afr_examine_dir_completion_cbk); } else { - afr_set_opendir_done (this, local->fd->inode, 1); + afr_set_opendir_done (this, local->fd->inode); AFR_STACK_UNWIND (opendir, frame, local->op_ret, local->op_errno, local->fd); diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 8142bdf1de1..a60331d51bf 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1405,9 +1405,7 @@ afr_bgsh_completion_cbk (call_frame_t *bgsh_frame, xlator_t *this) sh = &local->self_heal; if (local->govinda_gOvinda) { - afr_set_split_brain (this, local->cont.lookup.inode, 1); - } else { - afr_set_split_brain (this, local->cont.lookup.inode, 0); + afr_set_split_brain (this, local->cont.lookup.inode); } gf_log (this->name, GF_LOG_TRACE, @@ -1444,9 +1442,7 @@ afr_bgsh_unwind (call_frame_t *bgsh_frame, xlator_t *this) sh = &local->self_heal; if (local->govinda_gOvinda) { - afr_set_split_brain (this, local->cont.lookup.inode, 1); - } else { - afr_set_split_brain (this, local->cont.lookup.inode, 0); + afr_set_split_brain (this, local->cont.lookup.inode); } gf_log (this->name, GF_LOG_TRACE, diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 3f1928157a9..d6c1d8bcf7f 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -88,7 +88,7 @@ out: void -afr_set_split_brain (xlator_t *this, inode_t *inode, int32_t split_brain) +afr_set_split_brain (xlator_t *this, inode_t *inode) { uint64_t ctx = 0; int ret = 0; @@ -104,7 +104,7 @@ afr_set_split_brain (xlator_t *this, inode_t *inode, int32_t split_brain) } ctx = (~AFR_ICTX_SPLIT_BRAIN_MASK & ctx) - | (split_brain & AFR_ICTX_SPLIT_BRAIN_MASK); + | (0xFFFFFFFFFFFFFFFFULL & AFR_ICTX_SPLIT_BRAIN_MASK); __inode_ctx_put (inode, this, ctx); } @@ -142,7 +142,7 @@ out: void -afr_set_opendir_done (xlator_t *this, inode_t *inode, int32_t opendir_done) +afr_set_opendir_done (xlator_t *this, inode_t *inode) { uint64_t ctx = 0; int ret = 0; @@ -158,7 +158,7 @@ afr_set_opendir_done (xlator_t *this, inode_t *inode, int32_t opendir_done) } ctx = (~AFR_ICTX_OPENDIR_DONE_MASK & ctx) - | (opendir_done & AFR_ICTX_OPENDIR_DONE_MASK); + | (0xFFFFFFFFFFFFFFFFULL & AFR_ICTX_OPENDIR_DONE_MASK); __inode_ctx_put (inode, this, ctx); } @@ -474,9 +474,7 @@ afr_self_heal_cbk (call_frame_t *frame, xlator_t *this) local = frame->local; if (local->govinda_gOvinda) { - afr_set_split_brain (this, local->cont.lookup.inode, 1); - } else { - afr_set_split_brain (this, local->cont.lookup.inode, 0); + afr_set_split_brain (this, local->cont.lookup.inode); } AFR_STACK_UNWIND (lookup, frame, local->op_ret, local->op_errno, diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 2d497afe1d8..3bd8a458bc2 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -551,10 +551,10 @@ int afr_frame_return (call_frame_t *frame); void -afr_set_split_brain (xlator_t *this, inode_t *inode, int32_t split_brain); +afr_set_split_brain (xlator_t *this, inode_t *inode); void -afr_set_opendir_done (xlator_t *this, inode_t *inode, int32_t opendir_done); +afr_set_opendir_done (xlator_t *this, inode_t *inode); uint64_t afr_is_opendir_done (xlator_t *this, inode_t *inode); |