summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c6
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.c146
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c16
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c40
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.h4
-rw-r--r--xlators/cluster/afr/src/afr-open.c6
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-algorithm.c12
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c63
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.h2
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c31
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c112
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-metadata.c36
-rw-r--r--xlators/cluster/afr/src/afr-self-heal.h10
-rw-r--r--xlators/cluster/afr/src/afr.c60
-rw-r--r--xlators/cluster/afr/src/afr.h100
15 files changed, 311 insertions, 333 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index 98cda1e809f..065221e1d74 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -153,7 +153,7 @@ out:
sh->need_entry_self_heal = _gf_true;
sh->forced_merge = _gf_true;
- sh->mode = local->fd->inode->st_mode;
+ sh->type = local->fd->inode->ia_type;
sh->background = _gf_false;
sh->unwind = afr_examine_dir_sh_unwind;
@@ -560,9 +560,9 @@ afr_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
inum = afr_itransform (entry->d_ino, priv->child_count,
child_index);
entry->d_ino = inum;
- inum = afr_itransform (entry->d_stat.st_ino,
+ inum = afr_itransform (entry->d_stat.ia_ino,
priv->child_count, child_index);
- entry->d_stat.st_ino = inum;
+ entry->d_stat.ia_ino = inum;
if ((local->fd->inode == local->fd->inode->table->root)
&& !strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)) {
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
index 8a6529bfb97..14d3e28c451 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -79,7 +79,7 @@ afr_create_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_private_t * priv = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
priv = this->private;
local = frame->local;
@@ -94,17 +94,17 @@ afr_create_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.create.read_child_buf.st_ino) {
+ if (local->cont.create.read_child_buf.ia_ino) {
unwind_buf = &local->cont.create.read_child_buf;
} else {
unwind_buf = &local->cont.create.buf;
}
- unwind_buf->st_ino = local->cont.create.ino;
- unwind_buf->st_dev = local->cont.create.gen;
+ unwind_buf->ia_ino = local->cont.create.ino;
+ unwind_buf->ia_gen = local->cont.create.gen;
- local->cont.create.preparent.st_ino = local->cont.create.parent_ino;
- local->cont.create.postparent.st_ino = local->cont.create.parent_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,
@@ -121,8 +121,8 @@ afr_create_unwind (call_frame_t *frame, xlator_t *this)
int
afr_create_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- fd_t *fd, inode_t *inode, struct stat *buf,
- struct stat *preparent, struct stat *postparent)
+ fd_t *fd, inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -176,10 +176,10 @@ afr_create_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->cont.create.buf = *buf;
local->cont.create.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
- local->cont.create.gen = buf->st_dev;
+ local->cont.create.gen = buf->ia_gen;
if (priv->read_child >= 0) {
afr_set_read_child (this, inode,
@@ -192,10 +192,10 @@ 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->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
local->first_up_child);
- local->cont.create.gen = buf->st_dev;
+ local->cont.create.gen = buf->ia_gen;
}
if (child_index == local->read_child_index) {
@@ -365,7 +365,7 @@ afr_mknod_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -379,17 +379,17 @@ afr_mknod_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.mknod.read_child_buf.st_ino) {
+ if (local->cont.mknod.read_child_buf.ia_ino) {
unwind_buf = &local->cont.mknod.read_child_buf;
} else {
unwind_buf = &local->cont.mknod.buf;
}
- unwind_buf->st_ino = local->cont.mknod.ino;
- unwind_buf->st_dev = local->cont.mknod.gen;
+ unwind_buf->ia_ino = local->cont.mknod.ino;
+ unwind_buf->ia_gen = local->cont.mknod.gen;
- local->cont.mknod.preparent.st_ino = local->cont.mknod.parent_ino;
- local->cont.mknod.postparent.st_ino = local->cont.mknod.parent_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,
@@ -405,8 +405,8 @@ afr_mknod_unwind (call_frame_t *frame, xlator_t *this)
int
afr_mknod_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct stat *buf, struct stat *preparent,
- struct stat *postparent)
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -430,10 +430,10 @@ 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->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
- local->cont.mknod.gen = buf->st_dev;
+ local->cont.mknod.gen = buf->ia_gen;
if (priv->read_child >= 0) {
afr_set_read_child (this, inode,
@@ -446,10 +446,10 @@ 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->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
local->first_up_child);
- local->cont.mknod.gen = buf->st_dev;
+ local->cont.mknod.gen = buf->ia_gen;
}
if (child_index == local->read_child_index) {
@@ -615,7 +615,7 @@ afr_mkdir_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -629,17 +629,17 @@ afr_mkdir_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.mkdir.read_child_buf.st_ino) {
+ if (local->cont.mkdir.read_child_buf.ia_ino) {
unwind_buf = &local->cont.mkdir.read_child_buf;
} else {
unwind_buf = &local->cont.mkdir.buf;
}
- unwind_buf->st_ino = local->cont.mkdir.ino;
- unwind_buf->st_dev = local->cont.mkdir.gen;
+ unwind_buf->ia_ino = local->cont.mkdir.ino;
+ unwind_buf->ia_gen = local->cont.mkdir.gen;
- local->cont.mkdir.preparent.st_ino = local->cont.mkdir.parent_ino;
- local->cont.mkdir.postparent.st_ino = local->cont.mkdir.parent_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,
@@ -655,8 +655,8 @@ afr_mkdir_unwind (call_frame_t *frame, xlator_t *this)
int
afr_mkdir_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct stat *buf, struct stat *preparent,
- struct stat *postparent)
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -681,10 +681,10 @@ afr_mkdir_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->cont.mkdir.buf = *buf;
local->cont.mkdir.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
- local->cont.mkdir.gen = buf->st_dev;
+ local->cont.mkdir.gen = buf->ia_gen;
if (priv->read_child >= 0) {
afr_set_read_child (this, inode,
@@ -697,10 +697,10 @@ 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->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
local->first_up_child);
- local->cont.mkdir.gen = buf->st_dev;
+ local->cont.mkdir.gen = buf->ia_gen;
}
if (child_index == local->read_child_index) {
@@ -867,7 +867,7 @@ afr_link_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -881,16 +881,16 @@ afr_link_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.link.read_child_buf.st_ino) {
+ if (local->cont.link.read_child_buf.ia_ino) {
unwind_buf = &local->cont.link.read_child_buf;
} else {
unwind_buf = &local->cont.link.buf;
}
- unwind_buf->st_ino = local->cont.link.ino;
+ unwind_buf->ia_ino = local->cont.link.ino;
- local->cont.link.preparent.st_ino = local->cont.link.parent_ino;
- local->cont.link.postparent.st_ino = local->cont.link.parent_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,
@@ -906,8 +906,8 @@ afr_link_unwind (call_frame_t *frame, xlator_t *this)
int
afr_link_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct stat *buf, struct stat *preparent,
- struct stat *postparent)
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1104,7 +1104,7 @@ afr_symlink_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -1118,17 +1118,17 @@ afr_symlink_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.symlink.read_child_buf.st_ino) {
+ if (local->cont.symlink.read_child_buf.ia_ino) {
unwind_buf = &local->cont.symlink.read_child_buf;
} else {
unwind_buf = &local->cont.symlink.buf;
}
- unwind_buf->st_ino = local->cont.symlink.ino;
- unwind_buf->st_dev = local->cont.symlink.gen;
+ unwind_buf->ia_ino = local->cont.symlink.ino;
+ unwind_buf->ia_gen = local->cont.symlink.gen;
- local->cont.symlink.preparent.st_ino = local->cont.symlink.parent_ino;
- local->cont.symlink.postparent.st_ino = local->cont.symlink.parent_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,
@@ -1144,8 +1144,8 @@ afr_symlink_unwind (call_frame_t *frame, xlator_t *this)
int
afr_symlink_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct stat *buf, struct stat *preparent,
- struct stat *postparent)
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1169,9 +1169,9 @@ 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->st_ino, priv->child_count,
+ afr_itransform (buf->ia_ino, priv->child_count,
child_index);
- local->cont.symlink.gen = buf->st_dev;
+ local->cont.symlink.gen = buf->ia_gen;
if (priv->read_child >= 0) {
afr_set_read_child (this, inode,
@@ -1184,10 +1184,10 @@ 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->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
local->first_up_child);
- local->cont.symlink.gen = buf->st_dev;
+ local->cont.symlink.gen = buf->ia_gen;
}
if (child_index == local->read_child_index) {
@@ -1353,7 +1353,7 @@ afr_rename_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -1367,18 +1367,18 @@ afr_rename_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.rename.read_child_buf.st_ino) {
+ if (local->cont.rename.read_child_buf.ia_ino) {
unwind_buf = &local->cont.rename.read_child_buf;
} else {
unwind_buf = &local->cont.rename.buf;
}
- unwind_buf->st_ino = local->cont.rename.ino;
+ unwind_buf->ia_ino = local->cont.rename.ino;
- local->cont.rename.preoldparent.st_ino = local->cont.rename.oldparent_ino;
- local->cont.rename.postoldparent.st_ino = local->cont.rename.oldparent_ino;
- local->cont.rename.prenewparent.st_ino = local->cont.rename.newparent_ino;
- local->cont.rename.postnewparent.st_ino = local->cont.rename.newparent_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,
@@ -1395,9 +1395,9 @@ afr_rename_unwind (call_frame_t *frame, xlator_t *this)
int
afr_rename_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *buf,
- struct stat *preoldparent, struct stat *postoldparent,
- struct stat *prenewparent, struct stat *postnewparent)
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ struct iatt *preoldparent, struct iatt *postoldparent,
+ struct iatt *prenewparent, struct iatt *postnewparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1599,8 +1599,8 @@ afr_unlink_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.unlink.preparent.st_ino = local->cont.unlink.parent_ino;
- local->cont.unlink.postparent.st_ino = local->cont.unlink.parent_ino;
+ 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,
@@ -1614,8 +1614,8 @@ afr_unlink_unwind (call_frame_t *frame, xlator_t *this)
int
afr_unlink_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *preparent,
- struct stat *postparent)
+ int32_t op_ret, int32_t op_errno, struct iatt *preparent,
+ struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1814,8 +1814,8 @@ afr_rmdir_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.rmdir.preparent.st_ino = local->cont.rmdir.parent_ino;
- local->cont.rmdir.postparent.st_ino = local->cont.rmdir.parent_ino;
+ 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,
@@ -1829,8 +1829,8 @@ afr_rmdir_unwind (call_frame_t *frame, xlator_t *this)
int
afr_rmdir_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *preparent,
- struct stat *postparent)
+ int32_t op_ret, int32_t op_errno, struct iatt *preparent,
+ struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index 3b89da9abdb..9ce1036755d 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -179,7 +179,7 @@ out:
int32_t
afr_stat_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -222,7 +222,7 @@ afr_stat_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
if (buf)
- buf->st_ino = local->cont.stat.ino;
+ buf->ia_ino = local->cont.stat.ino;
AFR_STACK_UNWIND (stat, frame, op_ret, op_errno, buf);
}
@@ -303,7 +303,7 @@ out:
int32_t
afr_fstat_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -346,7 +346,7 @@ afr_fstat_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
if (buf)
- buf->st_ino = local->cont.fstat.ino;
+ buf->ia_ino = local->cont.fstat.ino;
AFR_STACK_UNWIND (fstat, frame, op_ret, op_errno, buf);
}
@@ -428,7 +428,7 @@ out:
int32_t
afr_readlink_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- const char *buf, struct stat *sbuf)
+ const char *buf, struct iatt *sbuf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -471,7 +471,7 @@ afr_readlink_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
if (sbuf)
- sbuf->st_ino = local->cont.readlink.ino;
+ sbuf->ia_ino = local->cont.readlink.ino;
AFR_STACK_UNWIND (readlink, frame, op_ret, op_errno, buf, sbuf);
}
@@ -748,7 +748,7 @@ out:
int32_t
afr_readv_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- struct iovec *vector, int32_t count, struct stat *buf,
+ struct iovec *vector, int32_t count, struct iatt *buf,
struct iobref *iobref)
{
afr_private_t * priv = NULL;
@@ -803,7 +803,7 @@ afr_readv_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
if (buf)
- buf->st_ino = local->cont.readv.ino;
+ buf->ia_ino = local->cont.readv.ino;
AFR_STACK_UNWIND (readv, frame, op_ret, op_errno,
vector, count, buf, iobref);
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 32e93e6e2fe..7b7408bbc51 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -69,8 +69,8 @@ afr_writev_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.writev.prebuf.st_ino = local->cont.writev.ino;
- local->cont.writev.postbuf.st_ino = local->cont.writev.ino;
+ local->cont.writev.prebuf.ia_ino = local->cont.writev.ino;
+ local->cont.writev.postbuf.ia_ino = local->cont.writev.ino;
AFR_STACK_UNWIND (writev, main_frame,
local->op_ret, local->op_errno,
@@ -83,8 +83,8 @@ afr_writev_unwind (call_frame_t *frame, xlator_t *this)
int
afr_writev_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *prebuf,
- struct stat *postbuf)
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -350,8 +350,8 @@ afr_truncate_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.truncate.prebuf.st_ino = local->cont.truncate.ino;
- local->cont.truncate.postbuf.st_ino = local->cont.truncate.ino;
+ local->cont.truncate.prebuf.ia_ino = local->cont.truncate.ino;
+ local->cont.truncate.postbuf.ia_ino = local->cont.truncate.ino;
AFR_STACK_UNWIND (truncate, main_frame, local->op_ret,
local->op_errno,
@@ -365,8 +365,8 @@ afr_truncate_unwind (call_frame_t *frame, xlator_t *this)
int
afr_truncate_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *prebuf,
- struct stat *postbuf)
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -569,8 +569,8 @@ afr_ftruncate_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.ftruncate.prebuf.st_ino = local->cont.ftruncate.ino;
- local->cont.ftruncate.postbuf.st_ino = local->cont.ftruncate.ino;
+ local->cont.ftruncate.prebuf.ia_ino = local->cont.ftruncate.ino;
+ local->cont.ftruncate.postbuf.ia_ino = local->cont.ftruncate.ino;
AFR_STACK_UNWIND (ftruncate, main_frame, local->op_ret,
local->op_errno,
@@ -583,8 +583,8 @@ afr_ftruncate_unwind (call_frame_t *frame, xlator_t *this)
int
afr_ftruncate_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *prebuf,
- struct stat *postbuf)
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -828,8 +828,8 @@ afr_setattr_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.setattr.preop_buf.st_ino = local->cont.setattr.ino;
- local->cont.setattr.postop_buf.st_ino = local->cont.setattr.ino;
+ local->cont.setattr.preop_buf.ia_ino = local->cont.setattr.ino;
+ local->cont.setattr.postop_buf.ia_ino = local->cont.setattr.ino;
AFR_STACK_UNWIND (setattr, main_frame, local->op_ret,
local->op_errno,
@@ -844,7 +844,7 @@ afr_setattr_unwind (call_frame_t *frame, xlator_t *this)
int
afr_setattr_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct stat *preop, struct stat *postop)
+ struct iatt *preop, struct iatt *postop)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -961,7 +961,7 @@ afr_setattr_done (call_frame_t *frame, xlator_t *this)
int
afr_setattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, struct stat *buf, int32_t valid)
+ loc_t *loc, struct iatt *buf, int32_t valid)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -1046,9 +1046,9 @@ afr_fsetattr_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.fsetattr.preop_buf.st_ino =
+ local->cont.fsetattr.preop_buf.ia_ino =
local->cont.fsetattr.ino;
- local->cont.fsetattr.postop_buf.st_ino =
+ local->cont.fsetattr.postop_buf.ia_ino =
local->cont.fsetattr.ino;
AFR_STACK_UNWIND (fsetattr, main_frame, local->op_ret,
@@ -1064,7 +1064,7 @@ afr_fsetattr_unwind (call_frame_t *frame, xlator_t *this)
int
afr_fsetattr_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct stat *preop, struct stat *postop)
+ struct iatt *preop, struct iatt *postop)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1181,7 +1181,7 @@ afr_fsetattr_done (call_frame_t *frame, xlator_t *this)
int
afr_fsetattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, struct stat *buf, int32_t valid)
+ fd_t *fd, struct iatt *buf, int32_t valid)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
diff --git a/xlators/cluster/afr/src/afr-inode-write.h b/xlators/cluster/afr/src/afr-inode-write.h
index 66da777b622..f0c2fbe0078 100644
--- a/xlators/cluster/afr/src/afr-inode-write.h
+++ b/xlators/cluster/afr/src/afr-inode-write.h
@@ -55,11 +55,11 @@ afr_utimens (call_frame_t *frame, xlator_t *this,
int
afr_setattr (call_frame_t *frame, xlator_t *this,
- loc_t *loc, struct stat *buf, int32_t valid);
+ loc_t *loc, struct iatt *buf, int32_t valid);
int
afr_fsetattr (call_frame_t *frame, xlator_t *this,
- fd_t *fd, struct stat *buf, int32_t valid);
+ fd_t *fd, struct iatt *buf, int32_t valid);
int32_t
afr_setxattr (call_frame_t *frame, xlator_t *this,
diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c
index ae58eef0616..1bfeb9cdfb8 100644
--- a/xlators/cluster/afr/src/afr-open.c
+++ b/xlators/cluster/afr/src/afr-open.c
@@ -58,8 +58,8 @@
int
afr_open_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *prebuf,
- struct stat *postbuf)
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf)
{
afr_local_t * local = frame->local;
@@ -370,7 +370,7 @@ afr_up_down_flush_post_post_op (call_frame_t *frame, xlator_t *this)
sh->data_lock_held = _gf_true;
sh->need_data_self_heal = _gf_true;
- sh->mode = local->fd->inode->st_mode;
+ sh->type = local->fd->inode->ia_type;
sh->background = _gf_false;
sh->unwind = afr_up_down_flush_sh_unwind;
diff --git a/xlators/cluster/afr/src/afr-self-heal-algorithm.c b/xlators/cluster/afr/src/afr-self-heal-algorithm.c
index eefd1ff7bb4..f840c1bbe25 100644
--- a/xlators/cluster/afr/src/afr-self-heal-algorithm.c
+++ b/xlators/cluster/afr/src/afr-self-heal-algorithm.c
@@ -114,8 +114,8 @@ sh_full_loop_return (call_frame_t *rw_frame, xlator_t *this, off_t offset)
static int
sh_full_write_cbk (call_frame_t *rw_frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *prebuf,
- struct stat *postbuf)
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf)
{
afr_private_t * priv = NULL;
afr_local_t * rw_local = NULL;
@@ -169,7 +169,7 @@ sh_full_write_cbk (call_frame_t *rw_frame, void *cookie, xlator_t *this,
static int
sh_full_read_cbk (call_frame_t *rw_frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- struct iovec *vector, int32_t count, struct stat *buf,
+ struct iovec *vector, int32_t count, struct iatt *buf,
struct iobref *iobref)
{
afr_private_t * priv = NULL;
@@ -538,8 +538,8 @@ sh_diff_loop_return (call_frame_t *rw_frame, xlator_t *this,
static int
sh_diff_write_cbk (call_frame_t *rw_frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *buf,
- struct stat *postbuf)
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ struct iatt *postbuf)
{
afr_private_t * priv = NULL;
afr_local_t * rw_local = NULL;
@@ -601,7 +601,7 @@ sh_diff_write_cbk (call_frame_t *rw_frame, void *cookie, xlator_t *this,
static int
sh_diff_read_cbk (call_frame_t *rw_frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- struct iovec *vector, int32_t count, struct stat *buf,
+ struct iovec *vector, int32_t count, struct iatt *buf,
struct iobref *iobref)
{
afr_private_t * priv = NULL;
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index fbd13e47abf..dead7a323ed 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -441,7 +441,7 @@ afr_sh_mark_biggest_as_source (afr_self_heal_t *sh, int child_count)
static int
-afr_sh_mark_lowest_uid_as_source (afr_self_heal_t *sh, int child_count)
+afr_sh_mark_loweia_uid_as_source (afr_self_heal_t *sh, int child_count)
{
uid_t smallest = 0;
int i;
@@ -450,7 +450,7 @@ afr_sh_mark_lowest_uid_as_source (afr_self_heal_t *sh, int child_count)
if (!sh->buf)
break;
- if (sh->buf[i].st_uid < sh->buf[smallest].st_uid) {
+ if (sh->buf[i].ia_uid < sh->buf[smallest].ia_uid) {
smallest = i;
}
}
@@ -513,7 +513,7 @@ afr_sh_mark_sources (afr_self_heal_t *sh, int child_count,
if ((type == AFR_SELF_HEAL_METADATA)
&& afr_sh_all_nodes_innocent (characters, child_count)) {
- nsources = afr_sh_mark_lowest_uid_as_source (sh, child_count);
+ nsources = afr_sh_mark_loweia_uid_as_source (sh, child_count);
goto out;
}
@@ -864,7 +864,7 @@ sh_missing_entries_finish (call_frame_t *frame, xlator_t *this)
static int
sh_destroy_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int op_errno,
- struct stat *preop, struct stat *postop)
+ struct iatt *preop, struct iatt *postop)
{
afr_local_t *local = NULL;
@@ -899,9 +899,9 @@ static int
sh_missing_entries_newentry_cbk (call_frame_t *frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf,
- struct stat *preparent,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf,
+ struct iatt *preparent,
+ struct iatt *postparent)
{
afr_local_t *local = NULL;
afr_self_heal_t *sh = NULL;
@@ -912,7 +912,7 @@ sh_missing_entries_newentry_cbk (call_frame_t *frame, void *cookie,
loc_t *parent_loc = NULL;
- struct stat stbuf;
+ struct iatt stbuf;
int32_t valid;
local = frame->local;
@@ -921,20 +921,13 @@ sh_missing_entries_newentry_cbk (call_frame_t *frame, void *cookie,
child_index = (long) cookie;
-#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
- stbuf.st_atim = sh->buf[sh->source].st_atim;
- stbuf.st_mtim = sh->buf[sh->source].st_mtim;
-
-#elif HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
- stbuf.st_atimespec = sh->buf[sh->source].st_atimespec;
- stbuf.st_mtimespec = sh->buf[sh->source].st_mtimespec;
-#else
- stbuf.st_atime = sh->buf[sh->source].st_atime;
- stbuf.st_mtime = sh->buf[sh->source].st_mtime;
-#endif
-
- stbuf.st_uid = sh->buf[sh->source].st_uid;
- stbuf.st_gid = sh->buf[sh->source].st_gid;
+ stbuf.ia_atime = sh->buf[sh->source].ia_atime;
+ stbuf.ia_atime_nsec = sh->buf[sh->source].ia_atime_nsec;
+ stbuf.ia_mtime = sh->buf[sh->source].ia_mtime;
+ stbuf.ia_mtime_nsec = sh->buf[sh->source].ia_mtime_nsec;
+
+ stbuf.ia_uid = sh->buf[sh->source].ia_uid;
+ stbuf.ia_gid = sh->buf[sh->source].ia_gid;
valid = GF_SET_ATTR_UID | GF_SET_ATTR_GID |
GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME;
@@ -987,7 +980,7 @@ sh_missing_entries_mknod (call_frame_t *frame, xlator_t *this)
int enoent_count = 0;
int call_count = 0;
mode_t st_mode = 0;
- dev_t st_dev = 0;
+ dev_t ia_gen = 0;
local = frame->local;
@@ -1001,8 +994,9 @@ sh_missing_entries_mknod (call_frame_t *frame, xlator_t *this)
call_count = enoent_count;
local->call_count = call_count;
- st_mode = sh->buf[sh->source].st_mode;
- st_dev = sh->buf[sh->source].st_dev;
+ st_mode = st_mode_from_ia (sh->buf[sh->source].ia_prot,
+ sh->buf[sh->source].ia_type);
+ ia_gen = sh->buf[sh->source].ia_gen;
gf_log (this->name, GF_LOG_TRACE,
"mknod %s mode 0%o on %d subvolumes",
@@ -1015,7 +1009,7 @@ sh_missing_entries_mknod (call_frame_t *frame, xlator_t *this)
(void *) (long) i,
priv->children[i],
priv->children[i]->fops->mknod,
- &local->loc, st_mode, st_dev);
+ &local->loc, st_mode, ia_gen);
if (!--call_count)
break;
}
@@ -1048,7 +1042,8 @@ sh_missing_entries_mkdir (call_frame_t *frame, xlator_t *this)
call_count = enoent_count;
local->call_count = call_count;
- st_mode = sh->buf[sh->source].st_mode;
+ st_mode = st_mode_from_ia (sh->buf[sh->source].ia_prot,
+ sh->buf[sh->source].ia_type);
gf_log (this->name, GF_LOG_TRACE,
"mkdir %s mode 0%o on %d subvolumes",
@@ -1127,7 +1122,7 @@ static int
sh_missing_entries_readlink_cbk (call_frame_t *frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- const char *link, struct stat *sbuf)
+ const char *link, struct iatt *sbuf)
{
if (op_ret > 0)
sh_missing_entries_symlink (frame, this, link);
@@ -1181,7 +1176,7 @@ sh_missing_entries_create (call_frame_t *frame, xlator_t *this)
enoent_count++;
} else {
if (type) {
- if (type != (sh->buf[i].st_mode & S_IFMT)) {
+ if (type != sh->buf[i].ia_type) {
gf_log (this->name, GF_LOG_TRACE,
"file %s is govinda!",
local->loc.path);
@@ -1190,7 +1185,7 @@ sh_missing_entries_create (call_frame_t *frame, xlator_t *this)
}
} else {
sh->source = i;
- type = sh->buf[i].st_mode & S_IFMT;
+ type = sh->buf[i].ia_type;
}
}
}
@@ -1252,8 +1247,8 @@ static int
sh_missing_entries_lookup_cbk (call_frame_t *frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf, dict_t *xattr,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf, dict_t *xattr,
+ struct iatt *postparent)
{
int child_index = 0;
afr_local_t *local = NULL;
@@ -1275,7 +1270,7 @@ sh_missing_entries_lookup_cbk (call_frame_t *frame, void *cookie,
"path %s on subvolume %s is of mode 0%o",
local->loc.path,
priv->children[child_index]->name,
- buf->st_mode);
+ buf->ia_type);
local->self_heal.buf[child_index] = *buf;
local->self_heal.parentbuf = *postparent;
@@ -1472,7 +1467,7 @@ afr_local_t *afr_local_copy (afr_local_t *l, xlator_t *this)
else
shc->healing_fd = sh->healing_fd;
shc->background = sh->background;
- shc->mode = sh->mode;
+ shc->type = sh->type;
if (l->loc.path)
loc_copy (&lc->loc, &l->loc);
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.h b/xlators/cluster/afr/src/afr-self-heal-common.h
index be556a3c77e..298ac022a9b 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.h
+++ b/xlators/cluster/afr/src/afr-self-heal-common.h
@@ -20,7 +20,7 @@
#ifndef __AFR_SELF_HEAL_COMMON_H__
#define __AFR_SELF_HEAL_COMMON_H__
-#define FILE_HAS_HOLES(buf) (((buf)->st_size) > ((buf)->st_blocks * 512))
+#define FILE_HAS_HOLES(buf) (((buf)->ia_size) > ((buf)->ia_blocks * 512))
typedef enum {
AFR_SELF_HEAL_ENTRY,
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index 75090ad79ae..5711c89cf66 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -124,7 +124,7 @@ afr_sh_data_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
afr_sh_data_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *statpre, struct stat *statpost)
+ int32_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost)
{
afr_sh_data_flush_cbk (frame, cookie, this, op_ret, op_errno);
@@ -145,7 +145,7 @@ afr_sh_data_close (call_frame_t *frame, xlator_t *this)
int active_sinks = 0;
int32_t valid = 0;
- struct stat stbuf = {0,};
+ struct iatt stbuf = {0,};
local = frame->local;
sh = &local->self_heal;
@@ -156,17 +156,10 @@ afr_sh_data_close (call_frame_t *frame, xlator_t *this)
valid |= (GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME);
-#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
- stbuf.st_atim = sh->buf[source].st_atim;
- stbuf.st_mtim = sh->buf[source].st_mtim;
-
-#elif HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
- stbuf.st_atimespec = sh->buf[source].st_atimespec;
- stbuf.st_mtimespec = sh->buf[source].st_mtimespec;
-#else
- stbuf.st_atime = sh->buf[source].st_atime;
- stbuf.st_mtime = sh->buf[source].st_mtime;
-#endif
+ stbuf.ia_atime = sh->buf[source].ia_atime;
+ stbuf.ia_atime_nsec = sh->buf[source].ia_atime_nsec;
+ stbuf.ia_mtime = sh->buf[source].ia_mtime;
+ stbuf.ia_mtime_nsec = sh->buf[source].ia_mtime_nsec;
if (sh->healing_fd_opened) {
/* not our job to close the fd */
@@ -440,8 +433,8 @@ afr_sh_data_erase_pending (call_frame_t *frame, xlator_t *this)
int
afr_sh_data_trim_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *prebuf,
- struct stat *postbuf)
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -543,7 +536,7 @@ sh_zero_byte_files_exist (afr_self_heal_t *sh, int child_count)
int ret = 0;
for (i = 0; i < child_count; i++) {
- if (sh->buf[i].st_size == 0) {
+ if (sh->buf[i].ia_size == 0) {
ret = 1;
break;
}
@@ -722,13 +715,13 @@ afr_sh_data_fix (call_frame_t *frame, xlator_t *this)
sh->source = source;
sh->block_size = 65536;
- sh->file_size = sh->buf[source].st_size;
+ sh->file_size = sh->buf[source].ia_size;
if (FILE_HAS_HOLES (&sh->buf[source]))
sh->file_has_holes = 1;
orig_local = sh->orig_frame->local;
- orig_local->cont.lookup.buf.st_size = sh->buf[source].st_size;
+ orig_local->cont.lookup.buf.ia_size = sh->buf[source].ia_size;
/* detect changes not visible through pending flags -- JIC */
for (i = 0; i < priv->child_count; i++) {
@@ -788,7 +781,7 @@ afr_self_heal_get_source (xlator_t *this, afr_local_t *local, dict_t **xattr)
int
afr_sh_data_fstat_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
afr_private_t *priv = NULL;
afr_local_t *local = NULL;
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index 17c82d56538..ef8de198728 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -448,7 +448,7 @@ int
afr_sh_entry_expunge_parent_setattr_cbk (call_frame_t *expunge_frame,
void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct stat *preop, struct stat *postop)
+ struct iatt *preop, struct iatt *postop)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -480,11 +480,11 @@ int
afr_sh_entry_expunge_rename_cbk (call_frame_t *expunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct stat *buf,
- struct stat *preoldparent,
- struct stat *postoldparent,
- struct stat *prenewparent,
- struct stat *postnewparent)
+ struct iatt *buf,
+ struct iatt *preoldparent,
+ struct iatt *postoldparent,
+ struct iatt *prenewparent,
+ struct iatt *postnewparent)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -596,8 +596,8 @@ afr_sh_entry_expunge_rename (call_frame_t *expunge_frame, xlator_t *this,
int
afr_sh_entry_expunge_mkdir_cbk (call_frame_t *expunge_frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct stat *buf, struct stat *preparent,
- struct stat *postparent)
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -640,8 +640,8 @@ int
afr_sh_entry_expunge_lookup_trash_cbk (call_frame_t *expunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf,
- dict_t *xattr, struct stat *postparent)
+ inode_t *inode, struct iatt *buf,
+ dict_t *xattr, struct iatt *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -745,7 +745,7 @@ afr_sh_entry_expunge_lookup_trash (call_frame_t *expunge_frame, xlator_t *this,
int
afr_sh_entry_expunge_remove (call_frame_t *expunge_frame, xlator_t *this,
- int active_src, struct stat *buf)
+ int active_src, struct iatt *buf)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -760,7 +760,7 @@ afr_sh_entry_expunge_remove (call_frame_t *expunge_frame, xlator_t *this,
frame = expunge_sh->sh_frame;
source = expunge_sh->source;
- type = (buf->st_mode & S_IFMT);
+ type = buf->ia_type;
switch (type) {
case S_IFSOCK:
@@ -794,8 +794,8 @@ int
afr_sh_entry_expunge_lookup_cbk (call_frame_t *expunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf, dict_t *x,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf, dict_t *x,
+ struct iatt *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -857,8 +857,8 @@ int
afr_sh_entry_expunge_entry_cbk (call_frame_t *expunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf, dict_t *x,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf, dict_t *x,
+ struct iatt *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -1148,7 +1148,7 @@ int
afr_sh_entry_impunge_setattr_cbk (call_frame_t *impunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct stat *preop, struct stat *postop)
+ struct iatt *preop, struct iatt *postop)
{
int call_count = 0;
afr_private_t *priv = NULL;
@@ -1209,7 +1209,7 @@ afr_sh_entry_impunge_xattrop_cbk (call_frame_t *impunge_frame, void *cookie,
call_frame_t *frame = NULL;
int child_index = 0;
- struct stat stbuf;
+ struct iatt stbuf;
int32_t valid = 0;
priv = this->private;
@@ -1223,23 +1223,16 @@ afr_sh_entry_impunge_xattrop_cbk (call_frame_t *impunge_frame, void *cookie,
"setting ownership of %s on %s to %d/%d",
impunge_local->loc.path,
priv->children[child_index]->name,
- impunge_local->cont.lookup.buf.st_uid,
- impunge_local->cont.lookup.buf.st_gid);
-
-#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
- stbuf.st_atim = impunge_local->cont.lookup.buf.st_atim;
- stbuf.st_mtim = impunge_local->cont.lookup.buf.st_mtim;
-
-#elif HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
- stbuf.st_atimespec = impunge_local->cont.lookup.buf.st_atimespec;
- stbuf.st_mtimespec = impunge_local->cont.lookup.buf.st_mtimespec;
-#else
- stbuf.st_atime = impunge_local->cont.lookup.buf.st_atime;
- stbuf.st_mtime = impunge_local->cont.lookup.buf.st_mtime;
-#endif
+ impunge_local->cont.lookup.buf.ia_uid,
+ impunge_local->cont.lookup.buf.ia_gid);
+
+ stbuf.ia_atime = impunge_local->cont.lookup.buf.ia_atime;
+ stbuf.ia_atime_nsec = impunge_local->cont.lookup.buf.ia_atime_nsec;
+ stbuf.ia_mtime = impunge_local->cont.lookup.buf.ia_mtime;
+ stbuf.ia_mtime_nsec = impunge_local->cont.lookup.buf.ia_mtime_nsec;
- stbuf.st_uid = impunge_local->cont.lookup.buf.st_uid;
- stbuf.st_gid = impunge_local->cont.lookup.buf.st_gid;
+ stbuf.ia_uid = impunge_local->cont.lookup.buf.ia_uid;
+ stbuf.ia_gid = impunge_local->cont.lookup.buf.ia_gid;
valid = GF_SET_ATTR_UID | GF_SET_ATTR_GID |
GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME;
@@ -1258,7 +1251,7 @@ int
afr_sh_entry_impunge_parent_setattr_cbk (call_frame_t *setattr_frame,
void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct stat *preop, struct stat *postop)
+ struct iatt *preop, struct iatt *postop)
{
loc_t *parent_loc = cookie;
@@ -1281,9 +1274,9 @@ int
afr_sh_entry_impunge_newfile_cbk (call_frame_t *impunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *stbuf,
- struct stat *preparent,
- struct stat *postparent)
+ inode_t *inode, struct iatt *stbuf,
+ struct iatt *preparent,
+ struct iatt *postparent)
{
int call_count = 0;
afr_private_t *priv = NULL;
@@ -1302,7 +1295,7 @@ afr_sh_entry_impunge_newfile_cbk (call_frame_t *impunge_frame, void *cookie,
call_frame_t *setattr_frame = NULL;
int32_t valid = 0;
loc_t *parent_loc = NULL;
- struct stat parentbuf;
+ struct iatt parentbuf;
priv = this->private;
impunge_local = impunge_frame->local;
@@ -1323,14 +1316,14 @@ afr_sh_entry_impunge_newfile_cbk (call_frame_t *impunge_frame, void *cookie,
goto out;
}
- inode->st_mode = stbuf->st_mode;
+ inode->ia_type = stbuf->ia_type;
xattr = get_new_dict ();
dict_ref (xattr);
idx = afr_index_for_transaction_type (AFR_METADATA_TRANSACTION);
pending_array[idx] = hton32 (1);
- if (S_ISDIR (stbuf->st_mode))
+ if (IA_ISDIR (stbuf->ia_type))
idx = afr_index_for_transaction_type (AFR_ENTRY_TRANSACTION);
else
idx = afr_index_for_transaction_type (AFR_DATA_TRANSACTION);
@@ -1380,7 +1373,7 @@ out:
int
afr_sh_entry_impunge_mknod (call_frame_t *impunge_frame, xlator_t *this,
- int child_index, struct stat *stbuf)
+ int child_index, struct iatt *stbuf)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1401,7 +1394,8 @@ afr_sh_entry_impunge_mknod (call_frame_t *impunge_frame, xlator_t *this,
priv->children[child_index],
priv->children[child_index]->fops->mknod,
&impunge_local->loc,
- stbuf->st_mode, stbuf->st_rdev);
+ st_mode_from_ia (stbuf->ia_prot, stbuf->ia_type),
+ stbuf->ia_rdev);
return 0;
}
@@ -1410,7 +1404,7 @@ afr_sh_entry_impunge_mknod (call_frame_t *impunge_frame, xlator_t *this,
int
afr_sh_entry_impunge_mkdir (call_frame_t *impunge_frame, xlator_t *this,
- int child_index, struct stat *stbuf)
+ int child_index, struct iatt *stbuf)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1430,7 +1424,8 @@ afr_sh_entry_impunge_mkdir (call_frame_t *impunge_frame, xlator_t *this,
(void *) (long) child_index,
priv->children[child_index],
priv->children[child_index]->fops->mkdir,
- &impunge_local->loc, stbuf->st_mode);
+ &impunge_local->loc,
+ st_mode_from_ia (stbuf->ia_prot, stbuf->ia_type));
return 0;
}
@@ -1468,8 +1463,8 @@ int
afr_sh_entry_impunge_symlink_unlink_cbk (call_frame_t *impunge_frame,
void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent)
+ struct iatt *preparent,
+ struct iatt *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1547,7 +1542,7 @@ int
afr_sh_entry_impunge_readlink_sink_cbk (call_frame_t *impunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- const char *linkname, struct stat *sbuf)
+ const char *linkname, struct iatt *sbuf)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1646,7 +1641,7 @@ int
afr_sh_entry_impunge_readlink_cbk (call_frame_t *impunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- const char *linkname, struct stat *sbuf)
+ const char *linkname, struct iatt *sbuf)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1697,7 +1692,7 @@ out:
int
afr_sh_entry_impunge_readlink (call_frame_t *impunge_frame, xlator_t *this,
- int child_index, struct stat *stbuf)
+ int child_index, struct iatt *stbuf)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1723,8 +1718,8 @@ int
afr_sh_entry_impunge_recreate_lookup_cbk (call_frame_t *impunge_frame,
void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf,
- dict_t *xattr,struct stat *postparent)
+ inode_t *inode, struct iatt *buf,
+ dict_t *xattr,struct iatt *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1757,7 +1752,7 @@ afr_sh_entry_impunge_recreate_lookup_cbk (call_frame_t *impunge_frame,
impunge_sh->parentbuf = *postparent;
impunge_local->cont.lookup.buf = *buf;
- type = (buf->st_mode & S_IFMT);
+ type = buf->ia_type;
switch (type) {
case S_IFSOCK:
@@ -1834,8 +1829,8 @@ int
afr_sh_entry_impunge_entry_cbk (call_frame_t *impunge_frame, void *cookie,
xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf, dict_t *x,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf, dict_t *x,
+ struct iatt *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1953,7 +1948,8 @@ afr_sh_entry_impunge_entry (call_frame_t *frame, xlator_t *this,
impunge_sh->sh_frame = frame;
impunge_sh->active_source = active_src;
- impunge_sh->impunging_entry_mode = entry->d_stat.st_mode;
+ impunge_sh->impunging_entry_mode =
+ st_mode_from_ia (entry->d_stat.ia_prot, entry->d_stat.ia_type);
ret = build_child_loc (this, &impunge_local->loc, &local->loc, entry->d_name);
if (ret != 0) {
@@ -2357,8 +2353,8 @@ heal:
int
afr_sh_entry_lookup_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf, dict_t *xattr,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf, dict_t *xattr,
+ struct iatt *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *local = NULL;
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c
index bddccf6821d..57408cfa68c 100644
--- a/xlators/cluster/afr/src/afr-self-heal-metadata.c
+++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c
@@ -81,7 +81,7 @@ afr_sh_metadata_done (call_frame_t *frame, xlator_t *this)
local->loc.path);
sh->completion_cbk (frame, this);
} else {
- if (S_ISREG (sh->mode)) {
+ if (IA_ISREG (sh->type)) {
gf_log (this->name, GF_LOG_TRACE,
"proceeding to data check on %s",
local->loc.path);
@@ -89,7 +89,7 @@ afr_sh_metadata_done (call_frame_t *frame, xlator_t *this)
return 0;
}
- if (S_ISDIR (sh->mode)) {
+ if (IA_ISDIR (sh->type)) {
gf_log (this->name, GF_LOG_TRACE,
"proceeding to entry check on %s",
local->loc.path);
@@ -321,7 +321,7 @@ afr_sh_metadata_sync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
afr_sh_metadata_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- struct stat *preop, struct stat *postop)
+ struct iatt *preop, struct iatt *postop)
{
afr_sh_metadata_sync_cbk (frame, cookie, this, op_ret, op_errno);
@@ -350,7 +350,7 @@ afr_sh_metadata_sync (call_frame_t *frame, xlator_t *this, dict_t *xattr)
int call_count = 0;
int i = 0;
- struct stat stbuf;
+ struct iatt stbuf;
int32_t valid = 0;
local = frame->local;
@@ -370,22 +370,16 @@ afr_sh_metadata_sync (call_frame_t *frame, xlator_t *this, dict_t *xattr)
local->call_count = call_count;
-#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
- stbuf.st_atim = sh->buf[source].st_atim;
- stbuf.st_mtim = sh->buf[source].st_mtim;
-
-#elif HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
- stbuf.st_atimespec = sh->buf[source].st_atimespec;
- stbuf.st_mtimespec = sh->buf[source].st_mtimespec;
-#else
- stbuf.st_atime = sh->buf[source].st_atime;
- stbuf.st_mtime = sh->buf[source].st_mtime;
-#endif
+ stbuf.ia_atime = sh->buf[source].ia_atime;
+ stbuf.ia_atime_nsec = sh->buf[source].ia_atime_nsec;
+ stbuf.ia_mtime = sh->buf[source].ia_mtime;
+ stbuf.ia_mtime_nsec = sh->buf[source].ia_mtime_nsec;
- stbuf.st_uid = sh->buf[source].st_uid;
- stbuf.st_gid = sh->buf[source].st_gid;
+ stbuf.ia_uid = sh->buf[source].ia_uid;
+ stbuf.ia_gid = sh->buf[source].ia_gid;
- stbuf.st_mode = sh->buf[source].st_mode;
+ stbuf.ia_type = sh->buf[source].ia_type;
+ stbuf.ia_prot = sh->buf[source].ia_prot;
valid = GF_SET_ATTR_MODE |
GF_SET_ATTR_UID | GF_SET_ATTR_GID |
@@ -604,8 +598,8 @@ afr_sh_metadata_fix (call_frame_t *frame, xlator_t *this)
int
afr_sh_metadata_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf, dict_t *xattr,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf, dict_t *xattr,
+ struct iatt *postparent)
{
afr_local_t *local = NULL;
afr_self_heal_t *sh = NULL;
@@ -627,7 +621,7 @@ afr_sh_metadata_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
"path %s on subvolume %s is of mode 0%o",
local->loc.path,
priv->children[child_index]->name,
- buf->st_mode);
+ buf->ia_type);
sh->buf[child_index] = *buf;
if (xattr)
diff --git a/xlators/cluster/afr/src/afr-self-heal.h b/xlators/cluster/afr/src/afr-self-heal.h
index 1c2743a48da..c43473a4332 100644
--- a/xlators/cluster/afr/src/afr-self-heal.h
+++ b/xlators/cluster/afr/src/afr-self-heal.h
@@ -22,12 +22,12 @@
#include <sys/stat.h>
-#define FILETYPE_DIFFERS(buf1,buf2) ((S_IFMT & ((struct stat *)buf1)->st_mode) != (S_IFMT & ((struct stat *)buf2)->st_mode))
-#define PERMISSION_DIFFERS(buf1,buf2) ((((struct stat *)buf1)->st_mode) != (((struct stat *)buf2)->st_mode))
-#define OWNERSHIP_DIFFERS(buf1,buf2) ((((struct stat *)buf1)->st_uid) != (((struct stat *)buf2)->st_uid) || (((struct stat *)buf1)->st_gid != (((struct stat *)buf2)->st_gid)))
-#define SIZE_DIFFERS(buf1,buf2) ((((struct stat *)buf1)->st_size) != (((struct stat *)buf2)->st_size))
+#define FILETYPE_DIFFERS(buf1,buf2) ((buf1)->ia_type != (buf2)->ia_type)
+#define PERMISSION_DIFFERS(buf1,buf2) (st_mode_from_ia ((buf1)->ia_prot, (buf1)->ia_type) != st_mode_from_ia ((buf2)->ia_prot, (buf2)->ia_type))
+#define OWNERSHIP_DIFFERS(buf1,buf2) (((buf1)->ia_uid != (buf2)->ia_uid) || ((buf1)->ia_gid != (buf2)->ia_gid))
+#define SIZE_DIFFERS(buf1,buf2) ((buf1)->ia_size != (buf2)->ia_size)
-#define SIZE_GREATER(buf1,buf2) ((((struct stat *)buf1)->st_size > (((struct stat *)buf2)->st_size)))
+#define SIZE_GREATER(buf1,buf2) ((buf1)->ia_size > (buf2)->ia_size)
int
afr_sh_has_metadata_pending (dict_t *xattr, int child_count, xlator_t *this);
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index f4917929c78..b7fbbd09c50 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -551,8 +551,8 @@ afr_lookup_collect_xattr (afr_local_t *local, xlator_t *this,
static void
-afr_lookup_self_heal_check (afr_local_t *local, struct stat *buf,
- struct stat *lookup_buf)
+afr_lookup_self_heal_check (afr_local_t *local, struct iatt *buf,
+ struct iatt *lookup_buf)
{
if (FILETYPE_DIFFERS (buf, lookup_buf)) {
/* mismatching filetypes with same name
@@ -576,7 +576,7 @@ afr_lookup_self_heal_check (afr_local_t *local, struct stat *buf,
}
if (SIZE_DIFFERS (buf, lookup_buf)
- && S_ISREG (buf->st_mode)) {
+ && IA_ISREG (buf->ia_type)) {
local->self_heal.need_data_self_heal = _gf_true;
}
@@ -584,7 +584,7 @@ afr_lookup_self_heal_check (afr_local_t *local, struct stat *buf,
static void
-afr_lookup_done (call_frame_t *frame, xlator_t *this, struct stat *lookup_buf)
+afr_lookup_done (call_frame_t *frame, xlator_t *this, struct iatt *lookup_buf)
{
int unwind = 1;
int source = -1;
@@ -593,20 +593,20 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this, struct stat *lookup_buf)
local = frame->local;
- local->cont.lookup.postparent.st_ino = local->cont.lookup.parent_ino;
+ local->cont.lookup.postparent.ia_ino = local->cont.lookup.parent_ino;
if (local->cont.lookup.ino) {
- local->cont.lookup.buf.st_ino = local->cont.lookup.ino;
- local->cont.lookup.buf.st_dev = local->cont.lookup.gen;
+ local->cont.lookup.buf.ia_ino = local->cont.lookup.ino;
+ local->cont.lookup.buf.ia_gen = local->cont.lookup.gen;
}
if (local->op_ret == 0) {
/* KLUDGE: assuming DHT will not itransform in
revalidate */
if (local->cont.lookup.inode->ino) {
- local->cont.lookup.buf.st_ino =
+ local->cont.lookup.buf.ia_ino =
local->cont.lookup.inode->ino;
- local->cont.lookup.buf.st_dev =
+ local->cont.lookup.buf.ia_gen =
local->cont.lookup.inode->generation;
}
}
@@ -638,7 +638,7 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this, struct stat *lookup_buf)
So just make a best effort to set the read-subvolume
and return */
- if (S_ISREG (local->cont.lookup.inode->st_mode)) {
+ if (IA_ISREG (local->cont.lookup.inode->ia_type)) {
source = afr_self_heal_get_source (this, local, local->cont.lookup.xattrs);
if (source >= 0) {
@@ -648,14 +648,14 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this, struct stat *lookup_buf)
}
}
} else {
- if (!local->cont.lookup.inode->st_mode) {
+ if (!local->cont.lookup.inode->ia_type) {
/* fix for RT #602 */
- local->cont.lookup.inode->st_mode =
- lookup_buf->st_mode;
+ local->cont.lookup.inode->ia_type =
+ lookup_buf->ia_type;
}
local->self_heal.background = _gf_true;
- local->self_heal.mode = local->cont.lookup.buf.st_mode;
+ local->self_heal.type = local->cont.lookup.buf.ia_type;
local->self_heal.unwind = afr_self_heal_lookup_unwind;
unwind = 0;
@@ -704,12 +704,12 @@ __error_more_important (int32_t old_errno, int32_t new_errno)
int
afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf, dict_t *xattr,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf, dict_t *xattr,
+ struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
- struct stat * lookup_buf = NULL;
+ struct iatt * lookup_buf = NULL;
int call_count = -1;
int child_index = -1;
@@ -744,10 +744,10 @@ afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie,
if (child_index == first_up_child) {
local->cont.lookup.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
first_up_child);
- local->cont.lookup.gen = buf->st_dev;
+ local->cont.lookup.gen = buf->ia_gen;
}
if (local->success_count == 0) {
@@ -761,7 +761,7 @@ afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie,
*lookup_buf = *buf;
- lookup_buf->st_ino = afr_itransform (buf->st_ino,
+ lookup_buf->ia_ino = afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
if (priv->read_child >= 0) {
@@ -824,12 +824,12 @@ unlock:
int
afr_revalidate_lookup_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct stat *buf, dict_t *xattr,
- struct stat *postparent)
+ inode_t *inode, struct iatt *buf, dict_t *xattr,
+ struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
- struct stat * lookup_buf = NULL;
+ struct iatt * lookup_buf = NULL;
int call_count = -1;
int child_index = -1;
@@ -864,10 +864,10 @@ afr_revalidate_lookup_cbk (call_frame_t *frame, void *cookie,
if (child_index == first_up_child) {
local->cont.lookup.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
first_up_child);
- local->cont.lookup.gen = buf->st_dev;
+ local->cont.lookup.gen = buf->ia_gen;
}
/* in case of revalidate, we need to send stat of the
@@ -889,7 +889,7 @@ afr_revalidate_lookup_cbk (call_frame_t *frame, void *cookie,
*lookup_buf = *buf;
- lookup_buf->st_ino = afr_itransform (buf->st_ino,
+ lookup_buf->ia_ino = afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
@@ -1460,8 +1460,8 @@ out:
int
afr_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *prebuf,
- struct stat *postbuf)
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf)
{
afr_local_t *local = NULL;
@@ -1503,8 +1503,8 @@ afr_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
call_count = afr_frame_return (frame);
if (call_count == 0) {
- local->cont.fsync.prebuf.st_ino = local->cont.fsync.ino;
- local->cont.fsync.postbuf.st_ino = local->cont.fsync.ino;
+ local->cont.fsync.prebuf.ia_ino = local->cont.fsync.ino;
+ local->cont.fsync.postbuf.ia_ino = local->cont.fsync.ino;
AFR_STACK_UNWIND (fsync, frame, local->op_ret, local->op_errno,
&local->cont.fsync.prebuf,
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index a5c75add7ba..589d5dffce3 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -97,7 +97,7 @@ typedef struct {
gf_boolean_t background; /* do self-heal in background
if possible */
- mode_t mode; /* st_mode of the entry we're doing
+ ia_type_t type; /* st_mode of the entry we're doing
self-heal on */
/* Function to call to unwind. If self-heal is being done in the
@@ -109,8 +109,8 @@ typedef struct {
/* array of stat's, one for each child */
- struct stat *buf;
- struct stat parentbuf;
+ struct iatt *buf;
+ struct iatt parentbuf;
/* array of xattr's, one for each child */
dict_t **xattr;
@@ -251,9 +251,9 @@ typedef struct _afr_local {
struct {
inode_t *inode;
- struct stat buf;
- struct stat read_child_buf;
- struct stat postparent;
+ struct iatt buf;
+ struct iatt read_child_buf;
+ struct iatt postparent;
ino_t ino;
uint64_t gen;
ino_t parent_ino;
@@ -348,8 +348,8 @@ typedef struct _afr_local {
struct {
ino_t ino;
- struct stat prebuf;
- struct stat postbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
int32_t op_ret;
@@ -361,38 +361,38 @@ typedef struct _afr_local {
struct {
ino_t ino;
- struct stat prebuf;
- struct stat postbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
} fsync;
struct {
ino_t ino;
off_t offset;
- struct stat prebuf;
- struct stat postbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
} truncate;
struct {
ino_t ino;
off_t offset;
- struct stat prebuf;
- struct stat postbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
} ftruncate;
struct {
ino_t ino;
- struct stat in_buf;
+ struct iatt in_buf;
int32_t valid;
- struct stat preop_buf;
- struct stat postop_buf;
+ struct iatt preop_buf;
+ struct iatt postop_buf;
} setattr;
struct {
ino_t ino;
- struct stat in_buf;
+ struct iatt in_buf;
int32_t valid;
- struct stat preop_buf;
- struct stat postop_buf;
+ struct iatt preop_buf;
+ struct iatt postop_buf;
} fsetattr;
struct {
@@ -414,10 +414,10 @@ typedef struct _afr_local {
int32_t flags;
mode_t mode;
inode_t *inode;
- struct stat buf;
- struct stat preparent;
- struct stat postparent;
- struct stat read_child_buf;
+ struct iatt buf;
+ struct iatt preparent;
+ struct iatt postparent;
+ struct iatt read_child_buf;
} create;
struct {
@@ -427,10 +427,10 @@ typedef struct _afr_local {
dev_t dev;
mode_t mode;
inode_t *inode;
- struct stat buf;
- struct stat preparent;
- struct stat postparent;
- struct stat read_child_buf;
+ struct iatt buf;
+ struct iatt preparent;
+ struct iatt postparent;
+ struct iatt read_child_buf;
} mknod;
struct {
@@ -439,38 +439,38 @@ typedef struct _afr_local {
ino_t parent_ino;
int32_t mode;
inode_t *inode;
- struct stat buf;
- struct stat read_child_buf;
- struct stat preparent;
- struct stat postparent;
+ struct iatt buf;
+ struct iatt read_child_buf;
+ struct iatt preparent;
+ struct iatt postparent;
} mkdir;
struct {
ino_t parent_ino;
int32_t op_ret;
int32_t op_errno;
- struct stat preparent;
- struct stat postparent;
+ struct iatt preparent;
+ struct iatt postparent;
} unlink;
struct {
ino_t parent_ino;
int32_t op_ret;
int32_t op_errno;
- struct stat preparent;
- struct stat postparent;
+ struct iatt preparent;
+ struct iatt postparent;
} rmdir;
struct {
ino_t oldparent_ino;
ino_t newparent_ino;
ino_t ino;
- struct stat buf;
- struct stat read_child_buf;
- struct stat preoldparent;
- struct stat prenewparent;
- struct stat postoldparent;
- struct stat postnewparent;
+ struct iatt buf;
+ struct iatt read_child_buf;
+ struct iatt preoldparent;
+ struct iatt prenewparent;
+ struct iatt postoldparent;
+ struct iatt postnewparent;
} rename;
struct {
@@ -478,10 +478,10 @@ typedef struct _afr_local {
uint64_t gen;
ino_t parent_ino;
inode_t *inode;
- struct stat buf;
- struct stat read_child_buf;
- struct stat preparent;
- struct stat postparent;
+ struct iatt buf;
+ struct iatt read_child_buf;
+ struct iatt preparent;
+ struct iatt postparent;
} link;
struct {
@@ -489,11 +489,11 @@ typedef struct _afr_local {
uint64_t gen;
ino_t parent_ino;
inode_t *inode;
- struct stat buf;
- struct stat read_child_buf;
+ struct iatt buf;
+ struct iatt read_child_buf;
char *linkpath;
- struct stat preparent;
- struct stat postparent;
+ struct iatt preparent;
+ struct iatt postparent;
} symlink;
struct {