summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src')
-rwxr-xr-xlibglusterfs/src/generator.py3
-rw-r--r--libglusterfs/src/syncop.c21
-rw-r--r--libglusterfs/src/syncop.h5
3 files changed, 24 insertions, 5 deletions
diff --git a/libglusterfs/src/generator.py b/libglusterfs/src/generator.py
index 7fa5f433501..5b5d54e3567 100755
--- a/libglusterfs/src/generator.py
+++ b/libglusterfs/src/generator.py
@@ -142,6 +142,8 @@ ops['writev'] = (
('fop-arg', 'off', 'off_t', 'offset'),
('fop-arg', 'flags', 'uint32_t', 'flags'),
('fop-arg', 'iobref', 'struct iobref *'),
+ ('extra', 'preop', 'struct iatt', '&preop'),
+ ('extra', 'postop', 'struct iatt', '&postop'),
('fop-arg', 'xdata', 'dict_t *', 'xdata'),
('cbk-arg', 'prebuf', 'struct iatt *'),
('cbk-arg', 'postbuf', 'struct iatt *'),
@@ -154,6 +156,7 @@ ops['readv'] = (
('fop-arg', 'size', 'size_t'),
('fop-arg', 'offset', 'off_t'),
('fop-arg', 'flags', 'uint32_t'),
+ ('extra', 'iatt', 'struct iatt', '&iatt'),
('fop-arg', 'xdata', 'dict_t *'),
('cbk-arg', 'vector', 'struct iovec *'),
('cbk-arg', 'count', 'int32_t'),
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 58c606b238f..01036f59f8a 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -1914,6 +1914,7 @@ syncop_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
args->iobref = iobref_ref (iobref);
args->vector = iov_dup (vector, count);
args->count = count;
+ args->iatt1 = *stbuf;
}
__wake (args);
@@ -1925,7 +1926,8 @@ syncop_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
uint32_t flags, struct iovec **vector, int *count,
- struct iobref **iobref, dict_t *xdata_in, dict_t **xdata_out)
+ struct iobref **iobref, struct iatt *iatt,
+ dict_t *xdata_in, dict_t **xdata_out)
{
struct syncargs args = {0, };
@@ -1937,6 +1939,9 @@ syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
else if (args.xdata)
dict_unref (args.xdata);
+ if (iatt)
+ *iatt = args.iatt1;
+
if (args.op_ret < 0)
goto out;
@@ -1958,7 +1963,6 @@ out:
if (args.op_ret < 0)
return -args.op_errno;
return args.op_ret;
-
}
int
@@ -1975,6 +1979,11 @@ syncop_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (xdata)
args->xdata = dict_ref (xdata);
+ if (op_ret >= 0) {
+ args->iatt1 = *prebuf;
+ args->iatt2 = *postbuf;
+ }
+
__wake (args);
return 0;
@@ -1983,7 +1992,8 @@ syncop_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,
int32_t count, off_t offset, struct iobref *iobref,
- uint32_t flags, dict_t *xdata_in, dict_t **xdata_out)
+ uint32_t flags, struct iatt *preiatt, struct iatt *postiatt,
+ dict_t *xdata_in, dict_t **xdata_out)
{
struct syncargs args = {0, };
@@ -1991,6 +2001,11 @@ syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,
fd, (struct iovec *) vector, count, offset, flags, iobref,
xdata_in);
+ if (preiatt)
+ *preiatt = args.iatt1;
+ if (postiatt)
+ *postiatt = args.iatt2;
+
if (xdata_out)
*xdata_out = args.xdata;
else if (args.xdata)
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 3b2556535b7..c7d58402df0 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -460,13 +460,14 @@ int syncop_write (xlator_t *subvol, fd_t *fd, const char *buf, int size,
int syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,
int32_t count, off_t offset, struct iobref *iobref,
- uint32_t flags, dict_t *xdata_in, dict_t **xdata_out);
+ uint32_t flags, struct iatt *preiatt, struct iatt *postiatt,
+ dict_t *xdata_in, dict_t **xdata_out);
int syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
uint32_t flags,
/* out */
struct iovec **vector, int *count, struct iobref **iobref,
- dict_t *xdata_in, dict_t **xdata_out);
+ struct iatt *iatt, dict_t *xdata_in, dict_t **xdata_out);
int syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset,
dict_t *xdata_in, dict_t **xdata_out);