summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
authorAnand V. Avati <avati@amp.gluster.com>2009-04-11 01:52:08 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-04-12 11:33:47 +0530
commitf33f0669efd89216a528bab3694ac4645a7f523b (patch)
tree071210cb6f567a9353af70fbcbef5ce9f2fbf56c /xlators/cluster/afr/src
parente0e6acd6fbdcbd294c89e61cbe108fc1b96a62a8 (diff)
update cluster/afr with new readv writev prototypes
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c9
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c15
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.h3
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c8
-rw-r--r--xlators/cluster/afr/src/afr.h2
5 files changed, 20 insertions, 17 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index c7a7e99879d..2fa8f9e3632 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -679,7 +679,8 @@ 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 stat *buf,
+ struct iobref *iobref)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -732,7 +733,8 @@ afr_readv_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
- AFR_STACK_UNWIND (frame, op_ret, op_errno, vector, count, buf);
+ AFR_STACK_UNWIND (frame, op_ret, op_errno, vector, count, buf,
+ iobref);
}
return 0;
@@ -802,7 +804,8 @@ afr_readv (call_frame_t *frame, xlator_t *this,
op_ret = 0;
out:
if (op_ret == -1) {
- AFR_STACK_UNWIND (frame, op_ret, op_errno, NULL, 0, NULL);
+ AFR_STACK_UNWIND (frame, op_ret, op_errno, NULL, 0, NULL,
+ NULL);
}
return 0;
}
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 8d33d5f62ef..e8d843b3ce8 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -939,7 +939,8 @@ afr_writev_wind (call_frame_t *frame, xlator_t *this)
local->fd,
local->cont.writev.vector,
local->cont.writev.count,
- local->cont.writev.offset);
+ local->cont.writev.offset,
+ local->cont.writev.iobref);
if (!--call_count)
break;
@@ -957,9 +958,8 @@ afr_writev_done (call_frame_t *frame, xlator_t *this)
local = frame->local;
- if (local->cont.writev.refs)
- dict_unref (local->cont.writev.refs);
- local->cont.writev.refs = NULL;
+ iobref_unref (local->cont.writev.iobref);
+ local->cont.writev.iobref = NULL;
local->transaction.unwind (frame, this);
@@ -971,7 +971,8 @@ afr_writev_done (call_frame_t *frame, xlator_t *this)
int
afr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iovec *vector, int32_t count, off_t offset)
+ struct iovec *vector, int32_t count, off_t offset,
+ struct iobref *iobref)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -1010,9 +1011,7 @@ afr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
local->cont.writev.count = count;
local->cont.writev.offset = offset;
local->cont.writev.ino = fd->inode->ino;
-
- if (frame->root->req_refs)
- local->cont.writev.refs = dict_ref (frame->root->req_refs);
+ local->cont.writev.iobref = iobref_ref (iobref);
local->transaction.fop = afr_writev_wind;
local->transaction.done = afr_writev_done;
diff --git a/xlators/cluster/afr/src/afr-inode-write.h b/xlators/cluster/afr/src/afr-inode-write.h
index 1f1a3a35afd..358d25b5271 100644
--- a/xlators/cluster/afr/src/afr-inode-write.h
+++ b/xlators/cluster/afr/src/afr-inode-write.h
@@ -38,7 +38,8 @@ afr_fchmod (call_frame_t *frame, xlator_t *this,
int32_t
afr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct iovec *vector, int32_t count, off_t offset);
+ struct iovec *vector, int32_t count, off_t offset,
+ struct iobref *iobref);
int32_t
afr_truncate (call_frame_t *frame, xlator_t *this,
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index 2c1ceafffa1..0f06e45584e 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -478,7 +478,8 @@ afr_sh_data_write_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
afr_sh_data_read_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 stat *buf,
+ struct iobref *iobref)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -511,8 +512,6 @@ afr_sh_data_read_cbk (call_frame_t *frame, void *cookie,
offset = sh->offset;
sh->offset += op_ret;
- frame->root->req_refs = frame->root->rsp_refs;
-
if (sh->file_has_holes) {
if (iov_0filled (vector, count) == 0) {
/* the iter function depends on the
@@ -533,7 +532,8 @@ afr_sh_data_read_cbk (call_frame_t *frame, void *cookie,
(void *) (long) i,
priv->children[i],
priv->children[i]->fops->writev,
- sh->healing_fd, vector, count, offset);
+ sh->healing_fd, vector, count, offset,
+ iobref);
if (!--call_count)
break;
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 10e50c967ca..c15ed85f9c6 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -263,7 +263,7 @@ typedef struct _afr_local {
int32_t op_ret;
struct iovec *vector;
- dict_t *refs;
+ struct iobref *iobref;
int32_t count;
off_t offset;
} writev;