summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.c33
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c2
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c21
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-algorithm.c6
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c9
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c10
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c24
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-metadata.c3
-rw-r--r--xlators/cluster/afr/src/afr.c19
9 files changed, 79 insertions, 48 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
index 51629234f88..5cd05b13864 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -115,7 +115,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)
+ fd_t *fd, inode_t *inode, struct stat *buf,
+ struct stat *preparent, struct stat *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -366,9 +367,10 @@ 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)
+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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -601,9 +603,10 @@ 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)
+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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -840,7 +843,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 *buf, struct stat *preparent,
+ struct stat *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1065,7 +1069,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 *buf, struct stat *preparent,
+ struct stat *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1297,7 +1302,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)
+ int32_t op_ret, int32_t op_errno, struct stat *buf,
+ struct stat *preoldparent, struct stat *postoldparent,
+ struct stat *prenewparent, struct stat *postnewparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1496,7 +1503,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)
+ int32_t op_ret, int32_t op_errno, struct stat *preparent,
+ struct stat *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1683,7 +1691,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)
+ int32_t op_ret, int32_t op_errno, struct stat *preparent,
+ struct stat *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 2032065119a..8c0431f5a51 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -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)
+ const char *buf, struct stat *sbuf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 591f7cd49aa..601913a0fca 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -88,7 +88,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 *buf)
+ int32_t op_ret, int32_t op_errno, struct stat *prebuf,
+ struct stat *postbuf)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -115,11 +116,11 @@ afr_writev_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret != -1) {
if (local->success_count == 0) {
local->op_ret = op_ret;
- local->cont.writev.buf = *buf;
+ local->cont.writev.buf = *postbuf;
}
if (child_index == read_child) {
- local->cont.writev.read_child_buf = *buf;
+ local->cont.writev.read_child_buf = *postbuf;
}
local->success_count++;
@@ -323,7 +324,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 *buf)
+ int32_t op_ret, int32_t op_errno, struct stat *prebuf,
+ struct stat *postbuf)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -350,11 +352,11 @@ afr_truncate_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret != -1) {
if (local->success_count == 0) {
local->op_ret = op_ret;
- local->cont.truncate.buf = *buf;
+ local->cont.truncate.buf = *postbuf;
}
if (child_index == read_child) {
- local->cont.truncate.read_child_buf = *buf;
+ local->cont.truncate.read_child_buf = *postbuf;
}
local->success_count++;
@@ -543,7 +545,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 *buf)
+ int32_t op_ret, int32_t op_errno, struct stat *prebuf,
+ struct stat *postbuf)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -570,11 +573,11 @@ afr_ftruncate_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret != -1) {
if (local->success_count == 0) {
local->op_ret = op_ret;
- local->cont.ftruncate.buf = *buf;
+ local->cont.ftruncate.buf = *postbuf;
}
if (child_index == read_child) {
- local->cont.ftruncate.read_child_buf = *buf;
+ local->cont.ftruncate.read_child_buf = *postbuf;
}
local->success_count++;
diff --git a/xlators/cluster/afr/src/afr-self-heal-algorithm.c b/xlators/cluster/afr/src/afr-self-heal-algorithm.c
index 46d451913b0..5197f6be43f 100644
--- a/xlators/cluster/afr/src/afr-self-heal-algorithm.c
+++ b/xlators/cluster/afr/src/afr-self-heal-algorithm.c
@@ -55,7 +55,8 @@ sh_full_read_write_iter (call_frame_t *frame, xlator_t *this);
static int
sh_full_write_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *buf)
+ int32_t op_ret, int32_t op_errno, struct stat *prebuf,
+ struct stat *postbuf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -281,7 +282,8 @@ sh_diff_iter (call_frame_t *frame, xlator_t *this);
static int
sh_diff_write_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *buf)
+ int32_t op_ret, int32_t op_errno, struct stat *buf,
+ struct stat *postbuf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 4a260ed903e..ef25204a11a 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -831,7 +831,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)
+ inode_t *inode, struct stat *buf,
+ struct stat *preparent,
+ struct stat *postparent)
{
afr_local_t *local = NULL;
afr_self_heal_t *sh = NULL;
@@ -1044,7 +1046,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)
+ const char *link, struct stat *sbuf)
{
if (op_ret > 0)
sh_missing_entries_symlink (frame, this, link);
@@ -1164,7 +1166,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)
+ inode_t *inode, struct stat *buf, dict_t *xattr,
+ struct stat *postparent)
{
int child_index = 0;
afr_local_t *local = NULL;
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index 576a15e06f2..5300f0a7528 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -395,7 +395,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 *buf)
+ int32_t op_ret, int32_t op_errno, struct stat *prebuf,
+ struct stat *postbuf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -600,7 +601,7 @@ afr_sh_data_open (call_frame_t *frame, xlator_t *this)
(void *) (long) source,
priv->children[source],
priv->children[source]->fops->open,
- &local->loc, O_RDWR|O_LARGEFILE, fd);
+ &local->loc, O_RDWR|O_LARGEFILE, fd, 0);
call_count--;
/* open sinks */
@@ -613,7 +614,7 @@ afr_sh_data_open (call_frame_t *frame, xlator_t *this)
priv->children[i],
priv->children[i]->fops->open,
&local->loc,
- O_RDWR|O_LARGEFILE, fd);
+ O_RDWR|O_LARGEFILE, fd, 0);
if (!--call_count)
break;
@@ -758,7 +759,8 @@ afr_sh_data_fix (call_frame_t *frame, xlator_t *this)
int
afr_sh_data_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)
+ inode_t *inode, struct stat *buf, dict_t *xattr,
+ struct stat *postparent)
{
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 b3bb6720917..fa938415864 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -426,7 +426,9 @@ afr_sh_entry_expunge_entry_done (call_frame_t *frame, xlator_t *this,
int
afr_sh_entry_expunge_remove_cbk (call_frame_t *expunge_frame, void *cookie,
xlator_t *this,
- int32_t op_ret, int32_t op_errno)
+ int32_t op_ret, int32_t op_errno,
+ struct stat *preparent,
+ struct stat *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -564,7 +566,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)
+ inode_t *inode, struct stat *buf, dict_t *x,
+ struct stat *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -626,7 +629,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)
+ inode_t *inode, struct stat *buf, dict_t *x,
+ struct stat *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *expunge_local = NULL;
@@ -1021,7 +1025,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)
+ inode_t *inode, struct stat *stbuf,
+ struct stat *preparent,
+ struct stat *postparent)
{
int call_count = 0;
afr_private_t *priv = NULL;
@@ -1188,7 +1194,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)
+ const char *linkname, struct stat *sbuf)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1264,7 +1270,7 @@ 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)
+ dict_t *xattr,struct stat *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1372,7 +1378,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)
+ inode_t *inode, struct stat *buf, dict_t *x,
+ struct stat *postparent)
{
afr_private_t *priv = NULL;
afr_local_t *impunge_local = NULL;
@@ -1861,7 +1868,8 @@ afr_sh_entry_fix (call_frame_t *frame, xlator_t *this)
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)
+ inode_t *inode, struct stat *buf, dict_t *xattr,
+ struct stat *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 686446b5f30..9a02ab6ddb3 100644
--- a/xlators/cluster/afr/src/afr-self-heal-metadata.c
+++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c
@@ -591,7 +591,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)
+ inode_t *inode, struct stat *buf, dict_t *xattr,
+ struct stat *postparent)
{
afr_local_t *local = NULL;
afr_self_heal_t *sh = NULL;
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index ef93e5078a2..b65a4dc466d 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -448,7 +448,8 @@ afr_self_heal_cbk (call_frame_t *frame, xlator_t *this)
int
afr_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)
+ inode_t *inode, struct stat *buf, dict_t *xattr,
+ struct stat *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -789,7 +790,8 @@ out:
int
afr_open_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct stat *buf)
+ int32_t op_ret, int32_t op_errno, struct stat *prebuf,
+ struct stat *postbuf)
{
afr_local_t * local = frame->local;
int ret = 0;
@@ -864,8 +866,8 @@ afr_open_cbk (call_frame_t *frame, void *cookie,
int
-afr_open (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, fd_t *fd)
+afr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ fd_t *fd, int32_t wbflags)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -910,7 +912,7 @@ afr_open (call_frame_t *frame, xlator_t *this,
STACK_WIND_COOKIE (frame, afr_open_cbk, (void *) (long) i,
priv->children[i],
priv->children[i]->fops->open,
- loc, wind_flags, fd);
+ loc, wind_flags, fd, wbflags);
if (!--call_count)
break;
@@ -1152,8 +1154,9 @@ out:
/* {{{ fsync */
int
-afr_fsync_cbk (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret, int32_t op_errno)
+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)
{
afr_local_t *local = NULL;
@@ -1294,7 +1297,7 @@ afr_fsyncdir (call_frame_t *frame, xlator_t *this, fd_t *fd,
for (i = 0; i < priv->child_count; i++) {
if (local->child_up[i]) {
- STACK_WIND (frame, afr_fsync_cbk,
+ STACK_WIND (frame, afr_fsyncdir_cbk,
priv->children[i],
priv->children[i]->fops->fsyncdir,
fd, datasync);