diff options
author | Amar Tumballi <amar@gluster.com> | 2011-06-16 07:48:22 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-16 23:24:56 -0700 |
commit | 4e1ec35ef4f7bbf70c3e08e7c246946551f19e93 (patch) | |
tree | 0a932e17c9554a2c31be469c41190a16450b67fe /xlators/cluster/afr/src/afr-dir-write.c | |
parent | f04898973f15cfa13fcf39a903786983885352bc (diff) |
core: fill 'ia_ino' from 'ia_gfid' in 'storage/posix' to preserve same ino number
take the least significant 64bit from gfid and assign it to 'ia_ino',
hence for a given file (or directory), the 'ia_ino' number is always
same, and we need not worry about the 'itransform' in 'cluster/*'
translators.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 3042 (inode number should be constant on storage)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3042
Diffstat (limited to 'xlators/cluster/afr/src/afr-dir-write.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-dir-write.c | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c index 30fcf92b60a..88c3f728f49 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -101,11 +101,6 @@ afr_create_unwind (call_frame_t *frame, xlator_t *this) unwind_buf = &local->cont.create.buf; } - unwind_buf->ia_ino = local->cont.create.ino; - - local->cont.create.preparent.ia_ino = local->cont.create.parent_ino; - local->cont.create.postparent.ia_ino = local->cont.create.parent_ino; - AFR_STACK_UNWIND (create, main_frame, local->op_ret, local->op_errno, local->cont.create.fd, @@ -174,11 +169,6 @@ afr_create_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->success_count == 0) { local->cont.create.buf = *buf; - local->cont.create.ino = - afr_itransform (buf->ia_ino, - priv->child_count, - child_index); - if (priv->read_child >= 0) { afr_set_read_child (this, inode, priv->read_child); @@ -188,13 +178,6 @@ afr_create_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } } - if (child_index == local->first_up_child) { - local->cont.create.ino = - afr_itransform (buf->ia_ino, - priv->child_count, - local->first_up_child); - } - if (child_index == local->read_child_index) { local->cont.create.read_child_buf = *buf; local->cont.create.preparent = *preparent; @@ -382,11 +365,6 @@ afr_mknod_unwind (call_frame_t *frame, xlator_t *this) unwind_buf = &local->cont.mknod.buf; } - unwind_buf->ia_ino = local->cont.mknod.ino; - - local->cont.mknod.preparent.ia_ino = local->cont.mknod.parent_ino; - local->cont.mknod.postparent.ia_ino = local->cont.mknod.parent_ino; - AFR_STACK_UNWIND (mknod, main_frame, local->op_ret, local->op_errno, local->cont.mknod.inode, @@ -424,10 +402,6 @@ afr_mknod_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->success_count == 0){ local->cont.mknod.buf = *buf; - local->cont.mknod.ino = - afr_itransform (buf->ia_ino, - priv->child_count, - child_index); if (priv->read_child >= 0) { afr_set_read_child (this, inode, @@ -438,13 +412,6 @@ afr_mknod_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } } - if (child_index == local->first_up_child) { - local->cont.mknod.ino = - afr_itransform (buf->ia_ino, - priv->child_count, - local->first_up_child); - } - if (child_index == local->read_child_index) { local->cont.mknod.read_child_buf = *buf; local->cont.mknod.preparent = *preparent; @@ -625,11 +592,6 @@ afr_mkdir_unwind (call_frame_t *frame, xlator_t *this) unwind_buf = &local->cont.mkdir.buf; } - unwind_buf->ia_ino = local->cont.mkdir.ino; - - local->cont.mkdir.preparent.ia_ino = local->cont.mkdir.parent_ino; - local->cont.mkdir.postparent.ia_ino = local->cont.mkdir.parent_ino; - AFR_STACK_UNWIND (mkdir, main_frame, local->op_ret, local->op_errno, local->cont.mkdir.inode, @@ -668,11 +630,6 @@ afr_mkdir_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->success_count == 0) { local->cont.mkdir.buf = *buf; - local->cont.mkdir.ino = - afr_itransform (buf->ia_ino, - priv->child_count, - child_index); - if (priv->read_child >= 0) { afr_set_read_child (this, inode, priv->read_child); @@ -682,13 +639,6 @@ afr_mkdir_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } } - if (child_index == local->first_up_child) { - local->cont.mkdir.ino = - afr_itransform (buf->ia_ino, - priv->child_count, - local->first_up_child); - } - if (child_index == local->read_child_index) { local->cont.mkdir.read_child_buf = *buf; local->cont.mkdir.preparent = *preparent; @@ -870,11 +820,6 @@ afr_link_unwind (call_frame_t *frame, xlator_t *this) unwind_buf = &local->cont.link.buf; } - unwind_buf->ia_ino = local->cont.link.ino; - - local->cont.link.preparent.ia_ino = local->cont.link.parent_ino; - local->cont.link.postparent.ia_ino = local->cont.link.parent_ino; - AFR_STACK_UNWIND (link, main_frame, local->op_ret, local->op_errno, local->cont.link.inode, @@ -1100,11 +1045,6 @@ afr_symlink_unwind (call_frame_t *frame, xlator_t *this) unwind_buf = &local->cont.symlink.buf; } - unwind_buf->ia_ino = local->cont.symlink.ino; - - local->cont.symlink.preparent.ia_ino = local->cont.symlink.parent_ino; - local->cont.symlink.postparent.ia_ino = local->cont.symlink.parent_ino; - AFR_STACK_UNWIND (symlink, main_frame, local->op_ret, local->op_errno, local->cont.symlink.inode, @@ -1142,10 +1082,6 @@ afr_symlink_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->success_count == 0) { local->cont.symlink.buf = *buf; - local->cont.symlink.ino = - afr_itransform (buf->ia_ino, priv->child_count, - child_index); - if (priv->read_child >= 0) { afr_set_read_child (this, inode, priv->read_child); @@ -1155,13 +1091,6 @@ afr_symlink_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } } - if (child_index == local->first_up_child) { - local->cont.symlink.ino = - afr_itransform (buf->ia_ino, - priv->child_count, - local->first_up_child); - } - if (child_index == local->read_child_index) { local->cont.symlink.read_child_buf = *buf; local->cont.symlink.preparent = *preparent; @@ -1342,13 +1271,6 @@ afr_rename_unwind (call_frame_t *frame, xlator_t *this) unwind_buf = &local->cont.rename.buf; } - unwind_buf->ia_ino = local->cont.rename.ino; - - local->cont.rename.preoldparent.ia_ino = local->cont.rename.oldparent_ino; - local->cont.rename.postoldparent.ia_ino = local->cont.rename.oldparent_ino; - local->cont.rename.prenewparent.ia_ino = local->cont.rename.newparent_ino; - local->cont.rename.postnewparent.ia_ino = local->cont.rename.newparent_ino; - AFR_STACK_UNWIND (rename, main_frame, local->op_ret, local->op_errno, unwind_buf, @@ -1559,9 +1481,6 @@ afr_unlink_unwind (call_frame_t *frame, xlator_t *this) UNLOCK (&frame->lock); if (main_frame) { - local->cont.unlink.preparent.ia_ino = local->cont.unlink.parent_ino; - local->cont.unlink.postparent.ia_ino = local->cont.unlink.parent_ino; - AFR_STACK_UNWIND (unlink, main_frame, local->op_ret, local->op_errno, &local->cont.unlink.preparent, @@ -1759,9 +1678,6 @@ afr_rmdir_unwind (call_frame_t *frame, xlator_t *this) UNLOCK (&frame->lock); if (main_frame) { - local->cont.rmdir.preparent.ia_ino = local->cont.rmdir.parent_ino; - local->cont.rmdir.postparent.ia_ino = local->cont.rmdir.parent_ino; - AFR_STACK_UNWIND (rmdir, main_frame, local->op_ret, local->op_errno, &local->cont.rmdir.preparent, |